tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kurt Overberg <k...@hotdogrecords.com>
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="" 
reloadable="true">
         <Parameter name="serv1" value="custom1" override="true"/>
</Context>

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

so if you put a directory in Catalina like:

Catalina/www.myhost.com/ROOT.xml

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

<?xml version='1.0' encoding='utf-8'?>
<Context docBase="/Users/kurt/sandboxes/myapp/webapp" path="" 
reloadable="true"/>

...it 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">
    <Alias>www.blah.com</Alias>
</Host>

...requests to www.blah.com 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!

/kurt


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: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 

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


Mime
View raw message