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.

I am setting up a NetDisco machine on CentOS, which entails adding an include to the apache httpd.conf file.

When I start apache by running "httpd" from a root command prompt, the process launches.

When I try start apache by running "service httpd start", I get the following output:

Starting httpd: httpd: Syntax error on line 1010 of /etc/httpd/conf/httpd.conf: 
Could not open configuration file /usr/local/netdisco/netdisco_apache.conf: 
Permission denied
                                                                  [FAILED]

That file has these permissions:

-rw-r--r--. 1 root root  1798 Apr 22 18:46 netdisco_apache.conf

And httpd.conf has these permissions:

-rw-r--r--. 1 root root 34520 Apr 22 17:06 httpd.conf

What gives, surely a file with the EXACT same permissions should be accessible to the apache service?

share|improve this question
    
Could it be that, when you started up Apache as root, it wrote some temporary files or similar that are now owned by root--and the Permission Denied you're seeing is trickling up from one of them when it tries to run as the www-data (or httpd) user? Apache config errors can be cryptic like that. –  Andrew M. Apr 23 '12 at 16:42
    
Thanks Andrew, I'll investigate that –  Joon Apr 23 '12 at 16:59
add comment

1 Answer

up vote 2 down vote accepted

Try checking the permissions on the folder that contains netdisco_apache.conf

You are right Apache should be able to access the file as it has the same permissions, but it might not be able to access the folder it is contained in.

If you don't want to change folder permissions, just move netdisco_apache.conf to the /etc/httpd/conf directory (remember to update the reference to it in the /etc/httpd/conf/httpd.conf file if you do that.)

share|improve this answer
    
Thanks, I'll try that and report back –  Joon Apr 23 '12 at 16:59
    
Thanks, that did the job. –  Joon Apr 23 '12 at 17:42
add comment

Your Answer

 
discard

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.