Error restarting Apache: Address already in use Print

  • 1

Problem Description

When restarting or starting Apache, you receive the following error:

Starting httpd: (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

This means Apache cannot start because something else is using port 80. It's possible a rogue malicious process has hijacked your web port, but it's more likely that an old apache process simply didn't die properly.

Problem Resolution

First try running killall httpd, then attempt starting apache again. If that fails, then run the following to see what httpd process remains:

ps aux | grep httpd

The result will look something like this:

apache 1635 1.5 2.0 250044 169020 ? S 01:03 0:03 /usr/sbin/httpd

Then kill the remaining process using its ID (kill -9 is a forceful termination):

kill -9 1635

Once the process has been terminated, you should be safe to start apache again:

systemctl restart httpd

Was this answer helpful?

← Back