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.

We have several developers who maintain the system and I want them to easily read the log files in /var/log/httpd without needing root access. I set the read permission for 'other' users but when I run tail on the log files I get permission denied:

[root@ourserver httpd]# chmod -R go+r /var/log/httpd
[root@ourserver httpd]# ls -la
drwxr--r--  13 root root 4096 Oct 25 03:31 .
drwxr-xr-x.  6 root root 4096 Oct 20 03:24 ..
drwxr-xr-x   2 root root 4096 Oct 20 03:24 oursite.com
drwxr-xr-x   2 root root 4096 Oct 20 03:24 oursite2.com
-rw-r--r--   1 root root    0 May  7 03:46 access_log
-rw-r--r--   1 root root 3446 Oct 24 22:05 error_log

[me@ourserver ~]$ tail -f /var/log/httpd/oursite.com/error.log
tail: cannot open `/var/log/httpd/oursite/error.log' for reading: Permission denied

Maybe I'm missing something on how permissions work but I'm not finding any easy answers on it.

share|improve this question

closed as off-topic by Jenny D, Iain, MadHatter, mdpc, kce Oct 29 '13 at 18:39

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions must be relevant to professional system administration. Server Fault is a site dedicated to professionals; novice questions are off-topic. Please see the Help Center for more information on topicality. The best advice we can give you is to hire a professional to help you out." – Jenny D, Iain, kce
If this question can be reworded to fit the rules in the help center, please edit the question.

    
I researched several articles trying to find a solution to this based on the error (including Apache's documentation); that's the only reason I posted here. I don't know why this got down-voted. Do I have to post which websites I researched? Based on the answer it just looked like there was something about Linux I didn't quite understand but this particular attribute was not mentioned in the articles I read. –  user2344668 Oct 25 '13 at 22:20
    
[me@ourserver ~]$ tail -f /var/log/httpd/oursite.com/error.log <--- So what are the permissions on /var/log/httpd/oursite.com/error.log -- this would be EXTREMELY RELEVANT. (Also note Joshua's answer below) –  voretaq7 Oct 29 '13 at 16:09
    
@voretaq7 and others - It's ridiculous that a question like this gets down-voted and closed. - Let's get this straight: You're supposed to know the answer in order to ask the question properly? I see. As a C++ and PHP programmer who needs to provide non-root access to these logs to others, I suppose I ... should be ashamed of myself for not knowing how to make this possible? I'll go hang my head in a corner now. Actually, it says the question is not about professional system administration. I see - so as a PHP programmer managing my client's system, I'm a ... phony. Thanks! –  Dan Nissenbaum Feb 16 at 16:56
add comment

1 Answer

Directories (like /var/log/httpd) require both read and execute permissions in order to be traversed. So when you add "r" to the directory, it only allows the world to see the contents, but not to enter into it and continue into other directories.

Try chmod -R go+rX /var/log/httpd

share|improve this answer
add comment

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