apache2: Could not open configuration file /etc/apache2/apache2.conf: Permission denied

Posted by AntonChanning on Ask Ubuntu See other posts from Ask Ubuntu or by AntonChanning
Published on 2014-08-21T08:28:09Z Indexed on 2014/08/21 10:30 UTC
Read the original article Hit count: 1559

Filed under:
|
|

I recently upgraded Ubuntu to the latest LTS edition on my work laptop, which I use as a LAMP development platform. The upgrade was from 12.4 to 14.4. Now I'm having trouble getting apache up and running again. Here is the output from an attempt:

antonc@antonc-laptop:/etc/apache2$ sudo service apache2 restart
 * Restarting web server apache2                                                       
 * The apache2 configtest failed.
Output of config test was:
apache2: Could not open configuration file /etc/apache2/apache2.conf: Permission denied
Action 'configtest' failed.
The Apache error log may have more information.

Here is a list of permissions and ownership in /etc/apache, showing that apache2.conf is currently owned by root with permissions 644. I changed this temporarily to 777, but this made no difference, so I changed it back to 644.

antonc@antonc-laptop:/etc/apache2$ ls -l
total 80
-rw-r--r-- 1 root root  7115 Jan  7  2014 apache2.conf
...

What do I need to do to get apache running again? Is the problem really with apache2.conf or some other setting? Should the conf file be owned by a user other than root?

© Ask Ubuntu or respective owner

Related posts about 14.04

Related posts about permissions