tomcat-users mailing list archives

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

Yves,

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/startup.sh 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/startup.sh

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
config-files.

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/tomcat.sh (or whatever) to /etc/init.d/tomcat2.sh
~   and modify it accordingly (like setting CATALINA_BASE)

2. Write a different /etc/init.d/tomcat.sh 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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkhO74oACgkQ9CaO5/Lv0PAOMgCgteGLh9JSJCYeJ0pmrHIZVa3x
jocAni/LufRQ4LXwFp3H9tRGtYmSH4aG
=tRmh
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message