My Apache server won't start. Possible log permissions error.

Posted April 7, 2014 19.7k views
Hi, I was on the Apache IRC channel trying to get help because both my vhosts resolve to the same place. One guy was helping me and he said to output the error logs for the vhosts, which I didn't have set up, so he told me to do that. I set them up in the vhosts config files, but I couldn't get the output, so I followed a few forums I found on the net to try to fix the problem. One thing I did was this: sudo chmod 644 /var/log/apache2/access.log /var/log/apache2/error.log Then suddenly my server wouldn't start. So, I changed the vhosts log files back, deleted the folders and changed the permissions back (640) that I had changed above. Anyway, I still can't start the server and I am not sure what the problem. My Apache error logs are here It says "Unable to open logs, exiting". I think this is the problem, but I changed the permissions back and it still isn't working. Can you give me any direction on how I might fix it? One note: Another one of the errors says "(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80" I looked this up and people say to do netstat -tap and kill what is on port 80, but there is nothing on port 80 that I can see. Thanks.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
4 answers
disable all but the default virtual host and try to start it.
if it works, enable one virtual host at a time until it doesn;t start.

in my experience, permission of the logs is irrelevant because it's opened as root, but the dir needs to exist, if you have a line like

ErrorLog /srv/www/

then /srv/www/ needs to exist or apache won't start
Thank you. That's what I did and it worked. Unfortunately, I am getting "Forbidden" 403 errors.

Any idea why that might be?

I should clarify that they don't say 403. They just say "Forbidden You don't have permission to access / on this server."

A graceful restart fixed it. Hmm..

sudo apachectl -k graceful