[root@porxy-nfs ~]# sh install_nginx_proxy.sh
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
config success
Created symlink from /etc/systemd/system/multi-user.target.wants/nginx.service to /usr/lib/systemd/system/nginx.service.
root 13283 10234 0 09:07 pts/0 00:00:00 sh install_nginx_proxy.sh
root 13589 1 0 09:07 ? 00:00:00 nginx: master process /usr/sbin/nginx
nginx 13590 13589 0 09:07 ? 00:00:00 nginx: worker process
Start nginx successful
部署nfs-server
[root@porxy-nfs ~]# vim install_nfs_server.sh#!/usr/bin/bashtest -s /etc/exports
if[$? -eq 0 ]then
/usr/bin/yum -y install rpcbind nfs-utils
echo"/share 192.168.131.132/24 (rw,sync,root_squash,sid=0)"> /etc/exports
mkdir -p /share
chmod -R o+w /share
systemctl enable rpcbind.service --now && systemctl enable nfs-server.service --now
iptables -F && iptables -X
share=`showmount -e`
access_IP=`awk'{print $2}' /etc/exports`echo"NFS was successfully installed. The directory you shared with us is: $share$access_IP"exitelseecho"NFS was installed"exitfi
[root@porxy-nfs ~]# sh install_nfs_server.sh
NFS was successfully installed. The directory you shared with us is: 192.168.131.132/24
[root@nginx01 ~]# sh install_nginx.sh
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
config success
Created symlink from /etc/systemd/system/multi-user.target.wants/nginx.service to /usr/lib/systemd/system/nginx.service.
root 22300 7245 0 09:28 pts/0 00:00:00 sh install_nginx.sh
root 23036 1 0 09:30 ? 00:00:00 nginx: master process /usr/sbin/nginx
nginx 23037 23036 0 09:30 ? 00:00:00 nginx: worker process
Start nginx successful
[root@nginx01 ~]# sh install_nfs_client.sh
Redirecting to /bin/systemctl start rpcbind.service
Redirecting to /bin/systemctl start nfs.service
Export list for 192.168.131.132:
/share (everyone)