tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hassan Schroeder <has...@webtuitive.com>
Subject Re: Troubleshooting Virtual Hosts with Tomcat 5 standalone mode...
Date Tue, 05 Apr 2005 00:01:14 GMT
Jeff Duska wrote:
> I'm trying to setup a couple of virtual hosts using Tomcat in stand
> alone mode.

> I started with the goal of having a user directory for each virtual
> host. For example, for the sample domain1.com the appbase would be
> /home/domain/webapps.
> 
> I setup my server.xml file to have the following host settings
> 
>    <Host name="domain1.com" debug="0" appBase="/home/domain/webapps"
>        unpackWARs="true" autoDeploy="true"
>        xmlValidation="false" xmlNamespaceAware="false">
>         <Context path="" docBase="."/>
>     </host>

OK, don't do that :-)

Don't put the Context elements in server.xml. Put your Host elements
there, e.g.

    <Host name="oahu"  appBase="/www/oahu"></Host>
    <Host name="maui"  appBase="/www/maui"></Host>	   	
    <Host name="kauai" appBase="/www/kauai"></Host>	   	  		

Then (assuming you're using the default Engine name) make directories
    $CATALINA_HOME/conf/Catalina/oahu
    $CATALINA_HOME/conf/Catalina/maui
    $CATALINA_HOME/conf/Catalina/kauai

In each of those put your Context files, as in
    $CATALINA_HOME/conf/Catalina/oahu/ROOT.xml
    $CATALINA_HOME/conf/Catalina/oahu/manager.xml
    <!-- the above if you want the manager app available -->
    $CATALINA_HOME/conf/Catalina/oahu/cowabunga.xml
    <!-- etc... -->

which will look (minimally!) like

    <Context docBase="/www/oahu/ROOT">
	<!-- define Resources, etc. -->	
    </Context>	

That's it. Restart tomcat. Done. See, wasn't that easy? :-)

HTH!
-- 
Hassan Schroeder ----------------------------- hassan@webtuitive.com
Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com

                           dream.  code.



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


Mime
View raw message