tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Terence M. Bandoian" <tere...@tmbsw.com>
Subject Re: Host appBase vs Context docBase
Date Sat, 05 Jul 2014 16:48:36 GMT
On 7/4/2014 9:04 PM, Igal @ getRailo.org wrote:
> I'm a little confused about the Host appBase attribute.
>
> Let's say that my website resides in D:\www\site1
>
> I don't like using {Tomcat}/webapps so I don't want to have it as a 
> base directory for websites.  What I've been doing so far is create an 
> empty folder alongside "webapps", named "empty", and use it as 
> appBase, e.g.
>
> <Host name="Site1" appBase="empty" unpackWARs="false" autoDeploy="false">
>   <!-- this works but what's the deal with appBase? !-->
>   <Context path="/" docBase="D:/www/site1" />
> </Host>
>
> But it feels like I'm doing something wrong.  I expect this to work, 
> but it doesn't:
>
> <Host name="Site1" appBase="D:/www/site1" unpackWARs="false" 
> autoDeploy="false">
>   <!-- this doesn't work !-->
> </Host>
>
> Can anyone explain why the snippet above doesn't work, and if that is 
> the way it should be, then what is the purpose of Host/appBase?
>
> TIA
>

Hi, Igal-

What version of Tomcat are you using?  Also, it is recommended that 
<Context> elements not be placed directly in server.xml.  See:

http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Defining_a_context

That said, you shouldn't need the empty directory.  I've used an 
absolute path for the <Host> appBase attribute with relative paths for 
<Context> docBase attributes in Tomcat 6 and 7 without any problems.  I 
haven't tried it with absolute paths for both appBase and docBase.

Lastly, are you sure you want "/" for the <Context> path attribute in 
the first example above?  The <Context> path for the default web 
application of a <Host> should be an empty string ("").  See:

http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Common_Attributes

-Terence Bandoian

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


Mime
View raw message