Thanks Mikolaj.  I'm going to try out having multiple appBases and
deploy as the ROOT in each.  I haven't tried that yet.  

As a side question, is this possible to do without modifying the
server.xml file every time I want to add a new host?  I've read that
it's bad practice to modify the server.xml file much like it's bad
practice to modify the httpd.conf file in Apache.  In Apache, I have a
vhost directory with .conf files for each host -- is there a similar
method to do this with Tomcat?

Thanks,
JG

-----Original Message-----
From: Mikolaj Rydzewski [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 28, 2006 8:42 AM
To: Tomcat Users List
Subject: Re: Virtual Hosts

Gormley, Josh wrote:
> Does anybody have a good tutorial on how to do this with Apache
sitting in front of Tomcat?  I'd like to have a single server with
multiple one-to-one domainname-to-webapp apps running in Tomcat such
that I can hot deploy one webapp in Tomcat without affecting the other
webapps.
>
> Apache VirtualHost -- Tomcat webapp location
> foo.mydomain.com   -- webapps/foo
> bar.mydomain.com   -- webapps/bar
> eggs.mydomain.com  -- webapps/eggs
>   
I think it is possible to achieve this using various mod_rewrite / 
mod_proxy directives, e.i. 
http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypassreverse

On the other hand, it is very easy to add another Host elements to 
Tomcat's server.xml file:

default entry:

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

another vhosts:

<Host name="foo.mydomain.com" appBase="/some/path/foo"
        unpackWARs="true" autoDeploy="true"
        xmlValidation="false" xmlNamespaceAware="false"/>
<Host name="bar.mydomain.com" appBase="/some/path/bar"
        unpackWARs="true" autoDeploy="true"
        xmlValidation="false" xmlNamespaceAware="false"/>
<Host name="eggs.mydomain.com" appBase="/some/path/eggs"
        unpackWARs="true" autoDeploy="true"
        xmlValidation="false" xmlNamespaceAware="false"/>

and deploy your apps in ROOT contexts.

-- 
Mikolaj Rydzewski <[EMAIL PROTECTED]>



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to