Ubuntu配置多个tomcat

在 /etc/profile中配置多个tomcat

#tomcat7
export CATALINA_HOME7=/root/tomcat/tomcat5/apache-tomcat-9.0.16
export CATALINA_BASE7=/root/tomcat/tomcat5/apache-tomcat-9.0.16
export TOMCAT_HOME7=/root/tomcat/tomcat5/apache-tomcat-9.0.16
#tomcat路径
#tomcat8
export CATALINA_HOME8=/root/tomcat/tomcat6/apache-tomcat-9.0.13
export CATALINA_BASE8=/root/tomcat/tomcat6/apache-tomcat-9.0.13
export TOMCAT_HOME8=/root/tomcat/tomcat6/apache-tomcat-9.0.13

在 tomcat bin目录下catalina.sh加入新的路径
在# OS specific support. $var must be set to either true or false.后面加入

# OS specific support.  $var _must_ be set to either true or false.
export CATALINA_BASE=$CATALINA_BASE7
export CATALINA_HOME=$CATALINA_HOME7

server.xml需修改三个地方的port

<Server port="8012" shutdown="SHUTDOWN">
  <Listener className="org.apache.catalina.startup.VersionLoggerListener" />
  <!-- Security listener. Documentation at /docs/config/listeners.html
  <Listener className="org.apache.catalina.security.SecurityListener" />
  -->
  <!--APR library loader. Documentation at /docs/apr.html -->
  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
  <!-- Prevent memory leaks due to use of particular java/javax APIs-->
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />

 <Connector port="8086" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />

<Connector port="8016" protocol="AJP/1.3" redirectPort="8443" />

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值