标签:
1 准备工作
CentOS 6.5
Nginx 1.8.0
Tomcat 8.0.24
备注:
1) CentOS,Nginx,Tomcat 下载、安装省略
2)Nginx (示例)路径: /usr/local/nginx-1.8.0
3)Tomcat (示例)路径: /usr/server/tomcat01 /usr/server/tomcat02
2 Nginx配置
1)进入nginx配置文件conf/nginx.conf
2)查看配置文件,不用修改,保持端口号为80
3)进入目录 ./sbin ,并启动nginx
3 Tomcat配置
进入tomcat配置文件conf/server.xml,有以下三处地方需要修改
1)<Server port="8005" shutdown="SHUTDOWN">
修改为 <Server port="8006" shutdown="SHUTDOWN">
2)<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="100" redirectPort="8443" />
修改为 <Connector port="8081" protocol="HTTP/1.1" connectionTimeout="100" redirectPort="8443" />
3)<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
修改为 <Connector port="8010" protocol="AJP/1.3" redirectPort="8443" />
4 Nginx + Tomcat实现负载均衡
1)打开nginx配置文件 nginx.conf
2)修改如下图所示
标签:
原文地址:http://www.cnblogs.com/macsnow/p/4837328.html