LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Troubles with NFS Share being Accessible via Apache and the Web (https://www.linuxquestions.org/questions/linux-newbie-8/troubles-with-nfs-share-being-accessible-via-apache-and-the-web-649276/)

djsting 06-14-2008 11:38 AM

Troubles with NFS Share being Accessible via Apache and the Web
 
I have two Linux systems. On one I have a few NFS exports and on the other I'm mounting those NFS exports. All exports are configured the same way and mounted the same way. The issue I have is that on one of them (yes, ONLY ONE) the owner of the directory changes after it has been mounted. For example, I crated a directory called Z-Car_Stuff and it's owned by root (this is located in my Apache directory structure as the files will be served up to the web); after I mount the NFS share the owner of the Z-Car_Stuff directory changes to another user on that system. WHY!? How do I fix this so that it does not change?

Here are the lines from the fstab:

Code:

warehouse2:/mp3                /mp3s        nfs        rsize=8192,wsize=8192,timeo=14        0        0
warehouse2:/data/Z-Stuff                /www/pape/allan_and_rosanne/Z-Car_Stuff        nfs        rsize=8192,wsize=8192,timeo=14        0        0
warehouse2:/data/guardian/notesdata/NoLimitsREI/BirdDog /local/notesdata/NoLimitsREI/BirdDog nfs rsize=8192,wsize=8192,timeo=14 0 0

Here's the ll output before mounting:
Code:

[root@guardian allan_and_rosanne]# ll
total 20
drwxr-xr-x 2 root root 4096 Feb 11 18:03 mp3
drwxr-xr-x 3 root root 4096 Jan 26 16:59 OLD
drwxr-xr-x 2 root root 4096 Jan 26 16:59 ourhouse
drwxr-xr-x 3 root root 4096 Jan 26 16:59 wedding
drwxr-xr-x 2 root root 4096 May 18 20:20 Z-Car_Stuff
[root@guardian allan_and_rosanne]#

And after mounting:
Code:

[root@guardian allan_and_rosanne]# ll
total 24
drwxr-xr-x  2 root  root  4096 Feb 11 18:03 mp3
drwxr-xr-x  3 root  root  4096 Jan 26 16:59 OLD
drwxr-xr-x  2 root  root  4096 Jan 26 16:59 ourhouse
drwxr-xr-x  3 root  root  4096 Jan 26 16:59 wedding
drwxr-xr-x 149 apape apape 4096 Sep 11  2006 Z-Car_Stuff
[root@guardian allan_and_rosanne]#

Here's the exports file content:
Code:

[root@warehouse etc]# cat exports
/mp3 guardian2(ro) guardian(ro)
/data/Z-Stuff guardian2(ro) guardian(ro)
/data/Install guardian2(ro) guardian(ro)
/rosanne playground(ro)
/data playground(ro)
/mp3 playground(ro)
/data/guardian/notesdata/NoLimitsREI/BirdDog guardian2(rw)
 
[root@warehouse etc]#

Please help me resolve this...

erik258 06-17-2008 09:02 AM

The user ID of the owner on the server corresponds with a different username on the client. Change one or the other, but note this might effect other ownerships elsewhere.

djsting 06-17-2008 07:48 PM

Output of an ls -n command before mounting:
Code:

[root@guardian allan_and_rosanne]# ls -n
total 20
drwxr-xr-x 2 0 0 4096 Feb 11 18:03 mp3
drwxr-xr-x 3 0 0 4096 Jan 26 16:59 OLD
drwxr-xr-x 2 0 0 4096 Jan 26 16:59 ourhouse
drwxr-xr-x 3 0 0 4096 Jan 26 16:59 wedding
drwxr-xr-x 2 0 0 4096 May 18 20:20 Z-Car_Stuff
[root@guardian allan_and_rosanne]#

And after:
Code:

[root@guardian allan_and_rosanne]# ls -n
total 24
drwxr-xr-x  2  0  0 4096 Feb 11 18:03 mp3
drwxr-xr-x  3  0  0 4096 Jan 26 16:59 OLD
drwxr-xr-x  2  0  0 4096 Jan 26 16:59 ourhouse
drwxr-xr-x  3  0  0 4096 Jan 26 16:59 wedding
drwxr-xr-x 149 500 500 4096 Sep 11  2006 Z-Car_Stuff
[root@guardian allan_and_rosanne]#

As you may conclude from this and my original post, on the client root is UID 0 and GID 0 and apape is UID 500 and GID 500.

On the NFS server the UID and GID are the same for both users (root and apape), in fact all UID and GID values are in sync between the two systems.

Further, here is what groups apape is a member of:
Code:

[root@guardian allan_and_rosanne]# su apape
[apape@guardian allan_and_rosanne]$ id
uid=500(apape) gid=500(apape) groups=0(root),48(apache),500(apape),501(notes)
[apape@guardian allan_and_rosanne]$

And here's what groups apache is a member of:
Code:

[root@guardian allan_and_rosanne]# id apache
uid=48(apache) gid=48(apache) groups=48(apache),500(apape),501(notes)
[root@guardian allan_and_rosanne]#

Additionally, on the NFS server the above group memberships are the same.

On the NFS server the info on the two exports are as follows:
Code:

drwxr-xr-x 467 apape  apape  20480 Jun 12 20:47 mp3
Code:

drwxr-xr-x 467 500 500 20480 Jun 12 20:47 mp3
and:
Code:

drwxr-xr-x 149 apape apape    4096 Sep 11  2006 Z-Stuff
Code:

drwxr-xr-x 149 500 500    4096 Sep 11  2006 Z-Stuff
So as you can see the two exports are the same as one another yet when mounted on the client they are behaving differently. ???

Is there something else that I'm missing here?

djsting 06-29-2008 04:00 PM

I finally figured this out!!! I was an Apache config issue all along...I had to add the following lines to the appropriate VirtualHost on my system and all is good!

Code:

<Directory /www/pape/allan_and_rosanne/Z-Car_Stuff>
    Options Indexes FollowSymLinks
</Directory>



All times are GMT -5. The time now is 04:32 AM.