'connection failure with localhost server

after installing apache in my pc I cannot visit http://localhost. firefox shows that : Firefox can't establish a connection to the server at localhost. what is the problem? can anyone help



Solution 1:[1]

This has nothing to do with your webserver.

Check http://kb.mozillazine.org/Error_loading_any_website .

There are many things that could go wrong in this case. My best bet is to check your proxy or firewall settings.

UPDATE:

Antivirus programs interfere with firewall and security settings, so you might take a look into that... Make sure the port that Apache is running is not blocked by your firewall. Go to the firewall settings and make sure that Apache (or HTTP port number used by Apache) is not blocked

Solution 2:[2]

In windows if you installed apache you have to start your apache service first then go throw your Firefox or other browser simply type local host then you can access your server.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Dharmendra Deshmukh