环境:Vmware Workstation 10,CentOS-7-x86_64-DVD-1511.iso,Xshell 4.0,ip1:192.168.216.138,ip2:192.168.216.139,ip3:192.168.216.140.
参考[Linux_Tomcat 安装笔记](http://blog.csdn.net/zhiguoliu11/article/details/72644978)在ip1:192.168.216.138,ip2:192.168.216.139各自安装一台Tomcat应用服务器。
参考[Linux_Nginx 安装笔记](http://blog.csdn.net/zhiguoliu11/article/details/72674811)在ip3:192.168.216.140安装一台nginx服务器。
编译192.168.216.138和192.168.216.139的tomcat欢迎页面
[root@localhost ROOT]# vim /usr/local/tomcat8/webapps/ROOT/index.jsp
编译192.168.216.140上nginx的配置文件
[root@localhost ~]# vim /etc/nginx/conf.d/default.conf
[root@localhost ~]# service nginx restart
Redirecting to /bin/systemctl restart nginx.service
查看错误日志
[root@localhost nginx]# less /var/log/nginx/error.log
2017/05/24 16:24:06 [crit] 16538#16538: *1 connect() to 192.168.216.138:8080 failed (13: Permission denied) while connecting to upstream, client: 192.168.216.1, server: localhost, request: “GET / HTTP/1.1”, upstream: “http://192.168.216.138:8080/“, host: “192.168.216.140”
2017/05/24 16:24:06 [warn] 16538#16538: *1 upstream server temporarily disabled while connecting to upstream, client: 192.168.216.1, server: localhost, request: “GET / HTTP/1.1”, upstream: “http://192.168.216.138:8080/“, host: “192.168.216.140”
临时关闭selinux
[root@localhost nginx]# setenforce 0