File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes Starting/Stopping multiple instances of apache 6 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Starting/Stopping multiple instances of apache 6 " Watch "Starting/Stopping multiple instances of apache 6 " New topic

Starting/Stopping multiple instances of apache 6

chander shivdasani
Ranch Hand

Joined: Oct 09, 2007
Posts: 206

The default way of starting Tomcat is: $TOMCAT_HOME/bin/, which uses $TOMCAT_HOME/conf/server.xml as its configuration file.

Is there a way to pass the configuration file through command line when calling I want to start multiple instances of tomcat on different ports.

Also, if the above thing is possible, is there a way to stop these instances individually. By means of passing some parameter to ./shutdown

Enjoy, Chander
SCJP 5, Oracle Certified PL/SQL Developer
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

TOMCAT_HOME is partly my fault. There is no such thing as TOMCAT_HOME. There are actually two environment variables here: CATALINA_HOME and CATALINA_BASE. But I can never remember which is which, so I cheat and just say "TOMCAT_HOME".

Tomcat is split into 2 parts. One part is common to all instances of Tomcat. It contains things like the bin and lib directories.

The other part is replicated per-instance. It contains the work, temp and log directories. And conf, which is where the server.xml that defines what ports a given Tomcat instance uses.

So to run (and start/stop) multiple Tomcat instances, you no longer have CATALINA_HOME and CATALINA_BASE aimed at the same "TOMCAT_HOME" directory, but instead you have one CATALINA_HOME for all the Tomcats and a separate CATALINA_BASE for each Tomcat.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: Starting/Stopping multiple instances of apache 6
It's not a secret anymore!