tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: Run several applications on different ports, isolated from each other
Date Tue, 10 Jun 2008 21:18:02 GMT
Hash: SHA1


Yves Glodt wrote:
| I need to run now another application on tomcat, and what I think to
do is to
| have another "instance" of tomcat running on another port, isolated
from my
| OpenCms, with a different webapps folder as well.

Yep, you need another instance of Tomcat. Conceptually, it's very simple:

1. Create a new directory which will hold your new instance. This
~   is called CATALINA_BASE, and you'll need to set this environment
~   variable accordingly.

~   This directory should contain the following directories:

~   conf/
~   logs/      (optional, if you have no logging going here)
~   temp/      (optional, as TC should create this)
~   webapps/   (optional, if you have no auto-deployed webapps)
~   work/      (optional, as TC should create this)

~   The conf directory needs server.xml and web.xml. Make sure
~   that your <Connector>s in server.xml have unique port numbers
~   (i.e. default HTTP port is 8080, so check that, and the default
~   AJP port is 8009, so check that, too... these must be unique
~   across all TC instances).

~   Stick your webapps in 'webapps', obviously, unless you are
~   going to be declaring separate XML deployment descriptors
~   (ignore this if you have no idea what I'm talking about).

2. Run CATALINA_HOME/bin/ with the correct CATALINA_BASE
~   environment variable set. Note that CATALINA_HOME points to
~   the /actual/ TC install -- where the bin directory is -- and
~   CATALINA_BASE points to your "instance" as defined above.

| tomcat-instance 1: port 8001 webapps-folder: /var/lib/tomcat5.5/webapps
| tomcat-instance 2: port 8002 webapps-folder: /home/tomcat/webapps

No problem:

$ export CATALINA_BASE=/home/tomcat
$ /var/lib/tomcat5.5/bin/

Just make sure that /home/tomcat is set up as indicated above.

| Also, I would prefer not to touch the debian startup scripts, nor
modify any
| other distributed files. All config should be done in the tomcat

That's going to be a problem, because I'm sure those scripts assume only
a single instance of TC in the "default" location. If you want to start
up multiple TC instances, you'll have to either:

1. Copy /etc/init.d/ (or whatever) to /etc/init.d/
~   and modify it accordingly (like setting CATALINA_BASE)

2. Write a different /etc/init.d/ script that somehow
~   identifies all TC instances and starts them separately

| Can someone explain how to achieve this configuration, or maybe provide
| example-files?

The documentation is available in the RUNNING.txt file that should be
packaged with Tomcat. If you can't find that file, as the Debian folks
why they removed it.

- -chris
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla -


To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message