tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Jones <>
Subject Re: Tomcat Configuration Help
Date Thu, 05 Aug 2010 23:09:22 GMT
Chuck, this is great thanks. 

OK, I'll fill in some of the gaps here I'm running Tomcat 6.0.26, planning on upgrading to
6.0.29 shortly. Im using Java 6 on Mac OS X server. 

So I have one question, on your comments on <Context> elements in server.xml. I put
the <Context> element in so that I could set the docBase to my app directory thus avoiding
the need to append "appWebServices" to the URL (e.g. http://mysite:3100/ vs. http://mysite:3100/appWebServices).
Is there a better way to do this?


----- Original Message -----
From: "Charles R Caldarale" <>
To: "Tomcat Users List" <>
Sent: Thursday, August 5, 2010 3:48:14 PM
Subject: RE: Tomcat Configuration Help

> From: Tom Jones []
> Subject: Tomcat Configuration Help
> I'm totally new to Tomcat and I have been searching the net for a
> little while now looking for info on configuring tomcat to host
> multiple apps on different ports and different web roots.

Other than not telling us the Tomcat version you're using (along with the JVM and platform),
you've done a pretty good job of explaining the situation.

If you don't need to isolate the applications by port (that's quite unusual), you can simplify
things a bit by using virtual hosting:

> I have come across some posts on running multiple instances 
> which might be the right thing for me I'm still not sure.

Multiple instances are not strictly necessary, but might be easier to administer, and will
obviously avoid undesired interaction between the two webapps.

> tomcat
> - webapps
> -- appWebServices
> -- appMainUserSite

That's not good.  Each <Host> should have its own appBase; by sharing them, you've made
both apps available on both hosts.

> I would like to run the app "appWebServices" on port 3100 with the
> docBase to be "tomcat/webapps/appWebServices". I would also like the
> app to support 500 simultaneous connections. Now I would like to run
> the app "appMainUserSite" on port 3200 with the docBase to be
> "tomcat/webapps/appMainUserSite". I would also like the app to support
> 100 simultaneous connections.

As you surmised, you will need separate <Service> elements if you want to segregate
the apps by port number.

> <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"

You might want to use a unique namePrefix for each <Executor> so you can more easily
tell them apart in a thread dump (should that ever be necessary).

> <Connector executor="tomcatThreadPool" port="3100"
> redirectPort="3144"

If you don't have a <Connector> for port 3144, why do have a redirectPort?  Also be
aware that many versions of IE don't handle HTTPS over anything other than port 443.

> <Host name="localhost" appBase="webapps" 

The appBase should be unique for each <Host>.

> <Context path="" docBase="appWebServices"/>

This is bad; do not put <Context> elements in server.xml.  Your webapp should be located
in this <Host>'s appBase directory, and named ROOT (case-sensitive, even on Windows).
 What you have now got you double deployment, once as the default webapp and once more as
appWebServices - confusing at best.  The <Context> element, if you need one at all -
and you don't, in this situation - should be in the webapp's META-INF/context.xml file, in
other words:


and must not include path or docBase attributes.

> <Executor name="mySiteThreadPool" namePrefix="catalina-exec-"

See namePrefix comment above.

> <Host name="localhost" appBase="webapps"

See appBase comment above.

> <Context path="" docBase="appMainUserSite" />

See <Context> comment above.

 - Chuck

for use only by the intended recipient. If you received this in error, please contact the
sender and delete the e-mail and its attachments from all computers.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message