Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / July 2007

Tip: Looking for answers? Try searching our database.

Tomcat Multiple Virtual Hosts

Thread view: 
Srikanth - 15 Jul 2007 22:18 GMT
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.
Arne Vajhøj - 21 Jul 2007 21:32 GMT
> 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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.