如何同时运行两个Tomcat

启动双Tomcat教程

在已存在一个Tomcat、已配置好环境变量CATALINA_HOME的情况下(!建议 !)

1.修改conf/server.xml文件

1 <!-- <Server port="8005" shutdown="SHUTDOWN"> -->
2 <Server port="8006" shutdown="SHUTDOWN">
3 4 <!-- <Connector connectionTimeout="20000" port="8880" protocol="HTTP/1.1" redirectPort="8443"/> -->
5 <Connector connectionTimeout="20000" port="9999" protocol="HTTP/1.1" redirectPort="8443"/>
6 7 <!-- 若不存在可不修改 -->
8 <!-- <Connector protocol="AJP/1.3" address="::1" port="8009" redirectPort="8443"/> -->
9 <Connector protocol="AJP/1.3" address="::1" port="8009" redirectPort="8443"/>

2.修改bin/startup.bat文件

  已配置环境变量和JAVA_HOME

1 rem Guess CATALINA_HOME if not defined
2 set "CURRENT_DIR=%cd%"
3 rem if not "%CATALINA_HOME%" == "" goto gotHome
4 rem 在上一行前添加rem,相当于注释
5 set "CATALINA_HOME=%CURRENT_DIR%"
6 if exist "%CATALINA_HOME%incatalina.bat" goto okHome
7 cd ..
8 set "CATALINA_HOME=%cd%"
9 cd "%CURRENT_DIR%"

  未配置环境变量、未配置JAVA_HOME

1 SET JAVA_HOME = D:Javajdk1.8.0_144
2 
3 SET CATALINA_HOME = D:apache-tomcat-8.5.51-new

3.大功告成!

————————————————
版权声明:本文为博客园博主「Neumann97」的原创文章,转载请附上原文出处链接及本声明。
原文链接:https://www.cnblogs.com/dream-by-dream/p/13037362.html

原文地址:https://www.cnblogs.com/dream-by-dream/p/13037362.html