tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arnaud icard <arnaud.ic...@univ-avignon.fr>
Subject Re: Error 404 when redirected
Date Thu, 07 Oct 2010 13:09:48 GMT


Caldarale, Charles R a écrit le 07/10/2010 13:50:
>> I am currently installing and configuring a
>> webserver with the couple httpd/tomcat.
>>      
> Exact versions?
>    

httpd : Apache/2.2.9 (Debian)
tomcat : Apache Tomcat/6.0.29

>> My current Tomcat configuration is something like that :
>> <Host name="appli1.domain.fr"  appBase="/var/www/appli1"
>> unpackWARs="true" autoDeploy="true" xmlValidation="false"
>> xmlNamespaceAware="false">
>>      <Context path="" docBase="/var/www/appli1" crossContext="false">
>>      
> The above is seriously broken.  First, it is absolutely illegal to have the appBase the
same as docBase.
Indead. This page helped me to understand why : 
http://www.lisnichenko.com/articles/tomcat-appbase-and-docbase.html
> Second, you should not be placing<Context>  elements in server.xml.
This is not completly true : 
http://tomcat.apache.org/tomcat-6.0-doc/config/context.html
I quote the webpage :

    *Context* elements may be explicitly defined:

        * ...
        * Inside a Host element in the main conf/server.xml.

This is what I did there. But I guess this is the complete opposite to 
what is written just above on the same webpage.
> Third, each<Host>  should have a unique appBase directory.
This is already the case, isn't it?
> Fourth, the default webapp for a given appBase must be named ROOT (case sensitive)
>    
I had to made an exception for an application (uPortal) which is 
deployed in an uPortal/ folder
But I corrected this for the others.
> Remove the<Context>  elements from server.xml, and restructure your file layout
to look like this:
>    
Most of these applications are deployed using /ant deploy/.
Thus I cannot place context file in the application/ROOT/META-INF (well 
I could but it would mean that I had to copy the context file each time 
I launch /ant deploy/)


So I now have the following server.xml :

    <Host name="appli1.domain.fr"  appBase="/var/www/appli1"
    unpackWARs="true" autoDeploy="true" xmlValidation="false"
    xmlNamespaceAware="false">
    <Context path="" docBase="ROOT" crossContext="false">
         ...
    <Host name="appli2.domain.fr"  appBase="/var/www/appli2"
    unpackWARs="true" autoDeploy="true" xmlValidation="false"
    xmlNamespaceAware="false">
    <Context path="" docBase="ROOT" crossContext="false">
    ...
    <Host name="uportal.domain.fr"  appBase="/var/www/uportal"
    unpackWARs="true" autoDeploy="true" xmlValidation="false"
    xmlNamespaceAware="false">
    <Context path="" docBase="uportal" crossContext="false">
         ...
    <Context path="/ResourceServingWebapp"
    docBase="ResourceServingWebapp" crossContext="false">
    ...

The file layout for uportal is (yes 2 times uportal):
/var/www/uportal/
     uportal/
     ResourceServingWebapp/


Everything works fine... but I don't get why I had to specify ROOT in 
the docBase argument. Is it not the value by default ?

Regards,
arnaud

> /
> var/
>    www/
>      appli1/
>        ROOT/
>          META-INF/
>            context.xml
>          WEB-INF/
>            classes/
>            lib/
>          <other appli1 directories and files>
>      appli2/
>        ROOT/
>          META-INF/
>            context.xml
>          WEB-INF/
>            classes/
>            lib/
>          <other appli2 directories and files>
>
> The context.xml file in each ROOT's META-INF directory can actually be omitted for the
two webapps you showed, since it would contain no useful information (the path and docBase
attributes must not be used here).  Only if you had some non-default attribute to specify
would you create a<Context>  element inside it.
>
>   - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and
is thus for use only by the intended recipient. If you received this in error, please contact
the sender and delete the e-mail and its attachments from all computers.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>    

Mime
View raw message