I have MAMP installed on my Macbook Pro (OS X 10.8.2). Both Apache Server and MySql server are in green lights in MAMP. But I could NOT access localhost; I'm able to reach 127.0.0.1. (both localhost and 127.0.0.1 were working fine before.)
leihetekiMacBook-Pro:~ leihe$ ping localhost
ping: cannot resolve localhost: Unknown host
When I tried to access localhost in safari, it shows:
Safari can't open the page "http://localhost/" because Safari can't fine the server "localhost".
In apache_error.log, it shows:
[Tue Feb 18 14:30:43 2014] [error] [client 127.0.0.1] client denied by server configuration: /Users/leihe/Desktop/Sites/.DS_Store
My hosts file is located in private/etc and looks like this:
# Host Database
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.