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!
3 July 2011 at 3:16 PM
@Moosa
thanx…
worked for me
30 August 2011 at 8:03 AM
Okay I’m conevincd. Let’s put it to action.
18 July 2011 at 2:22 PM
@David
SQL Server 2008 R2 Ent. too, turned the Reporting Service off and problem is solved.
+1
6 August 2011 at 9:17 PM
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.
7 August 2011 at 3:02 PM
why doesn’t my xampp work.. im using 1.7.5, i’m using windows 7
8 September 2011 at 2:53 PM
“ummm” isn’t that BETA software???
9 August 2011 at 6:21 AM
not work 4 me
18 August 2011 at 6:28 PM
work 4 me. need 2 reboot. tanks
22 August 2011 at 12:15 PM
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 September 2011 at 2:59 PM
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.
14 September 2011 at 10:49 AM
Disable service World Wide Web Publishing
26 September 2011 at 10:53 PM
worked for me, I am using win 7 64 so i had to create 64 registry value
thanks alot mate
28 September 2011 at 12:07 AM
Thankx…
worked for me
12 October 2011 at 1:03 PM
It starts Apache but doesn’t allow you to stop it. Also this “fix” does not address MySQL not working, just Apache.
18 October 2011 at 7:21 PM
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.
18 October 2011 at 11:33 PM
Hey, thx very much. so so much.
Turkey…
19 October 2011 at 2:14 PM
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?
9 November 2011 at 6:59 PM
Thanks for this!! Was driving me crazy trying to figure this out!
20 November 2011 at 11:11 AM
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
29 November 2011 at 6:04 AM
It not working in my system. Please give me any solution. I request to all.
3 December 2011 at 9:29 AM
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
8 December 2011 at 7:45 PM
grt.. !! i followed the steps and disabled http.sys.. Apache server is running after system reboot.. thanx…
18 December 2011 at 3:18 PM
Apache was not working on my laptop because Skype was using port 80. Try quitting Skype to see if it fixes the problem.