85

I have installed the Windows 10 Insider Program. Everything works, except Apache. When I try to start it, it says that port 80 is blocked. Is there a way to unblock it or tell Apache to use another port instead?

I was using Windows 7 before. I had trouble with port 80 with skype, but i have disabled it.

Aloso
  • 4,081
  • 4
  • 20
  • 34
  • The PID is 4. The Process is System (NT Kernel & System) – Aloso Jun 10 '15 at 14:26
  • Beware of your computer's brand : found out that my computer has a custom service which was blocking the port. I had to disable all services one-by-one to finally figure that out... – Jean-François Savard Oct 07 '16 at 00:50
  • Possible duplicate of [XAMPP : Couldn't start Apache (Windows 10)](https://stackoverflow.com/questions/27333203/xampp-couldnt-start-apache-windows-10) – Burgi Jul 23 '17 at 22:09
  • Change IIS PORT : https://stackoverflow.com/questions/19312136/how-do-i-change-iis-express-8-port-80-to-8080/56802079#56802079 – Suresh Kamrushi Jun 28 '19 at 06:45

18 Answers18

208

I had the same problem on windows 10, IIS/10.0 was using port 80

To solve that:

  • find service "W3SVC"
  • disable it, or set it to "manual"

French name is: "Service de publication World Wide Web"

English name is: "World Wide Web Publishing Service"

german name is: "WWW-Publishingdienst" – thanks @fiffy

Polish name is: "Usługa publikowania w sieci WWW" - thanks @KrzysDan

Russian name is "Служба веб-публикаций" – thanks @Kreozot

Italian name is "Servizio Pubblicazione sul Web" – thanks @Claudio-Venturini

Español name is "Servicio de publicación World Wide Web" - thanks @Daniel-Santarriaga

Portuguese (Brazil) name is "Serviço de publicação da World Wide Web" - thanks @thiago-born


Alternatives :


Edit 07 oct 2015: For more details, see Matthew Stumphy's answer Apache Server (xampp) doesn't run on Windows 10 (Port 80)

Community
  • 1
  • 1
paaacman
  • 2,872
  • 1
  • 16
  • 18
  • 2
    Awesome... Its an issue with Windows 10 by default – user3658423 Aug 06 '15 at 22:46
  • 3
    Service can be disabled at startup by opening `Administrative Tools` and selecting `Services`. A window will pop up titled Services. Then find `World Wide Web Publishing Services`, right click and select `Properties`. Change `Startup Type` to `Manual` and click `Apply` – zgr024 Sep 20 '15 at 03:11
  • 3
    Others can find display name by calling `sc getdisplayname W3SVC` – Honza Kuchař May 01 '16 at 18:57
  • Is there any reason at all for W3SVC to run on a normal computer that isn't acting like a web server? – DaedalusAlpha Jul 06 '16 at 11:58
  • Wouldn't it be better to remove the World Wide Web Publishing Service from the list of installed windows components? Then there is no need to disable the service since it whould no longer be installed. – Arnoud Sietsema Nov 30 '16 at 10:21
31

This answer is intended as an addendum to the highest rated answer on this thread by paaacman. I just wanted to add some helpful detail for users like myself who don't know their way around Windows 10 as well.

Windows 10 runs IIS (Internet Information Services, Microsoft's web server software) automatically during Startup on Port 80. In order to use Apache Server on that port, IIS must be stopped.

paaacman's response refers to the IIS server as "W3SVC", or the "World Wide Web Publishing Service". I suppose that's because Windows 10 runs IIS as a service. In order to disable it or modify how the service runs, you need to know where to find "Services" in your system.

I found the easiest way there was to click on the search button next to the start menu button in the Windows 10 taskbar and type "Administrative Tools". You can either hit return or click on the "Administrative Tools" link that Windows finds for you.

A control panel window will open with a list of tools. The one you want is "Services." Double-click it.

Another window will open called "Services." Locate the one named "World Wide Web Publishing Service." Some other users in this thread have listed what it is called in other languages, if your list is not in English.

If you only want to turn off the IIS server for this Windows session, but want it to run automatically again the next time you start up Windows, right-click "World Wide Web Publishing Service" and choose "Stop." The server will stop, and Port 80 will be freed up for Apache (or whatever else you want to use it for).

If you want to prevent the IIS server from running automatically when you start up Windows in the future, right-click "World Wide Web Publishing Serivce" and select "Properties." In the window that appears, locate the "Startup type" dropdown, and set it "Manual." Click "Apply" or "OK" to save your changes. You should be all set.

Matthew Stumphy
  • 310
  • 3
  • 4
16

With Windows 10 IIS runs on Port 80 by default which can be changed:

Run appwiz.cpl use Turn Windows features on or off and install the IIS Manager Console.

Turn Windows features on or off -> Internet Information Services -> Web Management Tools -> IIS Management Console

Run InetMgr.exe and go to "Connections -> Sites" and open with right-mouse click the context menu on the default entry "Default Website". In Context Menu select "Bindings" to open the Server address and port configuration.

"Connections -> Sites" -> "Default Website Bindings"

Server address and port configuration

Chaning Default Port to 8080

https://technet.microsoft.com/library/hh831681.aspx#Site_Bingings

CrandellWS
  • 2,358
  • 4
  • 44
  • 100
14

I had the exact same problem and solved it running the folowing command from the command line as an admin :

1) first stop the service with the following

net stop http /y

2) then disable the startup (optional)

sc config http start= disabled

biology.info
  • 3,340
  • 2
  • 23
  • 36
Jan Naj
  • 141
  • 1
  • 3
9

Type in command line

netstat -aon | findstr :80

You'll see PID of process which uses port 80. Then try to configure this app to use another port, or just kill it

UPDATE: I'll write my comment here to be more clear: according to this link, in Windows 10, it is the MsDepSvc service which occupies port 80. It's for IIS or Web Matrix 2. If you will not use IIS or Web Matrix 2 for any web development, you can try shutting down the service

And for the second part of your question, you can tell Apache to use another port by editing [Apache folder]/conf/httpd.conf. It has "Listen 80" string. Change 80 to whatever free port you want and reload Apache

  • It's the System. I cant kill this, can I? – Aloso Jun 10 '15 at 14:27
  • After quick Googling, i find this link http://www.nextofwindows.com/why-port-80-is-being-used-by-system-process-id-4-whats-going-on-with-your-windows-machine/ . " ..., you have this services MsDepSvc running in the background that’s occupying port 80.A quick fix would be stop the service, when you don’t plan to use IIS or Web Matrix 2 for any web development. And start the services when it needed, hope that solves some mysteries you might have when you switching between using Web Matrix to the traditional apache development." – Sergey Maksimenko Jun 11 '15 at 06:59
  • I'm sorry but I dont have this process. – Aloso Jul 05 '15 at 12:49
8

You may need to terminate SQL Server Reporting Services as well.

bjorkblom
  • 1,637
  • 2
  • 15
  • 26
5

In my case I need both XAMPP for Apache development & IIS Express for .Net 2013 development; so I do the following:

  1. In Command Prompt typed services.msc, this loads "Windows Services" where I located "World Wide Web Publishing Service" and stop it. World Wide Web Publishing Service STOP

  2. The I start XAMPP Control Panel click on "Config", then choose "Apache httpd.conf". Search for "80" then change that to "8080" in both "Listen 80" and "ServerName localhost:80". Save the file from "Save As" & choose "All files" to not save it as text from "Save As Type" & the "Encoding" should be "UTF-8". Apache httpd.conf

  3. Quit XAMPP Control Panel, then start it again and from "Action" start Apache & MySQL. Now you will see the port changed. As you know now you have to get to your Apache server by using "localhost:8080" instead of "localhost". Also you have both Apache & IIS Express running in the same Windows 10 PC.

I read a post some where were the writer suggested to use port "9080" but it did not work for me.

Willi Mentzel
  • 21,499
  • 16
  • 88
  • 101
alhaythum
  • 61
  • 1
  • 4
3

The problem happens whenever a process uses port 80.

You can run Netstat which is available in XAMPP Control Panel and check which process uses port 80 in your system.

For me it wasn't IIS, but Skype.

Turn off that process/application and then start the Apache services.

armsdev
  • 31
  • 1
  • This just seems like a duplicate of a number of the previous answers, maybe it's better just as a comment that Skype was the problem process for you. – blm Nov 10 '15 at 19:19
  • "It was skype" sounds like an answer to me! It may not have been the answer that solved it for OP, but it did for me, and I'm thankful it was an answer and not a comment, or I may not have seen it. – arichards Aug 09 '16 at 18:14
2

I know that maybe this problem was resolved but I had the same problem with different solution. For that, I am going to explain another possible solution. In my case, the port 80 was occupied by Skype (pid: 25252) and I did not know what programme was.

To see the program's pid which is using the port 80 you can use the command that other people said before:

netstat -aon | findstr 0.0:80

To kill the process using the pid (in the case that you do not know the programme) you have to open the CMD with administrator permission and use the next command:

taskkill /pid 25252

Other options with this command are here.

Ashish Ahuja
  • 4,798
  • 9
  • 48
  • 63
CGG
  • 231
  • 1
  • 7
  • 19
  • This is not the same problem because you can disable port 80 in the settings of skype. You do not need to kill skype! – Aloso Oct 08 '15 at 08:10
  • You are right. I saw now the option. When I had the problem I did not see it. – CGG Oct 15 '15 at 08:46
1

I know this MIGHT not be the cause of your issue, but I've spent a few hours hitting my head against the wall to solve this issue and this is my solution.

