在/et/profile
文件追加以下内容
# tomcat1 env ( 第一个tomcat 的环境变量)
export CATALINA_HOME=/usr/local/apache-tomcat-7.0.79
export CATALINA_BASE=/usr/local/apache-tomcat-7.0.79
export TOMCAT_HOME=/usr/local/apache-tomcat-7.0.79
# tomcat2 env (第二个tomcat 的环境变量,做一些区分,这个自己自定义就好)
export CATALINA_HOME2=/usr/local/apache-tomcat-7.0.792
export CATALINA_BASE2=/usr/local/apache-tomcat-7.0.792
export TOMCAT_HOME2=/usr/local/apache-tomcat-7.0.792
保存退出,执行source /etc/profile
让配置生效
catalina.sh
文件添加如下内容
export CATALINA_BASE=$CATALINA_BASE2
export CATALINA_HOME=$CATALINA_HOME2
server.xml
端口,避免端口冲突<Server port="8005" shutdown="SHUTDOWN"> #8005修改成8006
<Connector port="8080" protocol="HTTP/1.1" #8080修改成8081
connectionTimeout="20000"
redirectPort="8443" />
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /> #8009修改成8010
原文:https://www.cnblogs.com/shmebluk/p/13778054.html