分别在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
软件安装顺序如下(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也是一样的配置.