Home > Windows 7 > Getting Apache to run on port 80 on Windows 7

Getting Apache to run on port 80 on Windows 7

Update

This solution is no longer necessary. It turns out a service called BranchCache is the culprit. Disabling this service stops Windows from listening on port 80 thus allowing you to run a web server. The description for BranchCache under services.exe is ‘This service caches network content from peers on the local subnet.’

Thanks to a fellow beta tester for the latest resolution.

I’m currently beta testing the next version of Windows, Windows 7 and came across a strange issue while trying to get Apache to install and run using the default port, 80.

Running the command ‘netstat -ano’ from the command line revealed
that port 80 is being used by PID 4.

Looking up PID 4 using Power Shell and then Task Manager revealed
that PID 4 is the NT Kernel!

So Windows 7 by default appears  to be using port 80.

After a bit of hunting around the Internet and doing some research of my own I found that the service http.sys was the culprit and all I needed to do was disable it but I could not find this service listed in the Services control panel applet.

So what’s the solution?

You have to disable the http.sys service manually via the registry:

1) Launch RegEdit:

2) Go to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP

3) Add a new DWORD (32-bit) value

4) Name it ‘NoRun’ not including the quotes

5) Double click the new property

6) In the Value data field type ‘1′ not including quotes and click OK

7) Re-boot your computer

You should now find that Apache will start on port 80!

Bookmark and Share

Cameron Windows 7 ,


  1. Niranjan Inamdar
    January 26th, 2009 at 23:08 | #1

    Hi Cameron,

    I work on Http.sys technology at Microsoft and somebody sent me a link to this blog. I am a bit surprised by this behavior you are seeing on Windows7 Beta and with some help from you, I will like to find out the root cause of this issue so that we can take the appropriate action if needed.
    You are right, Http.sys uses port 80. It is the driver component for httpapi, the server http stack (You can find more info on this technology at http://msdn.microsoft.com/en-us/library/aa364434(VS.85).aspx ). In your case, some application is running which is using http.sys to listen on port 80. This is preventing Apache from using port 80. We offer a mechanism for applications to help control port sharing but I’ll need to look into the specific application that’s causing you this conflict. If you can give us the output of following command “netsh http show servicestate”, then it will allow me to find out which application is using http.sys. Since you have disabled http.sys, please follow these steps listed below before running the command:
    1. sc config http start= demand
    2. Reboot
    3. Run the command (netsh http show servicestate) as administrator

    After you have run this command, you can disable http.sys as follows:
    1. net stop http
    2. Sc config http start= disabled

    Please let me know if you face any issues in the process.

    Thanks,
    Niranjan

  2. Cameron
    January 27th, 2009 at 23:24 | #2

    @Niranjan Inamdar
    Hi Niranjan,

    It now turns out that a service called BranchCache is listening on port 80 preventing other services (i.e. web server) using it.

    I don’t know how important this service is but maybe it should be disabled by default?

  3. Niranjan Inamdar
    January 28th, 2009 at 02:13 | #3

    Hi Cameron,

    Are you using Windows 7 client sku or server sku?

    THanks,
    Niranjan

    • Cameron
      January 29th, 2009 at 19:09 | #4

      Windows 7 client sku

  4. Matt
    February 1st, 2009 at 01:48 | #5

    Hey, I had the same problem with port 80, I disabled http.sys but it didn’t work. However, I went to Services and disabled Windows Remote Management, and it worked right after that. That might be a better choice than disabling http.sys altogether.

  5. February 2nd, 2009 at 20:05 | #6

    I just tried to install Apache 2.4 on Windows 7 Client but it seems that I have the same problem. I will try to work on it and will post the result if you don’t mind. I hope MS will do something with this.

  6. Cameron
    February 7th, 2009 at 10:34 | #7

    For me disabling BranchCache service fixed the issue.

  7. Gabriel
    February 12th, 2009 at 14:35 | #8

    Ive disabled both, BrandCache and http.sys but still having a problem to run apache.

  8. March 19th, 2009 at 11:02 | #9

    Disabling Windows Remote Management service worked for me too. Thanks.

  9. March 20th, 2009 at 03:52 | #10

    Install Apache as Service. Then make it start automatically, and Reboot.
    Apache will start before http.sys start.

    That’s work for me..

  10. Artur
    May 16th, 2009 at 06:11 | #11

    You have other software, such as the Internet Telephone “SKYPE” which also blocks the port 80. However, one can change the SKYPE port: Actions — > Options –> Connection. Here remove the check mark at “Port 80″ for an alternate port. Restart Skype and also it should work.

  11. May 17th, 2009 at 10:37 | #12

    I experience the same with Win7 RC (64 bit).

    Last post here is now +3 months old! Can a fix be expected soon or will I need to ‘hack’ the system?

  12. May 17th, 2009 at 10:42 | #13

    .. and I forgot this: Branch Cachee service is installed and visible through Service Manager, but it is not running!

  13. May 22nd, 2009 at 07:02 | #14

    Hi,
    Disabled BranchCache service but still the problem exists
    Busy… port 80 …
    HELP!!!

  14. May 31st, 2009 at 13:14 | #15

    I am running Windows 7 build 7100 and seeing the problem running XAMPP. I ran netstat and found something listening on 80. I have since discovered that it was some piece of Skype. When I exit Skype, some hold over process continues to run and holds onto 80. I have to kill the process to free up the port.

  15. June 10th, 2009 at 11:11 | #16

    not working man.!!!!!

  16. June 14th, 2009 at 21:11 | #17

    Hi!! It’s great!! You realy help my…thanks from Russia! =)

  17. June 20th, 2009 at 12:27 | #18

    For me it was conflict with Skype! But on Vista I could run Apache and Skype at same time without problems. Can we expect some fix from somewhere (I do not find the option to change the Skype port) ?

  18. Blazsak
    July 12th, 2009 at 12:58 | #19

    For me problem was .NET Framework installation. I had to turn off “.NET Extensibility” option in “Internet Information Services -> World Wide Web Services -> Application Development Features” witch is located in “Control Panel -> Programs and Features -> Turn Windows features on or off”

  19. Jc
    August 13th, 2009 at 15:27 | #20

    turn off skype is working fine for me

  20. J Gitter
    August 20th, 2009 at 17:50 | #21

    I also had this problem with SQL Server 2008 Enterprise Reporting Services.

  21. VoodooRider
    August 27th, 2009 at 17:42 | #22

    @J Gitter
    Very Nice Gitte TY! It was SQL Server 2008 RS indeed!

  22. Adam
    September 3rd, 2009 at 23:31 | #23

    Yup, thanks for tracking this down, it was SQL server for me as well, the exact name was:

    SQL Server Reporting Services (MSSQLSERVER)

  23. Demetrio
    September 26th, 2009 at 07:30 | #24

    My problem was skype.

  24. Maros Dzoganik
    October 7th, 2009 at 22:10 | #25

    Artur :
    You have other software, such as the Internet Telephone “SKYPE” which also blocks the port 80. However, one can change the SKYPE port: Actions — > Options –> Connection. Here remove the check mark at “Port 80″ for an alternate port. Restart Skype and also it should work.

    Yes! It was skype that blocked port 80. Thank you for the solution!

  25. Fred
    October 13th, 2009 at 10:28 | #26

    1. Get pid that is listening port 80: netstat -nao | find “:80″
    2. Open task manager, go to processes tab and check “PID” on menu/view/Select Columns…. then you can find out the progress with that pid.
    3. If it is a normal application or IIS, just disable or uninstall it.
    4. If it is System progress(PID 4), you need to disable HTTP.sys driver which is started on demand by other service, such as Windows Remote Management/Print Spooler on Windows 2008 or Windows 7. there is two way to disable it:
    a.
    1) Go to device manager, select “show hidden devices” from menu/view, go to “Non-Plug and Play Driver”/HTTP, double click it to disable it (and disable or manual some services depended on it).
    2) Reboot and use netstat -nao | find “:80″ to check no 80 is used.

    b.
    1) Launch RegEdit
    2) Go to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP
    3) Change the value of ’start’ to 4 (disabled)
    4) Re-boot your computer

  26. tt4under
    October 13th, 2009 at 18:42 | #27

    I run Windows 7 build 7600 (x64) and after exiting skype, Apache started just fine.
    Thanks for the tips!!!

  27. Chris
    October 23rd, 2009 at 13:09 | #28

    Clicking off the port 80 option in skype worked for me in W7. Go to Skype – tools, options, advanced, connections – unclick “use ports 80 and 443 as alternarives….”

    All good (and easy!)

    Skype continues to run (Also Apache!)

  28. November 4th, 2009 at 22:36 | #29

    if Windows 7 blocks Port 80 – xampp doesnt start. Read my solution at
    http://blog.roman-allenstein.de/2009/11/xampp-unter-windows-7-port-80-belegt/

  29. j2ibeo
    November 5th, 2009 at 02:18 | #30

    yeah, for me it was skype ;)
    thanks guys!

  30. Persia
    November 16th, 2009 at 08:49 | #31

    Thank u so much!

  31. aji
    November 19th, 2009 at 10:14 | #32

    not work……
    any other silution???

  32. Phil
    November 23rd, 2009 at 17:19 | #33

    The skype issue was my problem…started right up after disabling the alternatives.

  33. ouranos666
    November 23rd, 2009 at 23:51 | #34

    w3svc service de publication world wide web

    sorry for my poor english, but if you deactive this service everything is ok

  34. Morten
    November 25th, 2009 at 13:44 | #35

    +1 on the SQL Server Reporting Service.

    Why is this default?

  35. beherit
    December 1st, 2009 at 13:33 | #36

    SQL Server Reporting Services here as well, stopping it solves the problem

  36. December 2nd, 2009 at 11:56 | #37

    @Niranjan Inamdar
    I would like to advice to people stopping the Microsoft HTTP service that it is a dependency for other services as the print spooler.
    Then, blocking the HTTP service you will not be able to use your printers, furthermore you cannot restart manually your print spooler service just because of such dependencies.

    The tcp port 80 belongs to Microsoft.

  37. AnthonyK
    December 11th, 2009 at 17:06 | #38

    Turning off Skype checkbox about reserving port 80 and 443 and Skype restart worked out for.
    Think about other applications you have, that might be using port 80 for any kind of communications – maybe the is causing all the trouble.

  38. Ajith
    December 19th, 2009 at 10:12 | #39

    I had this problem with SQL Server 2008 Enterprise Reporting Services. Disabling it works!

  39. Justin
    December 19th, 2009 at 23:06 | #40

    I’ve tried all of the above. System is using the port 80. I’ve turned off all of the things mentioned above (http, branch was already off, iis is not installed, stopped the SQLEXPRESS service) I’m clueless. Any chance Microsoft could create a utility that would tell us what service is using what port? I’m about to just go down the list stopping each service, and running the netstat -ao command each time until I find the culprit.

  40. hrongyorgy
    December 30th, 2009 at 09:32 | #41

    You don’t need disable complete HTTP, just W3SVC (World Wide Web Publishing Service), which listens on port 80

  41. January 3rd, 2010 at 15:27 | #42

    Thx for this :)

  42. January 7th, 2010 at 17:26 | #43

    @Artur

    Awesome, that fixed it for me! Thanks Artur

  43. January 18th, 2010 at 19:19 | #44

    After noting the Skype comment, I figured that was my problem. All I had to do was stop Skype, start apache, and then start skype again. They seem to be operating fine together, just couldn’t start apache with skype already running.

  44. cosmin
    January 19th, 2010 at 21:48 | #45

    @wayl

    Mmmm, could you please explain in more detail: “The tcp port 80 belongs to Microsoft.” ?
    You must be kidding to write such a thing. I really hope there’s another solution Microsoft can find to get it’s system running without blocking some standard ports on their OS (other than claiming they own the ports).

    It would be a shame to ruin all the good things Microsoft did with Windows 7 (the first really good OS except XP) with such statements of owning ports… .

  45. January 28th, 2010 at 01:40 | #46

    Stopping SQL Server Reporting Services (MSSQLSERVER) did the trick for me as well. I has switched Subversion to use 443 and ran into this issue when switching it back to port 80.

  46. February 8th, 2010 at 14:38 | #47

    @cosmin
    Yeah Cosmin, I was just kidding.
    I’m enthusiast with my brand new windows 7, as much as I am in love with XP, but such problems made me drive bananas. After all, after having fixed that problem the first time, and then the services restarted, I had no more problems. Maybe due to some automatically installed patch, or something changed within the windows configuration.

  1. January 25th, 2009 at 02:22 | #1
  2. December 2nd, 2009 at 11:57 | #2
  3. January 20th, 2010 at 14:54 | #3