1

我在山狮 10.8.3 中一直面临这个问题,但我似乎找不到答案。问题是我可以使用username.localorhttp://127.0.0.1/但不能通过localhost. 我正在使用 apache 2.2 和 virtualhostx,现在很好,因为我将每个虚拟主机映射到一个文件夹,但是在 java 中开发时,使用 Tomcat,我无法访问 localhost,我也必须访问username.local..

我的主机文件

127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost 
fe80::1%lo0     localhost

如果我找不到解决方案,我只能考虑重新安装.. 这会很烦人..

4

1 回答 1

1

check your httpd.conf for this line

# Virtual hosts

Include /private/etc/apache2/extra/httpd-vhosts.conf

i had the same issue. Then i discovered that the httod-vhosts.conf file was commented out when i upgraded my OS.

于 2013-11-21T16:58:03.620 回答