分別在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
軟件安裝順序如下(web33和web44)
安裝源碼軟件Nginx軟件
安裝php-fpm
安裝php及php-mysql軟件
安裝mariadb-server及mariadb,mariadb-devel軟件
具體操作如下:(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也是一樣的配置.