Apache Startup Issues
When Apache does not start after installation, nor after a system restart, chances are that another process or service has already taken ports 80 (the HTTP port) and 443 (the HTTPS / SSL port).
This can be –
- Other web-server applications such as: IIS, Tomcat, Nginx, etc.
- Unrelated applications such as Skype.
- Windows Services such as BranchCache.
Only one application is allowed to bind-to/listen-on a specific port.
Test Apache by executing this from the command line…
httpd -t -n "Apache2" httpd -k start -n "Apache2"
(*use the proper Apache Service name, they are different for different versions and WAMPs – see below section)
(*run commands from an administrator level command-line: right-click cmd.exe, select ‘Run as admin’)
The first command will test Apache’s configuration, the second command will attempt to start Apache. Helpful error messages will be shown.
If the error message is similar to:
“An attempt was made to access a socket in a way forbidden by its access permissions. make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down.”
…then we know that another application has binded to (taken) port 80 and/or 443.
Stop and disable IIS if it’s running. Stop Skype. Stop the BranchCache Service.
See this guide for a larger list of port 80 listeners: Opening Up Port 80 For Apache to Use On Windows
See this guide for running Apache and other web-servers side-by-side, but on different IPs: Binding Apache to a Specific Or Secondary IP Address
Apache Service Names
WampDeveloper Pro uses the following Apache Service names:
- WampDeveloper v5: “Apache2″ (it is the same for all Apache versions – 2.4, 2.2, 2.0)
- WampDeveloper v4: “Apache2.2″ (only Apache 2.2 is provided)
Default Apache Service Names:
- Apache 2.4: “Apache2.4″
- Apache 2.2: “Apache2.2″
- Apache 2.0: “Apache2″
Apache Configuration Issues
Otherwise, the issue is most likely a configuration problem (syntax issue), and running a syntax check will let you know which configuration files and lines are incorrect.
httpd -t -n "Apache2"
Note that only the first encountered issue is reported, and once corrected, there could be more issues shown.
Apache Running Issues
If Apache starts, but after some time stops responding to requests (e.g., does not properly load websites and serve pages), there is most likely an issue with the OS’s networking layer.
Disable Use Of Advanced Networking Functions
On some systems the networking layer is slightly broken due to 3rd-party software that manipulates it and/or attaches filters to it.
[Tue Oct 01 19:22:29 2013] [warn] (OS 995)The I/O operation has been aborted because of either a thread exit or an application request. winnt_accept: Asynchronous AcceptEx failed.
Edit file –
Disable Apache’s use of Windows’ more advanced (faster) networking functions –
EnableMMAP off EnableSendfile off Win32DisableAcceptEx
If you are using Apache 2.4, instead of Win32DisableAcceptEx (which is only for Apache 2.0/2.2), use this –
AcceptFilter http none AcceptFilter https none
Save file. Attempt to start Apache.
If this does not help, remove the changes made – as the above directives can cause their own problems later on.
Reset Networking Layer to Default State
Attempt to fix Winsock and the TCP/IP stack by reseting them. This will remove all the 3rd-party filters registered with it (from network, firewall, proxy, and anti-virus software installs).
From the command line run this and then reboot.
netsh winsock reset netsh int ip reset c:\resetlog.txt
(*run from an admin level command-line; right-click cmd.exe, select ‘run as admin’)
You can see a current list of attached filters (LSPs) with this command –
netsh winsock show catalog
Required Microsoft VC++ Redistributable Packages
If Apache is not able to install or start and there are no displayed (nor logged) errors, or a Messagebox about a missing MSVCR90.dll or MSVCR110.dll file pops-up, Windows is missing the required Microsoft VC++ runtime DLLs.
For Apache 2.4 compiled under VS.NET 2012 (VC11) download and install Visual C++ Redistributable for Visual Studio 2012 Update 4.
For Apache 2.2 compiled under VS.NET 2008 (VC9) download and install Microsoft Visual C++ 2008 Service Pack 1 Redistributable Package.