Step1: Three Web Server Environment configuration: iptables-f; Setenforce 0 shut down the firewall; close Setlinux
Step2: Three Web server install software
STEP3: Host modification configuration file: vim/usr/local/nginx/conf/nginx.conf
Proxy Server Modify the file: Modify the port, the port can be set by itself, do not change the default is OK, but the corresponding match
For test needs, change the HTML files for the three Nginx machines:
Mv/usr/local/nginx/html/index.html/usr/local/nginx/html/index.html.bak
echo Server1 (SERVER2/3) >> mv/usr/local/nginx/html/index.html
Step4: Start Ngnix
/usr/local/nginx/sbin/nginx-c/usr/local/nginx/conf/nginx.conf
STEP5 test the IP of the access host to see if the server will be replaced.
STEP6 Three Machines install NFS (the above environment is already configured OK)
Yum Install Rpcbind nfs-utils-y
STEP7 Host Configuration NFS
Mkdir/share #创建分享目录
Mount/dev/sdb1/share mount a usable hard disk
Vim/etc/exports
To start NFS:
Modify the path permissions of the/share to allow access to read and write permissions for the client
chmod 775/share
STEP8 Modifying the proxy server:
Proxy Server as Client, NFS configuration is not modified, but shared files must be set
Mount 192.168.16.183:/share/usr/local/nginx/html (Set the shared file path to HTML to ensure that three machines share the same storage)
STEP9 Test
echo ' Hello World ' >>/share/test.html
Access IP to see if it can be displayed
Eg:nginx reverse proxy Two Web servers for load balancing all Web services share a single NFS storage