Quick note for future reference..
If you ever run into errors like this
[code]
<pre>Starting httpd: Warning: DocumentRoot [/var/www/html/static] does not exist
Warning: DocumentRoot [/var/www/html/static] does not exist
Warning: DocumentRoot [/var/www/html/static] does not exist
Warning: DocumentRoot [/var/www/html/static] does not exist
(13)Permission denied: httpd: could not open error log file /etc/httpd/logs/error_log.
Unable to open logs
[FAILED]
[/code]
And you are scratching your head why Apache is throwing these errors, even when the said directory and files exist. And you have the right permissions!! Check if you have SELinux running and being enforced.
On RHEL, you can check if SELinux is running by
[code]cat /selinux/enforce [/code]
The two values are 0 and 1. 0 means, SELinux is not being enforced and 1 means it is.
You can quickly disable SELinux temporarily by
[code]echo 0 >/selinux/enforce [/code]
If you want to disable it permanently (i.e. survive reboots), you have to edit the file /etc/selinux/config and change the SELINUX line from enabled to disabled.
It’s very-very-very bad idea. It’s much better to setenforce=0 and use audit2why to get an idea on what’s going wrong. I suggest you better study SELinux than just disabling it. Disabling doesn’t solve your problems, it just hides them 🙂
Good luck
Melco – I agree with you. Not a good security practice. But then you also have to balance security vs. ease of use (configuration).
solved in this way
Apache server root directory: /etc/httpd
Path to httpd executable: /usr/sbin/httpd
[root@dep-localweb ~]# httpd
[root@dep-localweb ~]# /etc/init.d/httpd reload
[root@dep-localweb ~]# less /etc/httpd/logs/error_log
[Thu Apr 11 23:39:01 2013] [notice] SELinux policy enabled; httpd running as context unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[Thu Apr 11 23:39:01 2013] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Apr 11 23:39:01 2013] [notice] Digest: generating secret for digest authentication …
[Thu Apr 11 23:39:01 2013] [notice] Digest: done
[Thu Apr 11 23:39:03 2013] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.3.3 mod_ssl/2.2.15 OpenSSL/1.0.0-fips mod_wsgi/3.2 Python/2.6.6 mod_perl/2.0.4 Perl/v5.10.1 configured — resuming normal operations
SElinux is on.
filippo – How did you resolve it? Did you change any configuration?