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!
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.