在有些應(yīng)用中,有時(shí)需要在一臺(tái)機(jī)器上啟動(dòng)兩個(gè)或多個(gè)Tomcat,如Tomcat+Eclipse+Geoserver應(yīng)用中:
方法:
1、修改Server.xml
將所有涉及到端口的數(shù)字的首數(shù)字加1,具體情況可視需要而定,只要該端口沒(méi)有被占用即可。
如:
<!-- 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 語(yǔ)句注釋掉,
rem Guess CATALINA_HOME if not defined
set CURRENT_DIR=%cd%
rem if not "%CATALINA_HOME%" == "" goto gotHome
set CATALINA_HOME=%CURRENT_DIR%