Tuesday, April 7, 2009

How to create multiple instances of Tomcat on Windows

1. Make a copy of the existing tomcat directory. In my case, it was "C:\Program Files
\Apache Software Foundation\Tomcat 6.0". I copied the "Tomcat 6.0" to "Tomcat 6.0-1"

2 Edit Tomcat 6.0-1/conf/server.xml.

3 Change the shutdown port from the default value of 8005 to let us say 8015.

5 Change the default http port from 8080 to say 8081.

6 Change the default connection port from 8009 to say 8019.

7 Save changes to server.xml.

9 Delete the contents of the Tomcat 6.0-1/logs directory.

10 Go into the \bin directory and rename the files tomcat6w and tomcat6 to tomcat6devw and tomcat6dev.

11 Now create a service for this new Tomcat instance as follows :-

tomcat6dev.exe //IS//Tomcat6Dev --DisplayName="Apache Tomcat 6 Second" --Install="C:\Program Files\Apache Software Foundation\Tomcat 6.0-1\bin\tomcat6dev.exe" --Jvm=auto --StartM
ode=jvm --StopMode=jvm --StartClass=org.apache.catalina.startup.Bootstrap --Star
tParams=start --StopClass=org.apache.catalina.startup.Bootstrap --StopParam=stop

12 Double click on tomcat6w.exe in the original instance and tomcat6devw.exe in the new instance.

13 Compare both of them and see to it that the new instance looks similar to the old one.

14 Goto services.msc and start the newly created service.

15. Try accessing Tomcat at new port.

1 comment:

Sandeep said...

I have written a Java based portable utility for automating the above steps for creating multiple instances. Since Java is platform independent, this utility works on all operating systems