Thursday, June 21, 2012

Permission denied Apache in Centos 6

When you have a "Permission denied" error but the permissions of the files are correct:

File: /var/log/httpd/error_log
Couldn't open ./hg.conf , Permission denied, referer: http://127.0.0.1/
# ll hg.conf
-rw-------. 1 apache root 13659 Jun 21 19:12 hg.conf

Try to see more information with ls -laZ
# ls -laZ hg.conf
-rw-------. apache root unconfined_u:object_r:admin_home_t:s0 hg.conf
And try to change with:
# chcon unconfined_u:object_r:httpd_sys_script_exec_t:s0 hg.conf

And...... IT WORKS!


No comments:

Post a Comment