美文网首页MySQL数据库高可用集群方案
项目分步12:升级网站运行平台

项目分步12:升级网站运行平台

作者: 大白菜的猪猪 | 来源:发表于2020-05-17 12:36 被阅读0次

    清除当前配置

    分别在33和44主机上

    停止服务

    禁止开机运行

    [root@web33 ~]# systemctl stop httpd

    [root@web33 ~]# systemctl disable httpd

    [root@web44 ~]# systemctl stop httpd

    [root@web44 ~]# systemctl disable httpd

    卸载共享存储

    在web33和web44主机上:

    卸载当前加载

    清除开机加载配置

    [root@web33 ~]# umount /var/www/html/

    [root@web33 ~]# vim /etc/fstab

    #192.168.4.30:/sitedir /var/www/html

    nfs defaults 0 0

    [root@web44 ~]# umount /var/www/html/

    [root@web44 ~]# vim /etc/fstab

    #192.168.4.30:/sitedir /var/www/html nfs defaults 0 0

    部署LNMP

    安装软件

    软件安装顺序如下(web33和web44)

    安装源码软件Nginx软件

    安装php-fpm

    安装php及php-mysql软件

    安装mariadb-server及mariadb,mariadb-devel软件

    挂载共享存储

    具体操作如下:(web33和web44)

    挂载共享存储

    配置远程加载服务开机运行

    [root@web33 nginx-1.12.2]# vim /etc/fstab  192.168.4.30:/sitedir

    /usr/local/nginx/html nfs defaults 0 0

    [root@web33 nginx-1.12.2]# mount -a

    [root@web33 nginx-1.12.2]# mount | grep "/usr/local/nginx/html"

    [root@web33 ~]# systemctl enable remote-fs.target

    [root@web33 Zabbix]# yum -y install gcc pcre-devel openssl-devel

    [root@web33 Zabbix]# tar -xf nginx-1.12.2.tar.gz

    [root@web33 Zabbix]# cd nginx-1.12.2/

    [root@web33 nginx-1.12.2]#

    ./configure --with-http_ssl_module

    [root@web33 nginx-1.12.2]# make && make install

    [root@web33 ~]# vim +65 /usr/local/nginx/conf/nginx.conf

     location ~ \.php$ {

                root           html;

                fastcgi_pass   127.0.0.1:9000;

                fastcgi_index  index.php;

                include        fastcgi.conf;

            }

    [root@web33 ~]# yum -y install php

    php-mysql mariadb mariadb-devel mariadb-server php-fpm

    [root@web33 ~]# /usr/local/nginx/sbin/nginx

    [root@web33 ~]# systemctl start php-fpm

    [root@web33 ~]# ls /usr/local/nginx/html/

    test2.html  test.html

    [root@nfs30 ~]# vim /sitedir/test.php

    <?php

    $school="hahaha";

    echo $school;

    ?>

    [root@web44 ~]# curl

    192.168.4.33/test.php

    hahaha

    证明web33部署完毕,web44也是一样的配置.

    相关文章

      网友评论

        本文标题:项目分步12:升级网站运行平台

        本文链接:https://www.haomeiwen.com/subject/ncojohtx.html