Thought Patterns

Cameron’s thoughts on everything and nothing.

Getting Apache to run on port 80 on Windows 7

| 152 Comments

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

152 Comments

  1. @Moosa
    thanx…
    worked for me

  2. @David
    SQL Server 2008 R2 Ent. too, turned the Reporting Service off and problem is solved.
    +1

  3. If you have SQL Server 2008 Report Service Installed that is the reason the port is being used as David said. Turning Reporting Services off will solve your problem.

  4. why doesn’t my xampp work.. im using 1.7.5, i’m using windows 7

  5. not work 4 me

  6. work 4 me. need 2 reboot. tanks

  7. The report really isn’t anything other then , I am lost on the internet trying to sea , see , C. c u- n’ it.Now , how far down the rabbit hole goes before , I’m like turn it off and go wash some dishes. Ya’ll motherfuckers ain’t scared. I’m here for my mom , my boss and everyone that hates me cause they want to hurt you , emotionally speaking.

  8. Thanks Cameron,
    That’s a good explanation (and fix) for Microsoft’s tendency to use http.sys (a driver actually) to empower remote management and reporting without the user being aware of the mechanism.

    The http.sys (a driver actually) radically improves the response of IIS, as it moved the actual stream into the core of the OS, so the IIS process no longer has top manage that aspect. So from a server point of view, it was a good thing. Unfortunately, it allows MS services to be ‘hooked’ on with little user control

    thanks again.

  9. Disable service World Wide Web Publishing

  10. worked for me, I am using win 7 64 so i had to create 64 registry value
    thanks alot mate

  11. Thankx…
    worked for me

  12. It starts Apache but doesn’t allow you to stop it. Also this “fix” does not address MySQL not working, just Apache.

  13. I just had this problem and solved it by disabling the “World Wide Web Publishing Service”. Not sure why it was started maybe something with Office.

  14. Hey, thx very much. so so much.
    Turkey…

  15. I have managed to disenable the BrancheCache servicen on windows 7 ultimate, but still apache is not running, it starts for a while and it stops..tell me what m doing wrong?

  16. Thanks for this!! Was driving me crazy trying to figure this out!

  17. The solution is one..
    Go to regedit.exe go at:
    HKEY_LOCAL_MACHINE>SYSTEM>CurrentControlSet>services>HTTP
    and change,the reg_dword named “Start” ,it’s value to zero (“0″ without quotes) ,press okay.
    Then restart.
    THE IMPORTANT IS to open your server as fast your computer starts so port 80 is taken by apache…
    It took my to find this 2days,as a summary of all the above…
    I think I’ve helped :)

    • I’m confirming that this worked for me. The original post didn’t work, although Alexander El-Kady’s solution did. Thank you for posting this solution!!! really appreciate it

  18. It not working in my system. Please give me any solution. I request to all.

  19. i had the same problem starting my apache server on win 7, but it was not only port 80, but port 443 that was blocked. so i first said skype not to use port 80 and 443 as alternative ports for incoming connections. so port 80 was released, but 443 still blocked. so i tried the following (what should always work):
    open cmd and type “netstat -aon” (without the quotation marks) and search for the PID that is listening to port 80 or 443. if the PID is not 4, you can easily go on, because PID 4 is the system prozess and cannot/should not be killed.
    type “tasklist” in cmd and look for the PID of the task listening to port 80/443. if you don’t need it, go on by killing the prozess with the command “taskkill -pid [PID]”
    i hope this one helps you running apache on win 7 ;)

  20. grt.. !! i followed the steps and disabled http.sys.. Apache server is running after system reboot.. thanx…

  21. Apache was not working on my laptop because Skype was using port 80. Try quitting Skype to see if it fixes the problem.

  22. SQL Server 2008 Report Service was the problem, now solved, thanks a lot!

  23. Great explicit directions leaving no blanks for the user to fill in and no misleading tangents

  24. Thanks so much!!
    Worked perfectly :)

  25. I had the same problem, but none of the solutions presented here worked on my system. I had to open device-manager, enable “show non-pnp devices” (this is a translation from my German system. I do not know, if this is the name of the menu-option in English systems) and set the start-option of the HTTP-driver to deactivated. This set the value Start-Key in the registry-tree HKEY_LOCAL_MACHINE>SYSTEM>CurrentControlSet>services>HTTP to 4.

  26. Problem is still there for me, I have changed the ports that skype and teamviewer use aswell as this.

  27. It works!!! THX!!! I have been searching for something like this long time ago… Really, really thank you…

  28. I don’t have any BranchCache in my machine, and this solution definitely was necessary and saved my sanity… I’d stopped skype and my antivirus and several other ‘suspicious’ ;) services as well — thanks a lot!

  29. The recommended change did not work for me. It turns out that Skype also likes to use ports 80 and 443. This fix did work:
    Disabling Skype from Using, Opening, and Listening on Port 80 and 443.

  30. try this “NET stop http”

  31. Go to services and disable MS’s World Wide Web Publishing Service
    That’s the culprit. . .
    -K

  32. Stopping WorldWidePublishing service worked for me. All other attempts were failed(except adding a registry key value). Thanks guys. This was very helpful….

  33. Thank you for saving my life! (or at least my day).
    Do you have a Flattr account, so I can give you a tip?

  34. It worked perfectly… Thank you… :)

  35. Thank God!
    This worked for me!
    Thank you!!! :D

  36. I could be a number of services, I went through a bunch, the last 3 since a netstat refresh were
    Windows Live ID signin
    Web Deployment agent
    Office subscription agent

    Probably best also to reduce start-up programs and start xampp shortly after startup.

  37. Thank you Microsoft… for making our lives so much better!

  38. I had the same problem on Windows 8.

    Worked fine for a few days, then XAMPP and Skype both failed. Tried the fix above but no luck, then in the comments I saw something about IIS.

    Removed this and now all works.

  39. I was just about to throw in the towel after following the many dead end questions and answers in various forums and this has saved the day.

  40. After going thru these steps and restarting computer, Apache is working. However, now Print Spooler won’t start because it depends on HTTP :) … is there a way to just change port for HTTP?

    Thank you

  41. i no open port 80 SQL server 2000 win7

  42. I have been surfing on-line greater than 3 hours today,
    but I by no means discovered any attention-grabbing article like
    yours. It’s lovely price enough for me. In my view, if all site owners and bloggers made good content as you did, the internet will be a lot more helpful than ever before.

  43. @Tomas – Thanks, that worked for me.

  44. I have been trying to get Xampp to work all day. I had it working and then an update came through so what did I do. I clicked on the update button and Xampp hasn’t worked since.

    I am getting the Port 80 blocked message. I read your solution but I don’t know what “Launch RegEdit:” means.

    Would someone kindly email me and explain

  45. just stop w3sv in services to get apache running on xampp port 80

  46. Disabling and Stopping the BrancheCache service on Windows 7 Ultimate, SP1 x64 system WORKED. I spent $159 with Pantek for 1 hour support and they didn’t resolve and I preferred NOT to pay for another hour!! Much Thanks for this solution!

Leave a Reply

Required fields are marked *.

*