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!
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
@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?
Hi Cameron,
Are you using Windows 7 client sku or server sku?
THanks,
Niranjan
Windows 7 client sku
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.
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.
For me disabling BranchCache service fixed the issue.
Ive disabled both, BrandCache and http.sys but still having a problem to run apache.
Disabling Windows Remote Management service worked for me too. Thanks.
Install Apache as Service. Then make it start automatically, and Reboot.
Apache will start before http.sys start.
That’s work for me..
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.
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?
.. and I forgot this: Branch Cachee service is installed and visible through Service Manager, but it is not running!
Hi,
Disabled BranchCache service but still the problem exists
Busy… port 80 …
HELP!!!
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.
not working man.!!!!!
Hi!! It’s great!! You realy help my…thanks from Russia! =)
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) ?
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”
turn off skype is working fine for me
I also had this problem with SQL Server 2008 Enterprise Reporting Services.
@J Gitter
Very Nice Gitte TY! It was SQL Server 2008 RS indeed!
Yup, thanks for tracking this down, it was SQL server for me as well, the exact name was:
SQL Server Reporting Services (MSSQLSERVER)
My problem was skype.
Yes! It was skype that blocked port 80. Thank you for the solution!
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
I run Windows 7 build 7600 (x64) and after exiting skype, Apache started just fine.
Thanks for the tips!!!
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!)
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/
yeah, for me it was skype
thanks guys!
Thank u so much!
not work……
any other silution???
The skype issue was my problem…started right up after disabling the alternatives.
w3svc service de publication world wide web
sorry for my poor english, but if you deactive this service everything is ok
+1 on the SQL Server Reporting Service.
Why is this default?
SQL Server Reporting Services here as well, stopping it solves the problem
@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.
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.
I had this problem with SQL Server 2008 Enterprise Reporting Services. Disabling it works!
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.
You don’t need disable complete HTTP, just W3SVC (World Wide Web Publishing Service), which listens on port 80
Thx for this
@Artur
Awesome, that fixed it for me! Thanks Artur
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.
@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… .
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.
skype was using port 80 in my system
i have changed setting in skype
and now apache is working fine on port 80
My xampp didn’t work with Win7.
It was a systemprocess, too.
netstat -nao |find “80″
The problem was my installed MSSQL which service i had started.
xampp and mssql use the same important port, but the highest priority has ms. =(
To deactivate it, change all services related to MSSQL to manually:
run->services.msc
I don’t know which one is the right one to turn off.
Thx for giving me hints on that problem!
@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.
Just stop the service SQL Server Reporting Services (MSSQLSERVER), that’s all.
I just followed the steps from (b), now my wamp server is working fine… thank you very much… after a week I got the solution