docker学习(docker里面宝塔面板配置网站)
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/0ea2f87a20554150a4b561a609cd714a~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1728741174&x-signature=NPH8PBNTPxUQtHTrXniRS4it754%3D" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">接上一篇<span style="color: black;">文案</span>继续记录(</p>https://www.toutiao.com/i7073666216270758411/),本片学习在docker环境里面的宝塔面板配置fastadmin
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">1、</span>下载fastadmin并安装</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">下载链接 </p>https://www.fastadmin.net/download.html
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">文档<span style="color: black;">位置</span></p>https://doc.fastadmin.net/doc/install.html
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">通常</span>宝塔面板安装过程中,会提示fileinfo文件不存在,去宝塔面板的php配置里面安装fielinfo插件<span style="color: black;">就可</span>,配置伪静态用thinkphp的配置</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">2、</span>配置宿主机</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">宿主机要搭配相应的环境,<span style="color: black;">这儿</span><span style="color: black;">选取</span>LNMP(linux,nginx,mysql,php)</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">1、nginx搭建</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">yum 安装nginx</p><span style="color: black;">yum</span> install -y nginx<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">起步</span>nginx</p><span style="color: black;">systemctl</span> start nginx<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">设置nginx开机<span style="color: black;">起步</span></p>systemctl <span style="color: black;">enable</span> nginx<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">配置nginx</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">配置文件在 /etc/nginx/nginx.conf</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">配置之前先备份一下</p><span style="color: black;">cp</span> <span style="color: black;">nginx</span><span style="color: black;">.conf</span> <span style="color: black;">nginx</span><span style="color: black;">.conf</span><span style="color: black;">.backup</span>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">测试修改一下默认的配置</p><span style="color: black;">location</span> / {
<span style="color: black;">proxy_set_header</span> Host <span style="color: black;">$host</span>;
<span style="color: black;">proxy_set_header</span> X-Real-IP <span style="color: black;">$remote_addr</span>;
<span style="color: black;">proxy_pass</span>http://172.17.0.1:90;<span style="color: black;">proxy_set_header</span> X-forwarded-for <span style="color: black;">$remote_addr</span>;
}<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/91c5ff7df22a4dcf9d331388657f6d0b~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1728741174&x-signature=82quexOVAsDy07X8ZQG8MC19Od8%3D" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">2、安装PHP7.4</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">安装源</p> yum <span style="color: black;">install</span> epel-<span style="color: black;">release</span>
yum <span style="color: black;">install</span> <span style="color: black;">http</span>://rpms.remirepo.net/<span style="color: black;">enterprise</span>/remi-<span style="color: black;">release</span><span style="color: black;">-7.</span>rpm<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">安装YUM管理工具</p> <span style="color: black;">yum</span> install yum-utils<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">查看PHP(可忽略此<span style="color: black;">过程</span>)</p><span style="color: black;">yum</span> search php74<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">安装PHP</p><span style="color: black;">yum</span>install php74-php-gd php74-php-pdo php74-php-mbstring php74-php-cli php74-php-fpm php74-php-mysqlnd<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">起步</span>FPM</p><span style="color: black;">service</span> php74-php-fpm start<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">3、安装MySQL5.6</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">(1)<span style="color: black;">检测</span>系统中<span style="color: black;">是不是</span>已安装 MySQL。</span></p><span style="color: black;">rpm</span> -qa | grep mysql<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">返回空值的话,就说明<span style="color: black;">无</span>安装 MySQL 。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;"><span style="color: black;">重视</span>:</span></strong><span style="color: black;">在新版本的CentOS7中,默认的数据库已更新为了Mariadb,而非 MySQL,<span style="color: black;">因此</span>执行 yum install mysql 命令只是更新Mariadb数据库,并不会安装 MySQL 。</span></p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/7b9d7515149f45dd8f0a549b9e5867aa~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1728741174&x-signature=3yHBcr7cvqcttUGlBRkLlppZKJQ%3D" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">(2)查看已安装的 Mariadb 数据库版本。</span></p><span style="color: black;">rpm</span> -qa|grep -i mariadb<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">(3)卸载已安装的 Mariadb 数据库。</span></p>rpm -qa|grep mariadb|xargs rpm -e<span style="color: black;">--nodeps</span>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">(4)下载安装包文件。</span></p>wget http:<span style="color: black;">//repo.mysql.com/mysql-community-release-el7-5.noarch.rpm</span>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">(5)安装</p>mysql-community-release-el7-5.noarch.rpm包<span style="color: black;">rpm</span> <span style="color: black;">-ivh</span> <span style="color: black;">mysql-community-release-el7-5</span><span style="color: black;">.noarch</span><span style="color: black;">.rpm</span>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"> 安装完成之后,会在 /etc/</span>yum</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">.repos.d/ 目录下新增 mysql-community.repo 、</p>mysql-community-source.repo 两个 yum 源文件。
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">执行 yum repolist all |</span>grep<span style="color: black;"> mysql 命令查看可用的 mysql 安装文件。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">(6)安装mysql。</span></p>yum <span style="color: black;">install</span> mysql-<span style="color: black;">server</span>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">(7)<span style="color: black;">检测</span>mysql<span style="color: black;">是不是</span>安装成功。</span></p><span style="color: black;">rpm</span> -qa | grep mysql<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">(8)<span style="color: black;">起步</span> mysql 服务 。</p>systemctl <span style="color: black;">start</span>mysqld.service<span style="color: black;">#<span style="color: black;">起步</span> mysql</span>
systemctl restart mysqld.service <span style="color: black;">#重启 mysql</span>
systemctl <span style="color: black;">stop</span> mysqld.service <span style="color: black;">#停止 mysql</span>
systemctl <span style="color: black;">enable</span> mysqld.service <span style="color: black;">#设置 mysql 开机<span style="color: black;">起步</span></span>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">mysql常用文件路径:</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">/etc/my.cnf 这是mysql的主配置文件</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">/var/lib/mysql mysql数据库的数据库文件存放位置</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">/var/logs/mysqld.log 数据库的日志输出存放位置</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">(8)设置<span style="color: black;">秘码</span> 。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">mysql5.6 安装完成后,它的 root 用户的<span style="color: black;">秘码</span>默认是空的,<span style="color: black;">咱们</span>需要<span style="color: black;">即时</span>用 mysql 的 root 用户登录(<span style="color: black;">第1</span>次直接回车,<span style="color: black;">不消</span>输入<span style="color: black;">秘码</span>),并修改<span style="color: black;">秘码</span>。</p><span style="color: black;"># mysql -u root</span>
mysql> use mysql;
mysql>
update mysql.user <span style="color: black;">set</span> authentication_string=password(<span style="color: black;">root</span>) <span style="color: black;">where</span>user=<span style="color: black;">root</span> ;
update user <span style="color: black;">set</span> password=PASSWORD(<span style="color: black;">"<span style="color: black;">这儿</span>输入root用户<span style="color: black;">秘码</span>"</span>) <span style="color: black;">where</span> User=<span style="color: black;">root</span>;(已废弃)
mysql> flush privileges;<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">(9)设置远程主机登录</span></p>GRANT ALL PRIVILEGES ON *.* TO <span style="color: black;">root</span>@<span style="color: black;">%</span> IDENTIFIED BY <span style="color: black;"><span style="color: black;">秘码</span></span> WITH GRANT OPTION;
mysql> <span style="color: black;">flush</span> privileges;
感谢你的精彩评论,为我的思绪打开了新的窗口。 一看到楼主的气势,我就觉得楼主同在社区里灌水。 你的见解真是独到,让我受益匪浅。
页:
[1]