You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Christopher Garwood <Ch...@manchester.ac.uk> on 2006/10/20 14:13:36 UTC
multiple Tomcat config question
Hi,
I'm very new to Tomcat and web server stuff but have been asked to set up multiple instances of Tomcat on one server to talk to some database servers. I've found the existing documentation a little confusing (sorry) and was wondering if anyone would be able either to give me step-by-step advice or point me to some documentation that uses very simple language - I'm basically looking for the hand puppet version of things. My scenario is as follows:
I have one web server and several database servers (possibly more to come) all on different machines in different parts of my building. I have a different web front end for each database - this is something I can't change as it's a requirement. 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. 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. My OS is Windows (XP I believe) and I'm using Tomcat 5.0 - I can't alter these because of dependencies on our current software. I was also under the impression that I had to use a connector (mod_jk?) but this wasn't hugely clear to me.
My current understanding is that I need to create folders for each Tomcat instance and copy certain files from the main Tomcat into them. I also believe that I need to change the port listings within one of the files. However, I'm not much clearer on things other than that.
I'm sure this is probably very simple but any assistance would be greatly appreciated. Thanks very much for your time.
Chris.
---------------------------------------------------------------------
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
Re: multiple Tomcat config question
Posted by Franck Borel <bo...@ub.uni-freiburg.de>.
Hi Cristopher,
I was also under the impression that I had to use a
> connector (mod_jk?) but this wasn't hugely clear to me.
You only need mod_jk if you want to connect Apache to Tomcat. If you are
using Tomcat as standalone server, only configure Tomcat.
The most important configuration file is server.xml. You will find it
under c:\<Path To Tomcat>\conf\server.xml or /<Path To
Tomcat>/conf/server.xml if you are using Linux. The second important
file is the log file under c:\<Path To Tomcat>\logs. Everytime something
goes wrong take a look at it.
> My current understanding is that I need to create folders for each
> Tomcat instance and copy certain files from the main Tomcat into them.
You need only *one* Tomcat instance, but for each web application one
context.
> I also believe that I need to change the port listings within one of the
> files. However, I'm not much clearer on things other than that.
You need an connector who is listen to Port 80 or Port 8080. Open the
main configuration file server.xml and add following entry:
<Connector port = "80"
maxHttpHeaderSize = "8192"
maxThreads = "150"
minSpareThreads = "25"
maxSpareThreads = "75"
enableLookups = "false"
redirectPort = "8443"
acceptCount = "100"
connectionTimeout = "20000"
disableUploadTimeout = "true" />
This must be placed in the block <Service/>. Be shure that you run only
one Tomcat and no web server, who listen to Port 80. This will cause
problems. You can add other ports like 443 or 8443 to secure your
connection, but try this only after you get some meanfull results :-).
-- Franck
--
====================================================================
Dipl.-Hyd. Franck Borel Universitaetsbibliothek Freiburg
EMail: borel@ub.uni-freiburg.de EDV-Dezernat
Tel. : +49-761 / 203-3908 Werthmannplatz 2 | Postfach 1629
Fax : +49-761 / 203-3987 79098 Freiburg | 79016 Freiburg
Re: multiple Tomcat config question
Posted by Christopher Schultz <ch...@christopherschultz.net>.
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)