You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Penghui Wang <wa...@gmail.com> on 2007/12/15 14:17:04 UTC

appBase and docBase in VirtualHosting Configuration of TC5.5

Dear, List,

I have several websites and each site is a web application.

If i wanna hosting all the sites in a single tomcat instance, i have to add
several "<Host>" elements in server.xml.
In the default <Host> which coming with the tomcat packages, the appBase is
"webapps" which located in CATALINA_BASE. Each directory in it is a web
applications. And there is also a ROOT directory which hosted all the
related documents.

The <Context> element of the ROOT directory is:

<Context path="/" docBase="ROOT"
   debug="0" privileged="true" allowLinking="true">
</Context>

So the directory tree should be
webapps-ROOT
            -webapp1
            -webapp2
            - ...
But now, all of my sites are only single web application. So i configure the
Virtualhost in server.xml like

<Host className="org.apache.catalina.core.StandardHost"
appBase="/home/www/site1" autoDeploy="false" configClass="org.a
pache.catalina.startup.ContextConfig" contextClass="
org.apache.catalina.core.StandardContext" debug="0" deployXML="true"
errorReport
ValveClass="org.apache.catalina.valves.ErrorReportValve" liveDeploy="true"
mapperClass="org.apache.catalina.core.StandardHostMapper"
 name="site1.example.com" unpackWARs="true">
<Context path="" docBase="/home/www/site1" reloadable="true" debug="0"/>
</Host>

<Host className="org.apache.catalina.core.StandardHost"
appBase="/home/www/site2" autoDeploy="false" configClass="org.a
pache.catalina.startup.ContextConfig" contextClass="
org.apache.catalina.core.StandardContext" debug="0" deployXML="true"
errorReport
ValveClass="org.apache.catalina.valves.ErrorReportValve" liveDeploy="true"
mapperClass="org.apache.catalina.core.StandardHostMapper"
 name="site2.example.com" unpackWARs="true">
<Context path="" docBase="/home/www/site2" reloadable="true" debug="0"/>
</Host>
The appBase and docBase in the same virtualhost have the same path value.

It seems workable. But i am not sure the configuration right or not.

Could someone could pick me up?

Thanks in advacne.

Penghui Wang



-- 
Wang Penghui
http://www.extmail.org
http://www.postfix.org.cn

Re: appBase and docBase in VirtualHosting Configuration of TC5.5

Posted by Mark Thomas <ma...@apache.org>.
Penghui Wang wrote:
> It seems workable. But i am not sure the configuration right or not.
> 
> Could someone could pick me up?

http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html

Mark


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