5

When I am trying to run apache on windows, I receive a following error:

D:\Apps\Apache\bin>D:\Apps\Apache\bin\httpd.exe
(OS 10013)An attempt was made to access a socket in a way forbidden by its access permissions.  : AH00072: make_sock: could not bind to address [::]:80
(OS 10013)An attempt was made to access a socket in a way forbidden by its access permissions.  : 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

Port 80 is occupied by PID 4

D:\Apps\!Hack>netstat -aon

Active Connections

  Proto  Local Address          Foreign Address        State           PID
  TCP    0.0.0.0:80             0.0.0.0:0              LISTENING       4
  TCP    0.0.0.0:135            0.0.0.0:0              LISTENING       1040
  TCP    0.0.0.0:443            0.0.0.0:0              LISTENING       8380

Pid 4 is System.

What next?

Dims
  • 12,244
  • 78
  • 161
  • 252
  • 1
    Try to find system process that took port 80 (check skype options, disable sharing of updates and etc...) or run Apache on different port – Alex Feb 06 '17 at 09:17

5 Answers5

3

I am not sure who is still struggling with the issue. But for me stopping the iis server helped. Windows server will always give a priority on the port 80 to IIS. Stopping the server helped

Olivier
  • 31
  • 1
2

That were MS SQL reporting services:https://www.sitepoint.com/unblock-port-80-on-windows-run-apache/

Dims
  • 12,244
  • 78
  • 161
  • 252
2

While other answers have focused on finding and stopping whatever else may be running on port 80 (which is useful if indeed you WANT Apache listening on 80), another option would be to change Apache to listen on port OTHER than 80. That's easily done.

Find the conf\http.conf file within Apache, and within that file find the following line:

Listen 80

Change it to another port, such as 81 or 8080. Save the file, restart Apache, and see if it starts now.

This approach is useful for those wanting to test against Apache AS WELL AS IIS (and perhaps other web servers), and they're ok assigning each to a different port (leaving IIS or another process running on 80).

charlie arehart
  • 282
  • 2
  • 8
1

It means HTTP port 80 is already in use, same thing can happen for HTTPS 443 also

you can check which program is using this port with some tools like Essentials NetTools

Ahmed Mihoub
  • 111
  • 2
1

I had had days of following examples and suggestions by other IT Professionals on the internet and most of the suggestions did not work for me and I am guessing that most of you are having the same issue and almost giving up! Well don't:

This is why: I am using Windows Server 2012 R2, and my xampp server was running nicely until three days a go! I checked everything and did not understand why it would not start! Finally I got it to work by Removing/stopping the site on IIS Bindings.

  1. Change the Port from 80 to 8080/8081/81 witch ever is good for you.
  2. Press Win Key + R and run the following command in the dialog box "Inetmgr", this will open up the IIS Manager, Navigate to the Default Website, Click on it, on the right side you will see a column, look for the option Bidings.
  3. Click on the Binding option and see if the port you're specifying for the Xampp server is not used? If yes, choose a different port number and make sure this port is not by any chance assigned to IIS.

I hope this helps