tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ben Rometsch" <...@solidstategroup.com>
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
mod_jk. 

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
List: 

www.sitea.com/
localhost/sitea
www.siteb.com/
localhost/siteb
www.sitec.com/
localhost/sitec

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="www.sitea.com">
  <Context path="" docBase="/opt/tomcat/webapps/sitea" debug="0"
reloadable="true"/>
</Host>

<Host name="www.siteb.com">
  <Context path="" docBase="/opt/tomcat/webapps/siteb" debug="0"
reloadable="true"/>
</Host>

<Host name="www.sitec.com">
  <Context path="" docBase="/opt/tomcat/webapps/sitec" debug="0"
reloadable="true"/>
</Host>

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,
Ben

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message