Thursday, January 10, 2008

How to run multiple tomcat instances on windows

1) Have two separate Tomcat installation folders on your windows box.
Lets assume they are located under c:\tomcat1 and c:\tomcat2 respectively.
2) I am assuming you can run the "tomcat1" instance without issues using command
c:\tomcat1\bin\startup.bat

3) To allow the "tomcat2" instance run without problems, just change all the port numbers in
your conf\server.xml (*just increase all the port numbers by 1).

4) Then from the command line do the following :
set CATALINA_HOME=c:\tomcat2
and then startup the second tomcat2 instance
c:\tomcat2\bin\startup.bat

This second tomcat instance will start up using the different ports (from your c:\tomcat2\conf\server.xml and since you changed the CATALINA_HOME it will look for all other environment variable values under c:\tomcat2 directory instead of c:\tomcat directory.

Easy, wasn't it :-)

Any comments are most welcome..