我的Macbook Pro(OS X 10.8.2)上安装了MAMP。 Apache服务器和MySql服务器都在MAMP中处于绿灯状态。但我无法访问localhost;我能达到127.0.0.1。 (localhost和127.0.0.1之前的工作正常。)
leihetekiMacBook-Pro:~ leihe$ ping localhost
ping: cannot resolve localhost: Unknown host
当我尝试在safari中访问localhost时,它会显示:
Safari can't open the page "http://localhost/" because Safari can't fine the server "localhost".
在apache_error.log中,它显示:
[Tue Feb 18 14:30:43 2014] [error] [client 127.0.0.1] client denied by server configuration: /Users/leihe/Desktop/Sites/.DS_Store
我的主机文件位于private / etc中,如下所示:
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
我也尝试过刷新DNS服务器。
任何解决方案都将非常感谢!!