同一服務(wù)器部署多個tomcat時,存在端口號沖突的問題,所以需要修改tomcat配置文件server.xml梢什,以tomcat7為例。
首先了解下tomcat的幾個主要端口:
<Server port="8005" shutdown="SHUTDOWN">
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="60000" redirectPort="8443" disableUploadTimeout="false" executor="tomcatThreadPool" URIEncoding="UTF-8"/>
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
其中8005為遠程停服務(wù)端口朝聋,8080為HTTP端口8009為AJP端口嗡午,8443為HTTPS端口,APACHE能過AJP協(xié)議訪問TOMCAT的8009端口冀痕。
部署多個tomcat主要修改三個端口:
1.遠程停服務(wù)端口荔睹,默認(rèn)8005狸演,如下改為8006
<Server port="8006" shutdown="SHUTDOWN">
2.HTTP端口,默認(rèn)8080僻他,如下改為8081
<Connector port="8081" protocol="HTTP/1.1" connectionTimeout="60000" redirectPort="8443" disableUploadTimeout="false" executor="tomcatThreadPool" URIEncoding="UTF-8"/>
3.AJP端口宵距,默認(rèn)8009,如下改,8010
<Connector port="8010" protocol="AJP/1.3" redirectPort="8443" />