'Apache Server: no listening sockets available

I recently downloaded an Apache server binary (Apache 2.4.12 x64)

When I try to run the server in command prompt I get the following error:

(OS 10048)Only one usage of each socket address (protocol/network address/port) is normally permitted. : AH00072: make_sock: could not bind to address 0.0.0.0:80

AH00451: no listening sockets available, shutting down

AH00015: Unable to open logs

I'm guessing that port 80 is already being used. How do I change the binding port, which port(s) should I use? If there is another problem how do I solve it?



Solution 1:[1]

Check these:

  • Check if port 80 is being used by any other process – “netstat -o
  • Shut down IIS from the commadn line: “net stop was /y”

Shutting Skype works for me as it is using port 8080

Try to edit httpd file in conf folder and edit the following entry-change Listen port **from Listen 80 to

#Listen 12.34.56.78:80
Listen 8080

Solution 2:[2]

Try this:

sudo netstat -tulpn | grep :80

In my case I can see:

tcp6 0 0 :::80 ::: LISTEN 2604/docker-proxy*

I can then kill that process:

kill 2604

And then successfully restart Apache.

Solution 3:[3]

In httpd.conf there should be an entry like "Listen 80". Sometimes default port 80 is taken by some other application (I remember that Skype used to use that port for example). Other more or less standard ports to use are 8000 and 8080, but generally you can set it to whatever you want, if you are just playing locally. More info can be obtained in the official documentation.

Solution 4:[4]

This was getting too complicated for me. I typed

sudo apt remove --purge apache2
sudo apt install apache2

Then I had to change the permissions in /var/www/html for the files, the directory itself, and subdirectories. By default they are -rw-------

sudo chmod 755 *

The more I was trying to sort out the problems, the more problems I seemed to have. The people who wrote this software know what they are doing, and they certainly know much much much more than I.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Rahul Jain
Solution 2 Ribena
Solution 3 tomerpacific
Solution 4 Alain Reve