How can I start two Tomcat instances in a single LINUX machine. Both the tomcat must run on the different ports. If this is possible then How can I do this
Thanks.
It's very possible, just create two copies of the installation and make sure to edit the TOMCAT_HOME/conf/server.xml in one instance and change the ports so they don't clash. Start each instance with their own TOMCAT_HOME/bin/startup.sh script.
The one port you will have to change in one of your Tomcats is the one defined in the port attribute of your <Connector> (8080 here):
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> Edit the tomcat configuration file (usually server.xml in tomcat\conf) and change the value after the line:
port="8080" to another port (example 8081).
Read Multiple Tomcat JVM on Jajakarta for more information.
You need to start tomcat with different catalina bases. This can be controlled for instance by the CATALINA_BASE environment variable. That variable has to point to a location containing conf, logs, temp, webapps and work subdirectories. Then you can put into the corresponding conf and webapps directories the configurations and webapps you want for the individual instances.
So something along those lines will give you two instances:
SET CATALINA_BASE=/home/tomcat_inst1/ tomcat start SET CATALINA_BASE=/home/tomcat_inst2/ tomcat start Of course, as other people wrote, you have to ensure that the listening ports for any connectors are different in each instance.
Also see here: http://www.jguru.com/faq/view.jsp?EID=1121565