升级到macOS Sierra后,Apache无法启动/停止/重启。

4

升级到macOS Sierra后,Apache无法启动/停止/重启。

错误信息:

AH00557: httpd: apr_sockaddr_info_get() failed for MacBook-Pro-N.local
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message

我尝试使用Homebrew重新安装Apache24,但是未能解决我的问题。我还配置了httpd.conf文件,取消注释了ServerName localhost,但是这并没有帮助解决问题。
请帮忙看看。
2个回答

1
尝试将127.0.0.1 MacBook-Pro-N.local添加到您的/etc/hosts文件中。

0
另一个解决方案是将ServerName更改为localhost
因此,首先您需要通过以下方式找到httpd.conf Apache配置文件的位置:
apachectl -t -D DUMP_INCLUDES

然后编辑它并取消注释或更改带有ServerName的行(确保它具有有效的服务器名称或存在于您的/etc/hosts文件中)。例如。

ServerName localhost

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接