Apache - HTTP - Errors

If all your web installation was working fine and you do not know why now nothing is working anymore, with a beautiful error such as: "Could not connect to localhost", let's try this solution.

First of all, try to stop your Apache HTTP server manually.
Left click on it on your tray icon in your taskbar:

Apache 2.2 > Stop

If nothing happens, this is because your server is still running in an infinite loop.
So do not panic and wait around one minute.
Normally the server would stop.
So restart it with left click and:

Apache 2.2 > Start

Try to refresh your webpage http://localhost/.
It might be OK!

If not, open a command line (SHIFT + right click on a directory, or Start/Research a program/write cmd/enter).

And try this:

netsh winsock reset

If necessary restart your computer.

You can also try:

netsh firewall reset

This is not Apache HTTP, but Windows that tries to connect to a bad IP.

If this solution does not work, try to change the port of your connection:

Open "C:\Program Files (x86)\Apache Software Foundation\Apache2.2\conf\httpd.conf" and change the line:

Listen 80


Listen 10080


ServerName localhost:80


ServerName localhost:10080

Now "C:\Program Files (x86)\Apache Software Foundation\Apache2.2\extra\httpd-vhosts.conf" and change the line:

NameVirtualHost *:80


NameVirtualHost *:10080

Do the same for your localhost config:

# localhost
<VirtualHost *:10080>
    ServerAdmin webmaster@dummy
    DocumentRoot "C:/site"
    ServerName localhost
    ServerAlias localhost
    ErrorLog "logs/localhost.error.log"
    CustomLog "logs/localhost-access.log" common

Save all and restart your Apache HTTP server.

Go to http://localhost:10080/ and look if it works.

I agree, this error is really annoying!

If you still encounter the problem, look at the logs/error.log file into the Apache directory, you have maybe this error:

[error] (OS 10022)An invalid argument was supplied. : Child 123457890: Encountered too many errors accepting client connections. Possible causes: dynamic address renewal, or incompatible VPN or firewall software. Try using the Win32DisableAcceptEx directive.

A solution can be found at http://support.microsoft.com/kb/811259.

Good luck!


Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.