You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jeroen Kransen <je...@kransen.nl> on 2009/03/16 15:28:39 UTC

Tomcat 6 multiple hosts howto

Hello all,

I am sure this is a FAQ, but I can't find any info about it. I used
Tomcat 5.5 with multiple <Host/> elements in the server.xml
Now I read that this has to be done differently in Tomcat 6, but I am
not sure how. I added a conf/Catalina/examplecom/context.xml, but I
don't know what to put there, and how to link it to the host
example.com..
Also, is there a way to specify individual classpaths that have a Host
as scope? That way I can deploy the same webapp for different hosts
using different settings in the .properies files.

Thanks in advance! Jeroen

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


RE: Tomcat 6 multiple hosts howto

Posted by Ilya Kazakevich <ka...@devexperts.com>.
>>I used Tomcat 5.5 with multiple <Host/> elements in the server.xml Now I
read that this has to be done differently in Tomcat 

No, it is not.
You should have one <Host> element for every virtual host you need.

http://tomcat.apache.org/tomcat-6.0-doc/config/host.html

-----Original Message-----
From: Jeroen Kransen [mailto:jeroen@kransen.nl] 
Sent: Monday, March 16, 2009 5:29 PM
To: users@tomcat.apache.org
Subject: Tomcat 6 multiple hosts howto

Hello all,

I am sure this is a FAQ, but I can't find any info about it. I used Tomcat
5.5 with multiple <Host/> elements in the server.xml Now I read that this
has to be done differently in Tomcat 6, but I am not sure how. I added a
conf/Catalina/examplecom/context.xml, but I don't know what to put there,
and how to link it to the host example.com..
Also, is there a way to specify individual classpaths that have a Host as
scope? That way I can deploy the same webapp for different hosts using
different settings in the .properies files.

Thanks in advance! Jeroen

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


RE: Tomcat 6 multiple hosts howto

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Jeroen Kransen [mailto:jeroen@kransen.nl] 
> Subject: Tomcat 6 multiple hosts howto
> 
> I used Tomcat 5.5 with multiple <Host/> elements in the 
> server.xml Now I read that this has to be done differently
> in Tomcat 6, but I am not sure how.

Tomcat 6 is a bit stricter; you may not have been doing things completely properly in 5.5.  The doc is here:
http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html

> I added a conf/Catalina/examplecom/context.xml

You must have misinterpreted what you read; the above would only be appropriate for a web site with the name "examplecom" (not "example.com") with a webapp named "context".  Unlikely to be what you want.

> Also, is there a way to specify individual classpaths that 
> have a Host as scope?

No.

> That way I can deploy the same webapp for different hosts
> using different settings in the .properies files.

Bad idea.  Just deploy the .war (or directory) as many times as you need.  It costs some disk space, but that's exceedingly cheap.  Separate properties can be specified in each webapp's <Context> element, placed in the conf/Catalina/[host]/[appName].xml files.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.

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