File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Starting/Stopping multiple instances of apache 6 " Watch "Starting/Stopping multiple instances of apache 6 " New topic
Author

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/startup.sh, 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 startup.sh. 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: 16137
    
  21

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Starting/Stopping multiple instances of apache 6