Tomcat Multiple Virtual Hosts

S

Srikanth

Hi,

I am using tomcat 5.5.20 version. I am trying to deploy multiple sites
using tomcat (without apache). Ideally I would like to define Hosts in
server.xml and define context.xml outside server.xml.

<tomcat>/webapps/host1 is the webapps directory for host1
<tomcat>/webapps/host2 is the webapps directory for host2

server.xml has following hosts
www.host1.mycompany.com
www.host2.mycompany.com

<Host
name="www.host1.mycompany.com"
appBase="webapps/host1"
unpackWARs="true"
autoDeploy="true"
xmlValidation="false"
xmlNamespaceAware="false">
<Valve className='org.apache.catalina.valves.AccessLogValve'
directory='logs/host1'
prefix='host1_access_log'
suffix='.log'
pattern='common' />
</Host>

<Host
name="www.host2.mycompany.com"
appBase="webapps/host2"
unpackWARs="true"
autoDeploy="true"
xmlValidation="false"
xmlNamespaceAware="false">
<Valve className='org.apache.catalina.valves.AccessLogValve'
directory='logs/host2'
prefix='host2_access_log'
suffix='.log'
pattern='common' />
</Host>

And in each context.xml is defined as follows at webapps/host1/META-
INF/context.xml:
<?xml version="1.0" encoding="UTF-8"?>
<Context debug="5" path="" reloadable="true" />

This configuration does not work. Please let me know if I am doing
anything wrong.

Please advise.
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

Srikanth said:
I am using tomcat 5.5.20 version. I am trying to deploy multiple sites
using tomcat (without apache). Ideally I would like to define Hosts in
server.xml and define context.xml outside server.xml. ....
This configuration does not work. Please let me know if I am doing
anything wrong.

Please advise.

I advise you to explain what "does not work" means.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,470
Messages
2,571,809
Members
48,797
Latest member
PeterSimpson
Top