Pages

Wednesday, May 1, 2013

Apache web service wont start after restart, apache2 error "Address already in use"

If you stopped or restarted the apache2 server service and it failed to start this article should help.

You might type the command: rcapache2 start

You might get an error like this:

Starting httpd2 (prefork) (98)Address already in use: make_sock: could not bind to address [::]:80
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
startproc:  exit status of parent of /usr/sbin/httpd2-prefork: 1               ...        failed


Try this:

Run each of these commands

for i in `ps auwx | grep -i nobody | awk {'print $2'}`; do kill -9 $i; done
for i in `lsof -i :80 | grep http | awk {' print $2'}`; do kill -9 $i; done
for i in `lsof -i :80 | grep http | awk {' print $2'}`; do kill -9 $i; done

then run
service httpd restart
or run
 rcapache2 start



Until next time
thanks

P.S. like anything else on this blog, the instructions are 'as is' and use art your own risk.

No comments:

Post a Comment