在有些应用中,有时需要在一台机器上启动两个或多个Tomcat,如Tomcat+Eclipse+Geoserver应用中:
方法:
1、修改Server.xml
将所有涉及到端口的数字的首数字加1,具体情况可视需要而定,只要该端口没有被占用即可。
如:
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="9009" protocol="AJP/1.3" redirectPort="9443"/>
<!-- An Engine represents the entry point (within Catalina) that processes
every request. The Engine implementation for Tomcat stand alone
analyzes the HTTP headers included with the request, and passes them
2、修改Startup.bat
将 if not "%CATALINA_HOME%" == "" goto gotHome 语句注释掉,
rem Guess CATALINA_HOME if not defined
set CURRENT_DIR=%cd%
rem if not "%CATALINA_HOME%" == "" goto gotHome
set CATALINA_HOME=%CURRENT_DIR%