[Yanel-usage] Virtual Host configuration with Tomcat

Michael Wechner michael.wechner at wyona.com
Thu Sep 25 14:49:59 CEST 2008


Hi

So far I have always used Apache httpd and mod_proxy to do virtual hosts 
configuration, but I just learned that one
can also do this with Tomcat rather easily in three steps

1) Change TOMCAT/conf/server.xml file, for example:

      <Host name="localhost" appBase="webapps"
       unpackWARs="true" autoDeploy="true"
       xmlValidation="false" xmlNamespaceAware="false">
      </Host>

      <Host name="www.yulup.org" appBase="webapps_yulup"
       unpackWARs="true" autoDeploy="true"
       xmlValidation="false" xmlNamespaceAware="false">
        <Alias>www.yulup.com</Alias>
      </Host>

2) Add an actual appBase, for example:

    TOMCAT/webapps_yulup

3) Add a webapp config dir, for example:

   TOMCAT/conf/Catalina/www.yulup.org/ROOT.xml

and this also works in combination with mod_jk, because mod_jk seems to 
propagte the requested domain name,
and hence one can still use Apache httpd in front of Tomcat ;-)

Cheers

Michael

     


More information about the Yanel-usage mailing list