Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I just installed MAMP on Mac OSX 10.8.2.

When it is started, I'm not able to access the server through http://localhost:8888 but when I visit http://127.0.0.1:8888/ and it works fine.

Why is it so? and how can I make it work with when I type http://localhost:8888

share|improve this question
add comment

1 Answer

Open your host file /etc/hosts with a text editor and make sure it contains:

127.0.0.1    localhost

If it still doesn't work, run this command: file -b /etc/hosts and make sure the result is ASCII English text and nothing else. If it is not, use an editor such as TextWrangler or BBEdit to clean it up (use Unix end-of-line characters).

Source: Apple Support Communities

share|improve this answer
    
I used Unix end-of-line and this solved my problem. –  alexcristea Nov 22 '13 at 7:44
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.