Error Starting Apache Linux: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available

Problem Statement

When starting Apache on Linux, you might see this error: “make_sock: could not bind to address 0.0.0.0:80 no listening sockets available…” But you cannot find any process listening on that port!

Solution

This essentially means port 80 is already occupied. If a process were listening on that port then its easy to resolve it. But the case here is that, using the following commands we cannot find anything listening on that port:

  • lsof -i:80
  • netstat -anp | grep 80
  • ps -ef| grep http

So, what is going on?

Open your <APACHE_HOME\conf\httpd.conf file, look for following lines:

  • Include conf/extra/httpd-vhosts.conf
  • Listen 80

If both are present and un-commented, they are probably conflicting with each other, and Apache is trying to bind to port 80 twice once via Virtual Host and then once via Listen 80. If you are not interested in virtual hosts comment that particular include. OR just try commenting ‘Listen 80’ line alone.

Now restart Apache. You should be fine :). That’s It.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: