tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kurt Overberg <>
Subject Re: multihoming examplified
Date Mon, 23 Jan 2006 13:41:01 GMT
I've generally found that I only need one Host element in the server.xml 
file.  The Magic is in the Catalina/<hostname>/ROOT.xml file.  Here's 
whats in my tomcat/conf/Catalina/localhost/ directory:

<?xml version='1.0' encoding='utf-8'?>
<Context docBase="/Users/kurt/sandboxes/myapp/webapp" path="" 
         <Parameter name="serv1" value="custom1" override="true"/>

(you don't need that <Parameter> line- thats a custom parameter for my 

so if you put a directory in Catalina like:


...and made that ROOT.xml look like:

<?xml version='1.0' encoding='utf-8'?>
<Context docBase="/Users/kurt/sandboxes/myapp/webapp" path="" 
reloadable="true"/> would most likely work.  I've also put <Alias> directives into the 
Host section of my server.xml like this:

<Host name="localhost" appbase="/Users/kurt/sandboxes/myapp/webapp">

...requests to will also get sent to that localhost 
context.  I'm not sure if this is the 'proper' way to do it, but it 
seems to work just fine.  I'm also using 5.0.27.  Hope this helped!


Morten Andersen wrote:
> How do I set up tomcat to run several webapps each serving requests for
> their respective domains?
> I've figured that I can create a <Host> element in the server.xml, but
> the Tomcat documentation doesn't really help me much more. It mentions
> the option to add files in the conf/[Engine]/[Appname] folder, but what
> should the file name be and how should it be structured?
> Please provide a few explained examples.
> Morten
> Tomcat version: 5.0.28
> PS: More examples in documentation please. It's easier to write and
> understand.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message