Solved: Address already in use: make_sock: could not bind to address 0.0.0.0:80/443
I would like to share a solution for the apache error: Address already in use: make_sock: could not bind to address 0.0.0.0:80/443. Yesterday, after restarting a client’s web server, I could not connect to their website. So I assumed that apache wasn’t running, so I started it with the normal start command in Ubuntu but was receiving the following error:
# service apache2 start (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
I checked out my apache conf files including httpd.conf, apache2.conf, ports.conf, and turned off port 80 but after doing that, I received a different error:
# service apache2 start (98)Address already in use: make_sock: could not bind to address 0.0.0.0:443
So I thought that maybe apache was already running and using both port 80 and 443. If it was, it would make a lot of sense why it would hang because my SSL certificate required a password to be entered in interactive mode. So first I had to determine if it really was running in the background. After doing some searches on the web, I found the commands I needed:
# lsof -i -n|grep http
This returned one row showing that http was already running. I made note of the process ID from the second column and killed the process:
# kill 1234
After that, I was able to restart apache again followed by the SSL password prompt. I hope this helps those of you who are having the same problem as I did yesterday.