Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've got clear centOS 5.x system, I've created an user and when I want do go into /var/log/httpd i get access denied. after typing ls -la i get the owner of httpd catalog is root. Can I change owner to my user? Or how can I access this folder to watch apache logs?

share|improve this question
up vote 1 down vote accepted

The permissions are correct on the folder. You can change the ownership of the folder to root:apache and also add yourself to the apache group.

sudo chown -R root:apache /var/log/httpd 

then open the /etc/group file and add the following to the group 'apache'

sudo vi /etc/group

apache:x:48:"your username"

sudo chmod -R 755 /var/log/httpd 

Hope that solves the issue.

cheers :)

share|improve this answer
I did everything but still access denied – Krystian Nov 28 '12 at 12:48
@Krystian forgot to add one more thing.I have added that edit to the answer that i posted,in case you forgot that. Can u give me the o/p of ls -ld /var/log/httpd ? – rahul Nov 28 '12 at 12:51
It much safer to just use su or sudo to access the relevant files. – terdon Nov 28 '12 at 12:53
i dont know root password so I cant use su and sudo doestn work with cd command because it is shell command not bin – Krystian Nov 28 '12 at 13:04
@rahul yeah chmod did the trick thanks! – Krystian Nov 28 '12 at 13:12

Your Answer


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.