(running Windows 10 x32)

So I had installed XAMPP in a deeply nested directory and all the conf files make reference to root\xampp\apache, whereas my files were some_dir\another_dir\whatthehelliswrongwithme\finally\xampp\apache

so my options were to either go through and edit all \xampp\apache references and point them at the right place, OR, the much simpler option... reinstall XAMPP at the root, so the references all point to the right place.

A little annoying, but I guess that's what we get when Mac and Windows try to be friends..

Hope it helps a few of you.

Nathaniel Rogers
  • 149
  • 3
  • 10
1

In case you need to run IIS on port 80/443 but on different IP address, you may use netsh http add iplisten xxx.xxx.xxx.xxx as described here: https://support.microsoft.com/en-us/help/954874/iis-binds-to-all-ip-addresses-on-a-server-when-you-install-iis-7-0-on

More details about netsh http add iplisten can be found here: https://msdn.microsoft.com/en-us/library/windows/desktop/cc307219.aspx

TN.
  • 17,602
  • 25
  • 84
  • 141
1

I think it simple to change your Apache server port

  1. Go to C:\xampplite\apache\conf
  2. Open httpd.conf files
  3. Search for Listen 80
  4. Change 80 to any other like 9080
  5. Now XAMPP restart try to start server

NB I am using Server version: 5.1.41 with windows 10

reza.cse08
  • 5,172
  • 38
  • 34
0

Shutting down "some system process" may be tricky... you should rather edit the [Apache folder]/conf/httpd.conf as mentioned by @Sergey Maksimenko and if you want to configure virtual host, use the new port in [Apache folder]/conf/extra/httpd-vhosts.conf (I used 4900 instead of 80 and 4901 instead of 443 in [Apache folder]/conf/httpd-ssl.conf). And remember to use the port when accessing page on localhost (or your virtualhost), for example: localhost:4900/index.html

Jarda
  • 514
  • 8
  • 28
0

This fixed node.js not running on port 80 under Windows 10 as well, I was getting a listen eacces error. Start > Services, find "World Wide Web Publish Service" and disable it, exactly as paaacman described.

blented
  • 2,253
  • 2
  • 19
  • 17
0

I had the same issue and none of the above solutions worked for me.

Apache uses both ports 80 and 443 (for HTTPS) and both must be ready to be used for Apache to start successfully. Only port 80 might not be enough.

I found in my case that when running VMWare Workstation I had the port 443 used by the VMware sharing.

You have to disable sharing in the VMware main Preferences or change the port in this section.

After that as long as you have no other server hooked to the port 80 (see above solutions) then you should be able to start Apache or NGinx on XAMPP or any other Windows stack application.

I hope this will help other users.

0

While many are taking the approach to stop/disable IIS, it may be helpful to know that you can simply modify the XAMPP port, which has been answered here. This is the route I had to take as I need both running.

Community
  • 1
  • 1
MackAltman
  • 21
  • 2
0

Beside the quite obvious reason (IIS), there is another reason that is common enough for this problem. It is worth to quote this question and its answer here:

http://stackoverflow.com/questions/22994888/why-skype-using-http-or-https-ports-80-and-443 

So, if you have Skype installed in the computer, be sure to check this as well. The solution is quoted here:

To turn off and disable Skype usage of and listening on port 80 and port 443, open the Skype window, then click on Tools menu and select Options. Click on Advanced tab, and go to Connection sub-tab. Untick or uncheck the check box for Use port 80 and 443 as an alternatives for incoming connections option. Click on Save button and then restart Skype to make the change effective.

Earth Engine
  • 9,100
  • 4
  • 41
  • 68
  • Everybody says turn off and disable Skype, but what impact does doing that have on Skype? Do we need to change any config settings in Skype? – luisdev Sep 12 '16 at 13:53
  • @luisdev Just follow the steps described in the quote above. It tells you how to change the config settings in Skype. – Earth Engine Sep 12 '16 at 23:30
  • Ok, I know how to change the config settings in Skype, but what impact does changing the Skype settings have on Skype functionality? Will it affect my ability to make or receive calls on Skype? If Skype is no longer listening on ports 80 and 443 will people still be able to call me? – luisdev Sep 14 '16 at 14:31
  • 1
    @luisdev I don't have problem on disabling those ports in Skype. It seems it only being useful when you are behind some specific firewalls. So if this does not work for you you will have to turn it back on. Unfortunately, Skype did this in the wrong way that it is listening on ALL addresses rather than OUTER addresses only, making it impossible for you to listen on localhost only. – Earth Engine Sep 15 '16 at 01:08
-1

First, open regedit run as administrator see image open HKEY_LOCAL_MACHINE\SYSTEM\CurrentCurrentControlSet\Services\HTTP open Start, change value from 3 to 4 see image then restart your computer

Viko
  • 11
  • 1