【发布时间】:2016-03-21 22:48:33
【问题描述】:
在我的 MacBook Pro mid2009 更新到 MacOS X El Capitan 之后,我发现很多东西不再像以前那样工作了。 内置 apache2 在 http://127.0.0.1 上不可用,但在 http://localhost 上可用。在优胜美地,他们俩都正常工作。
/private/etc/hosts 看起来像这样:
##
# 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
看起来很奇怪,因为 127.0.0.1 和 localhost 是同一个东西。 知道发生了什么吗?
httpd.conf
#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 80
【问题讨论】:
-
看来
httpd绑定到::1而not127.0.0.1。当您使用 localhost 时,您通过 IPv6 地址进行连接,请edit 将您的问题添加到您的 apache 配置中,以及可能在 statup / binding 上生成的任何错误日志输出。跨度> -
httpd.conf 已添加。
标签: macos apache apache2 localhost