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. February 25th, 2010 at 14:14 | #1

    After fixing the port 80 problem by disabling UAC I now get this error:
    The system cannot find the specified file. : No installed service named “Apache2″.
    I get this after installing a fresh version (2.0.52) I used on the XP Pro system then copying over the Apach Group folder or if I just start with a freh install of v2.2.14 Would I be better off to just install Window XP Pro over this Windowes 7 Pro system

  2. February 26th, 2010 at 16:05 | #2

    Guess I spoke (wrote)too soon. Apache 2.0.05 was giving me too much trouble so I upgraded to 2.2.14. This eliminated the No Service Installed error, and the system does come up in localhost mode, but when it loads I get:

    (OS 10048) Only one use of each socket address (protocol/network address/port)is normally permitted. : make_sock: could not bind to address 0.0.0.80. No listening socket available.
    Shutting down. Unable to open logs.

    I ran netstat -ano | find “:80″ and it indicated LISTENING PID 80

    I’m not sure how to trace that or what might be causing it.

  3. Daniel
    March 4th, 2010 at 14:47 | #3

    i have done the above an disable the service BranchCache still no joy windows is still listining on 80

  4. NeoXidant
    March 8th, 2010 at 21:29 | #4

    Hello. This is my instruction (we simply change the way to run):

    1) Launch RegEdit:

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

    3) Find a DWORD (32-bit) value ‘Start’ not including the quotes

    4) Go to the properties

    5) In the Value data field type ‘0′ not including quotes and click OK

    6) Re-boot your computer

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

  5. kislui
    March 12th, 2010 at 22:52 | #5

    @NeoXidant
    This does work, but it kills off windows printing services which relies on that HTTP component.

  6. Mathince
    March 29th, 2010 at 22:47 | #6

    Hi !

    For those of you who have problem using EasyPHP or any other web server and using Skype. Make sure to change the port skype whas using. By default, skype use port 80 ans this will block any apache server to be lauch.

    If you have able to install Skype, you should be able to changed the setting.

    Hope this post will help any body.

  7. April 15th, 2010 at 21:58 | #7

    I think learning is always better than picking a short way out. I have the problem and am seeking to resolve it.

  8. April 29th, 2010 at 14:06 | #8

    I have an alternate suggestion for Windows 7

    In general, messing with the ports that your Operating System is using just seems like a bad idea, you’ll end up with weird network issues like printing ;)

    In addition, I need to have IIS running locally as well for the .NET projects I take on so having two web servers listening on different ports was important.

    For me the best situation was simply to change the IP Port that Apache listens on (the default is port 80, which is the standard for all web traffic).

    I changed mine to port 8666 (but it could be anything above 1024), I did the following:

    Locate the httpd.conf file in the following directory [install directory]\xampp\apache\conf (mine was in, C:\xampp\apache\conf)

    Find the line that says, Listen 80 and I changed it to Listen 8666. Save and Close the file and now Start the Apache service in the Xampp control panel. Life should be good.

    Now the only catch to this method is that you can’t just go to http://localhost/xampp anymore you have to tell your browser which port specifically to use (it will by default use 80), so you will have to use http://localhost:8666/xampp/ (the port is designated by the colon and then the number).

    The cool thing is I can run http://localhost:8666 to run Apache and http://localhost:8616 to run my local IIS for .NET projects.

    I hope this helps someone

    Jeremy

  9. David
    May 1st, 2010 at 18:31 | #9

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

  10. Christian
    May 5th, 2010 at 14:02 | #10

    @David
    Thanks for that reply. Disabling the SQL Server 2010 Reporting Service saved me after 3 hours of doing nothing but browsing the web for a solution

  11. Laura
    May 11th, 2010 at 22:45 | #11

    thanks David, my problem was Reporting Services too.

  12. May 12th, 2010 at 12:04 | #12

    skeptigator :
    I have an alternate suggestion for Windows 7
    In general, messing with the ports that your Operating System is using just seems like a bad idea, you’ll end up with weird network issues like printing
    In addition, I need to have IIS running locally as well for the .NET projects I take on so having two web servers listening on different ports was important.
    For me the best situation was simply to change the IP Port that Apache listens on (the default is port 80, which is the standard for all web traffic).
    I changed mine to port 8666 (but it could be anything above 1024), I did the following:
    Locate the httpd.conf file in the following directory [install directory]\xampp\apache\conf (mine was in, C:\xampp\apache\conf)
    Find the line that says, Listen 80 and I changed it to Listen 8666. Save and Close the file and now Start the Apache service in the Xampp control panel. Life should be good.
    Now the only catch to this method is that you can’t just go to http://localhost/xampp anymore you have to tell your browser which port specifically to use (it will by default use 80), so you will have to use http://localhost:8666/xampp/ (the port is designated by the colon and then the number).
    The cool thing is I can run http://localhost:8666 to run Apache and http://localhost:8616 to run my local IIS for .NET projects.
    I hope this helps someone
    Jeremy

    Hey mate, I followed your instructions but I think I did something wrong here. I am using Xampp version 1.7.3, and do have to turn on SVC by installing them or do I turn them on by the start button for ‘Apache’ and ‘MySql’?

    I appreciate your help
    CHEERS :)

  13. May 12th, 2010 at 12:30 | #13

    DM :

    skeptigator :
    I have an alternate suggestion for Windows 7
    In general, messing with the ports that your Operating System is using just seems like a bad idea, you’ll end up with weird network issues like printing
    In addition, I need to have IIS running locally as well for the .NET projects I take on so having two web servers listening on different ports was important.
    For me the best situation was simply to change the IP Port that Apache listens on (the default is port 80, which is the standard for all web traffic).
    I changed mine to port 8666 (but it could be anything above 1024), I did the following:
    Locate the httpd.conf file in the following directory [install directory]\xampp\apache\conf (mine was in, C:\xampp\apache\conf)
    Find the line that says, Listen 80 and I changed it to Listen 8666. Save and Close the file and now Start the Apache service in the Xampp control panel. Life should be good.
    Now the only catch to this method is that you can’t just go to http://localhost/xampp anymore you have to tell your browser which port specifically to use (it will by default use 80), so you will have to use http://localhost:8666/xampp/ (the port is designated by the colon and then the number).
    The cool thing is I can run http://localhost:8666 to run Apache and http://localhost:8616 to run my local IIS for .NET projects.
    I hope this helps someone
    Jeremy

    Hey mate, I followed your instructions but I think I did something wrong here. I am using Xampp version 1.7.3, and do have to turn on SVC by installing them or do I turn them on by the start button for ‘Apache’ and ‘MySql’?
    I appreciate your help
    CHEERS

    lol..I got it going friend ;)
    Thanks for the valuable info.

  14. sebastian
    May 19th, 2010 at 14:19 | #14

    @David
    I have the same issue with SQL server 2008, and you where right about sql server was using port 80, it`s been changed tu use port 8080.
    Apache now starts without complainings on por 80.

  15. Moosa
    June 10th, 2010 at 16:49 | #15

    Comment #26 by Fred (which I have quoted below) is absolutely awesome. It sums up all reasons that are discussed in this thread, plus more !
    Brilliant job Fred ! Thank you very much.

    - Oh! and … for me, it was ‘World Wide Web Publishing Service’ that caused the problem.

    Fred :
    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

  16. Andy
    June 13th, 2010 at 06:29 | #16

    Works perfectly. Thanks.

  17. LVWolfman
    June 20th, 2010 at 07:23 | #17

    Fred’s answer was full of good tips. Using his procedure, I found that in my case it was TeamViewer that was hogging port 80. Bad since that’s the remote admin tool I was using at the time. (I use RDP from my Mac for the other Windows machines… but they run XP and this machine runs Windows Home “Premium” which doesn’t support RDP.

    Well, actually it does… you can use this “home” version of Windows to control other computers via RDP, but no one can support you by controlling yours using RDP. Typical backwards M$ thinking I guess. (And just one of a number of crippled features in “Home Premium” Microsoft neglects to mention on their edition comparison charts.)

  18. rushiat
    June 26th, 2010 at 21:38 | #18

    Thanks, Moosa. Works a treat

  19. July 9th, 2010 at 03:56 | #19

    http://support.microsoft.com/kb/149605

    The above link shows you how to change the IIS port bindings. I changed them to port 8585 which allowed Apache to start flawlessly. Now how to change windows remote management https port to other than 443… that’s what I would like to know.

Comment pages
  1. January 25th, 2009 at 02:22 | #1
  2. December 2nd, 2009 at 11:57 | #2
  3. January 20th, 2010 at 14:54 | #3
  4. March 30th, 2010 at 12:49 | #4