修改/etc/profile 下,增加如下两个tomcat的配置。apache-tomcat-8.0.50为第一个tomcat, apache-tomcat-8.0.50_2为第二个tomcat
export CATALINA_BASE=/usr/java/tomcat/apache-tomcat-8.0.50 export CATALINA_HOME=/usr/java/tomcat/apache-tomcat-8.0.50 export TOMCAT_HOME=/usr/java/tomcat/apache-tomcat-8.0.50 export CATALINA_2_BASE=/usr/java/tomcat/apache-tomcat-8.0.50_2 export CATALINA_2_HOME=/usr/java/tomcat/apache-tomcat-8.0.50_2 export TOMCAT_2_HOME=/usr/java/tomcat/apache-tomcat-8.0.50_2
执行source /etc/profile 使配置文件生效
第一个tomcat apache-tomcat-8.0.50配置不变
第二个tomcat apache-tomcat-8.0.50_2配置
修改tomcat目录下catalina.sh
路径:${tomcat}/bin/catalina.sh
# OS specific support. $var _must_ be set to either true or false. export CATALINA_BASE=$CATALINA_2_BASE export CATALINA_HOME=$CATALINA_2_HOME
在 # OS specific support下面增加如上两行
打开第二个tomat apache-tomcat-8.0.50_2的conf目录下server.xml
路径:${tomcat}/conf/server.xml
Server prot节点端口修改
<Server port="8005" shutdown="SHUTDOWN">
改成
<Server port="9005" shutdown="SHUTDOWN">
Connector port端口号修改
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
改成
<Connector port="9080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
改成
<Connector port="9009" protocol="AJP/1.3" redirectPort="8443" />