tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: multiple Tomcat config question
Date Fri, 20 Oct 2006 13:55:55 GMT
Chris (Garwood),

> I need to set up multiple instances
> of Tomcat, one for each web front end so that each front end can talk to
> its respective database.

As someone else on the the list mentioned, you can probably run a single
instance of Tomcat with multiple contexts (webapps) defined. It's not
entirely clear based upon your original message if multiple Tomcats is a
requirement, but here's how to do it. I'll quote myself from a message I
wrote yesterday to this same list:

> 1. Create a directory structure for each webapp (outside of Tomcat's
> installation directory) like this:
> 
> struts-dev-1/
> struts-dev-1/conf
> struts-dev-1/conf/server.xml
> struts-dev-1/conf/web.xml
> struts-dev-1/webapps
> struts-dev-1/logs
> struts-dev-1/temp
> 
> ** Make sure to set your port numbers for your shutdown and connector
> ports to something unique among your webapps. I usually use 8x85 for the
> ajp13 connector port and 8x86 for the shutdown port.
> 
> 2. Install your webapp to the directory struts-dev-1/webapps/struts-dev-1
> 
> 3. Configure Tomcat to use "struts-dev-1" as your root webapp (usually
> by specifying that the "path" is "" instead of "/struts-dev-1").
> 
> 4. Start each Tomcat instance like this:
> 
> $ export JAVA_HOME=...
> $ export CATALINA_HOME=/path/to/full/tomcat/install
> $ export CATALINA_BASE=/path/to/struts-dev-1
> $ export CATALINA_TMPDIR=/path/th/struts-dev-1/temp
> $ /path/to/full/tomcat/install/bin/startup.sh
> 
> This setup allows you to have separate root webapps (or any other kind
> of setup). You also have the benefit (I choose to see it as a benefit)
> of separate JVMs and Tomcat instances. You can take one down without
> bothering the others.

Hope that helps.

> I also need to have this run as a service so
> that if the web server needs to be rebooted then all my Tomcat instances
> will automatically restart.

I'm not an expert on running Tomcat as a service on Windows. My
understanding is that there is a utility out there that can turn any
program or script into a service. Someone else on the list will have to
help with that; sorry.

-chris (Schultz)


Mime
View raw message