tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ben Rometsch" <>
Subject Managing automatic deployment with multiple virtual hosts
Date Fri, 10 Jun 2005 16:09:01 GMT
Hi There,

I am running Tomcat 5.5.9 in production, using 1 tomcat instance to
service several websites (each with their own hostname) via virtual
hosts. I have Apache 2 running in front of Tomcat, connecting via

I am having OutOfMemory issues, and have noticed that, due to my webapps
structure, I appear to be deploying 2 instances of each site. When I
look in the manager application I see the following in the Application

Etc. etc. My current directory structure is simply placing the war files
for each application into the tomcat/webapps folder. I then add a <Host>
declaration in the server.xml file for each virtual host: 

<Host name="">
  <Context path="" docBase="/opt/tomcat/webapps/sitea" debug="0"

<Host name="">
  <Context path="" docBase="/opt/tomcat/webapps/siteb" debug="0"

<Host name="">
  <Context path="" docBase="/opt/tomcat/webapps/sitec" debug="0"

I still have the localhost set up in the server.xml file: 

<Host name="localhost" appBase="webapps" unpackWARs="true"
autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">

I presume this is the culprit. The problem I am having is that I cant
figure out how to get Tomcat to auto-deploy war files without then
creating a second running instance in memory with a context path of
/sitea. I've tried a variety of different directory structures, but am
unable to deploy a war file without it correctly deploying to a / path,
and thus not consuming more memory within the VM. 

Is there a best practise way of doing this? Should I be putting
context.xml declarations in the META-INF directory of my war files? 

Thanks in advance,

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

View raw message