Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache (httpd) Wont start because "could not open error log"

ok guys, im stumped. I install centos 7.2 on a vm, installed httpd, enabled it as a service, then started it then created and edited a config file as follows

<VirtualHost *:80>
ServerAdmin [email protected]
ServerName www.mydomain.com
ServerAlias mydomain.com
DocumentRoot /var/www/mydomain.com/public_html
#ErrorLog /var/www/mydomain.com/error.log
#CustomLog /var/www/mydomain.com/requests.log combined
</VirtualHost>

So.. When I uncomment the "ErrorLog", which I believe is correct, and there is a file called error.log in directory "/var/www/mydomain.com/" Httpd.service doesn't want to start, with the error:

(13)Permission denied: AH00091: httpd: could not open error log file /var/www/mydomain.com/error.log.
AH00015: Unable to open logs

I tried doing chown on the error.log file, to apache:apache, and root:root, and the user for the site, but that didn't work. I also made sure to 755 the directory for www, so the error.log file should be able to be opened by that. Help me out please

like image 976
UnknownSender Avatar asked Jan 31 '26 12:01

UnknownSender


1 Answers

Turns out that the error and access logs needed to be placed in /var/log/httpd/ instead of where they were.

like image 100
UnknownSender Avatar answered Feb 03 '26 11:02

UnknownSender