Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.
root@SERVER:~# cat /etc/passwd | grep www-data
www-data:x:33:33:www-data:/var/www:/bin/sh

root@SERVER:~# ls -al /cluster/www/html/tmp/reportexport_274.xml
-rwxrwxrwx 1 www-data www-data 908 2011-03-30 14:03 /cluster/www/html/tmp/reportexport_274.xml

root@SERVER:~# sudo -u www-data cat /cluster/www/html/tmp/reportexport_274.xml
cat: /cluster/www/html/tmp/reportexport_274.xml: Permission denied

The directory is an nfs mount:

x:/cluster/www /cluster/www nfs _netdev,rw,soft,intr,rsize=32768,wsize=32768,nosuid,nodev,noatime,timeo=15 0 0

Linux x 2.6.32-31-server #61-Ubuntu SMP Fri Apr 8 19:44:42 UTC 2011 x86_64 GNU/Linux

How can this be? am I missing something?

share|improve this question
add comment

2 Answers 2

How about sudo -u www-data ls -l /cluster/www/html/tmp/? Perhaps www-data is missing permissions to reach the directory entry. If that's the case chown/chmod each directory up to tmp so they are readable/executable by www-data.

share|improve this answer
    
sudo -u www-data ls -l /cluster/www/html/tmp/*.xml ls: cannot access /cluster/www/html/tmp/export_274.xml: Permission denied –  user80973 May 10 '11 at 12:52
    
@user80973: do sudo -u www-data ls -ld /cluster/www/html/tmp, sudo -u www-data ls -ld /cluster/www/html, etc. until it doesn't result in an error or you get to /cluster. You have to change the permissions in the directories giving permission errors by using chmod a+rx /path/to/dir. At the very least you'll probably have to execute chmod a+rx /cluster/www/html/tmp. –  Eduardo Ivanec May 10 '11 at 12:55
1  
yeh it was missing the lack of +x . :) –  user80973 May 10 '11 at 12:58
add comment

Check that the directories in the path all in some manner allow user www-data read and execute permission.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.