[solved]could not bind to address 0.0.0.0:80 no listening sockets available

Are you interested for monthly server support with Unlimited tickets, 24×7 monitoring, Security Audit and lot more ? please check our Monthly server support plans

[solved]could not bind to address 0.0.0.0:80 no listening sockets available:

This error can be occurred on the restart of httpd service.

It’s because of the port 80 is not able to listen for process. The full error will be like,

[email protected] [~]# /etc/init.d/httpd restart
Warning: DocumentRoot [/home/sree/public_html/britney] does not exist
(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
In this case you need to kill all the process running as nobody, for that you can use the following script,
for i in `ps auwx | grep -i nobody | awk {'print $2'}`; do kill -9 $i;

Just run this script from the command line of the server, and the process running as nobody will be killed.

Now you need to kill all the process that listening to the port 80.

For that use the following script,

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

Now try to restart apache. If it is still not listening on port 80, then you need to remove all the semaphore. You can do this by running the following script,

for i in `ipcs -s | grep nobody | awk '{print $2}'`; do ipcrm -s $i; done

It will. be fixed now.

Need our help to fix the issue ? Submit Support Ticket Now

View Server Administration Packages

Leave a Reply

Your email address will not be published. Required fields are marked *