Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache Server Noob: 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?

like image 709
TurgidWizard Avatar asked Jul 08 '15 16:07

TurgidWizard


3 Answers

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
like image 117
Rahul Jain Avatar answered Oct 17 '22 12:10

Rahul Jain


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.

like image 6
Ribena Avatar answered Oct 17 '22 13:10

Ribena


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.

like image 3
stiebrs Avatar answered Oct 17 '22 14:10

stiebrs