You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Anthony PAUL <an...@unicaen.fr> on 2009/03/17 17:48:42 UTC

Userdirs on an NFS share

Hi list,

I'm having a 404 error whenever I try to browse a JSP owned by a user 
(eg: http://server:8080/~paul/test.jsp)

type Status report
message /~paul/test.jsp
description The requested resource (/~paul/test.jsp) is not available.

I guess the trouble comes from my NFS share, since users home 
directories are stored on another server.

If I change the homedirectory to a local directory, it works fine.

If I use a context to the NFS share, it works too.
eg, in my server.xml:
<Context path="/~paul" docBase="/NFS/homes/paul/public_html/" 
crossContext="true" debug="1" reloadable="true" />

But this doesn't work:
<Listener className="org.apache.catalina.startup.UserConfig"
     directoryName="public_html"
     homeBase="/NFS/homes/"
     userClass="org.apache.catalina.startup.HomesUserDatabase"/>


I'm using Apache 2.2.9 (from debian lenny),
Tomcat 6.0.18
mod_jk 1.2.27
Users are refered in an LDAP directory (but of course, they are 
recognized by the box and Apache mod_userdir since http://server/~paul 
will display the right index.html)

Is it a bug?
Thanks for your help or any information.

Anthony



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


Re: Userdirs on an NFS share

Posted by Anthony PAUL <an...@unicaen.fr>.
Anthony J. Biacco a écrit :
> Remember that over nfs, the client's access to the server will be as
> user nobody or nfsnobody, depending on your system, so that user will
> have to have access to all those directories/files, unless of course you
> use the anonuid/anongid directives in your exports file.
> 
> -Tony


Yes, but the whole directories in my NFS share are rwxr-xr-x, so I think 
it should be ok...

/NFS (755)
/NFS/homes (755)
/NFS/homes/user (711) (but for the test, I changed it to 755)
/NFS/homes/user/public_html (755)
/NFS/homes/user/public_html/test.jsp (755)

Anthony

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


RE: Userdirs on an NFS share

Posted by "Anthony J. Biacco" <ab...@formatdynamics.com>.
Remember that over nfs, the client's access to the server will be as
user nobody or nfsnobody, depending on your system, so that user will
have to have access to all those directories/files, unless of course you
use the anonuid/anongid directives in your exports file.

-Tony
---------------------------
Manager, IT Operations
Format Dynamics, Inc.
303-573-1800x27
abiacco@formatdynamics.com
http://www.formatdynamics.com


-----Original Message-----
From: Anthony PAUL [mailto:anthony.paul@unicaen.fr] 
Sent: Tuesday, March 17, 2009 10:49 AM
To: users@tomcat.apache.org
Subject: Userdirs on an NFS share

Hi list,

I'm having a 404 error whenever I try to browse a JSP owned by a user 
(eg: http://server:8080/~paul/test.jsp)

type Status report
message /~paul/test.jsp
description The requested resource (/~paul/test.jsp) is not available.

I guess the trouble comes from my NFS share, since users home 
directories are stored on another server.

If I change the homedirectory to a local directory, it works fine.

If I use a context to the NFS share, it works too.
eg, in my server.xml:
<Context path="/~paul" docBase="/NFS/homes/paul/public_html/" 
crossContext="true" debug="1" reloadable="true" />

But this doesn't work:
<Listener className="org.apache.catalina.startup.UserConfig"
     directoryName="public_html"
     homeBase="/NFS/homes/"
     userClass="org.apache.catalina.startup.HomesUserDatabase"/>


I'm using Apache 2.2.9 (from debian lenny),
Tomcat 6.0.18
mod_jk 1.2.27
Users are refered in an LDAP directory (but of course, they are 
recognized by the box and Apache mod_userdir since http://server/~paul 
will display the right index.html)

Is it a bug?
Thanks for your help or any information.

Anthony



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


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


Re: Userdirs on an NFS share

Posted by Anthony PAUL <an...@unicaen.fr>.
Caldarale, Charles R a écrit :

>> type Status report
>> message /~paul/test.jsp
>> description The requested resource (/~paul/test.jsp) 
>> is not available.
> 
> Does the userid Tomcat is running under have access to the file in question?  If not, you'll always get the 404.

Hello and thank you for your reply.
By now, I'm running it with the root user (I'm testing), but the NFS 
share is mounted with the no_root_squash option.
However, from / till the public_html, all the directories have rx access 
for everybody (and the .jsp as well), so I guess the files should be 
readable. (Actually, if I remove the :8080 in the URL, the source code 
is displayed, even Apache is running under www user)


>> If I change the homedirectory to a local directory, 
>> it works fine.
> 
> What do you mean by "the homedirectory"?  Tomcat's?  The user's?  Your own?

I meant users home directories.
Actually, for this test, I unmounted the NFS share, then copied my own 
home directory on the local filesystem (with the same rights).

Usually, I mount the NFS share on /NFS, but for this test I did:
umount /NFS
mkdir -p /NFS/homes/paul/public_html
vi /NFS/homes/paul/public_html/test.jsp
chmod -R 755 /NFS

Then on http://server:8080/~paul/test.jsp the jsp is executed.


>> But this doesn't work:
>> <Listener className="org.apache.catalina.startup.UserConfig"
>>      directoryName="public_html"
>>      homeBase="/NFS/homes/"
>>      userClass="org.apache.catalina.startup.HomesUserDatabase"/>
> 
> Where is the above <Listener> located?  What does "doesn't work" mean?  Be specific.

What I meant by "doesn't work" is the symptom I described above: the 
Tomcat 404 error:
type Status report
message /~paul/test.jsp
description The requested resource (/~paul/test.jsp) is not available.

The Listener is in the server.xml, inside the <Host>. Below, the whole file:

== server.xml ==

<?xml version='1.0' encoding='utf-8'?>
<Server port="8005" shutdown="SHUTDOWN">

<Listener className="org.apache.catalina.core.AprLifecycleListener" 
SSLEngine="on" />
<Listener className="org.apache.catalina.core.JasperListener" />
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
<Listener 
className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />

   <GlobalNamingResources>
     <Resource name="UserDatabase" auth="Container"
         type="org.apache.catalina.UserDatabase"
         description="User database that can be updated and saved"
         factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
         pathname="conf/tomcat-users.xml" />
   </GlobalNamingResources>

  <Service name="Catalina">

  <Connector port="8080" protocol="HTTP/1.1"
             connectionTimeout="20000"
             redirectPort="8443" />

   <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

   <Engine name="Catalina" defaultHost="localhost">

       <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
              resourceName="UserDatabase"/>

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

     <!-- MY OWN CONFIGURATION -->
         <DefaultContext reloadable="true">
         </DefaultContext>

         <Listener className="org.apache.catalina.startup.UserConfig"
              directoryName="public_html"
          homeBase="/NFS/homes/"
          userClass="org.apache.catalina.startup.HomesUserDatabase"/>
     <!-- / MY OWN CONFIGURATION -->

       </Host>
     </Engine>
   </Service>
</Server>

== /server.xml ==



Sorry for my lack of details and thanks for your help.

Anthony


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


RE: Userdirs on an NFS share

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Anthony PAUL [mailto:anthony.paul@unicaen.fr] 
> Subject: Userdirs on an NFS share
> 
> type Status report
> message /~paul/test.jsp
> description The requested resource (/~paul/test.jsp) 
> is not available.

Does the userid Tomcat is running under have access to the file in question?  If not, you'll always get the 404.

> If I change the homedirectory to a local directory, 
> it works fine.

What do you mean by "the homedirectory"?  Tomcat's?  The user's?  Your own?

> But this doesn't work:
> <Listener className="org.apache.catalina.startup.UserConfig"
>      directoryName="public_html"
>      homeBase="/NFS/homes/"
>      userClass="org.apache.catalina.startup.HomesUserDatabase"/>

Where is the above <Listener> located?  What does "doesn't work" mean?  Be specific.

 - 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