tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: Virtual host configuration - best practise?
Date Sat, 19 Sep 2009 11:25:18 GMT
hepabolu wrote:

> However, from the Tomcat docs I understand that any change to server.xml
> requires a restart of Tomcat which would mean that the existing (non-dummy)
> hosts which are already in production, i.e. up and running, will also be
> taken offline. This is the heart of the problem...

Just as another look on the issue.

You mentioned previously that all the hosts run the same webapp, but 
that the configuration varies somewhat from host to host.
The applicability to your case depends a bit on how many distinct 
settings this means, but how about a setup like this :

- a front-end Apache, with VirtualHosts defined, and a mod_jk connector 
to the back-end Tomcat.  Adding a VirtualHost to Apache does not require 
a full Apache restart, just a reload of the configuration, which is less 
- in Tomcat, a single default virtual host, with a single webapp
- when an Apache VirtualHost proxies a request to Tomcat, it arranges to 
pass some "request attributes" to distinguish which Apache VirtualHost 
this was
- at the Tomcat level, the webapp reacts differently, not in function of 
its static setup, but in function of the request attributes it gets from 
Apache (this can be done with a servlet filter e.g.)

You can also have different webapps under Tomcat (one per "virtual 
host"), and have the front-end Apache can, depending on the VirtualHost, 
proxy calls to the one or the other.  At the Tomcat level, adding a 
webapp (as opposed to adding a Host) does not require a restart.

This may be one case where the added complication of having an Apache 
httpd in front of Tomcat is justified.

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

View raw message