Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have installed Apache, and then I tried writing http://localhost/ in the browser. It's not working and saying page not found. But, http://127.0.0.1/ works.

What problem do I have, and how can I resolve it?

share|improve this question

migrated from stackoverflow.com Nov 1 '10 at 5:47

This question came from our site for professional and enthusiast programmers.

    
Have you tried with at least 2 browsers? –  irrelephant Nov 1 '10 at 4:28
    
nup and got my answer from john –  Subhransu Nov 1 '10 at 5:06
    
Glad I could help. :) –  John Nov 1 '10 at 5:21
add comment

1 Answer

up vote 6 down vote accepted

It could be that your hosts file does not map localhost to the loopback IP (127.0.0.1). On Windows, your hosts file should be at \Windows\system32\drivers\etc\hosts. On *NIX, it should be at /etc/hosts. Check those files and verify that localhost is mapped to the loopback IP. If not, add it.

Here are some resources that might help you. Take a look.

share|improve this answer
    
Thanks Wuputah. :) –  John Nov 1 '10 at 5:21
    
Note, newer versions of Windows do the localhost mapping (for both IPv4 and IPv6) in the DNS client, so the entry in hosts is correctly commented out. –  Richard Nov 1 '10 at 8:03
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.