同时开启两个Tomcat

tomcat版本:9.0.44
首先复制粘贴一份tomcat文件夹,找到conf\server.xml文件
修改

<Server port="8005" shutdown="SHUTDOWN">

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

<Server port="8006" shutdown="SHUTDOWN">

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

接着用编辑器打开bin\start.bat

在首行加上

set TITLE="Tomcat2"
set CATALINA_BASE="D:\Program_Files\Environment\apache-tomcat2"
set CATALINA_HOME="D:\Program_Files\Environment\apache-tomcat2"

需将新的Tomcat路径放入其中
此时便可以运行两个Tomcat了

上一篇:C#中Application.StartupPath和System.Environment.CurrentDirectory的区别


下一篇:文件帮助类