access apache log files in centos
36,190
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 :)
Related videos on Youtube
Author by
Krystian
Updated on September 18, 2022Comments
-
Krystian almost 2 years
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 typingls -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? -
Krystian over 11 yearsI did everything but still access denied
-
rahul over 11 years@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 ?
-
terdon over 11 yearsIt much safer to just use
su
orsudo
to access the relevant files. -
Krystian over 11 yearsi dont know root password so I cant use
su
andsudo
doestn work withcd
command because it is shell command not bin -
rahul over 11 years@Krystian great! cheers
-
user1696603 over 7 yearsbetter to do
sudo chmod 755 /var/log/httpd
andsudo chmod 644 /var/log/httpd/*
-- the first is for directory access and the second for files. usingchmod -R 755
makes all the files executable, which isn't a good idea. (more adaptable version of these commands here: unix.stackexchange.com/a/38451/3297)