項(xiàng)目分步12:升級網(wǎng)站運(yùn)行平臺

清除當(dāng)前配置

分別在33和44主機(jī)上

停止服務(wù)

禁止開機(jī)運(yùn)行

[root@web33 ~]# systemctl stop httpd

[root@web33 ~]# systemctl disable httpd

[root@web44 ~]# systemctl stop httpd

[root@web44 ~]# systemctl disable httpd

卸載共享存儲(chǔ)

在web33和web44主機(jī)上:

卸載當(dāng)前加載

清除開機(jī)加載配置

[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軟件

掛載共享存儲(chǔ)

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

掛載共享存儲(chǔ)

配置遠(yuǎn)程加載服務(wù)開機(jī)運(yùn)行

[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也是一樣的配置.

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲(chǔ)服務(wù)。

友情鏈接更多精彩內(nèi)容