将OSX更新为High Sierra后的Apache2问题

将OSX更新为High Sierra后的Apache2问题,apache,web,server,dns,apache2,Apache,Web,Server,Dns,Apache2,这一周来,我在Apache方面遇到了一些重大问题。升级到High Sierra后,mac上的开发环境停止工作。我自己尝试了几个小时来解决这个问题,但没有找到解决办法 服务器版本:Apache/2.4.29(Unix) 基本上,每当我尝试重新启动apache时,都会收到以下消息: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 10.0.0.50. Set t

这一周来,我在Apache方面遇到了一些重大问题。升级到High Sierra后,mac上的开发环境停止工作。我自己尝试了几个小时来解决这个问题,但没有找到解决办法

服务器版本:Apache/2.4.29(Unix)

基本上,每当我尝试重新启动apache时,都会收到以下消息:

AH00558: httpd: Could not reliably determine the server's fully 
qualified domain name, using 10.0.0.50. Set the 'ServerName' directive 
globally to suppress this message
我尝试了大量不同的方法来配置vhosts文件和httpd配置,但没有看到任何改进

文档根路径未指向我的网站以前存在的位置。在发现并将其指向正确的位置后,每次我收到的“it Works!”消息都消失了,现在我只收到一条消息,上面写着

Not Found

The requested URL / was not found on this server.
无论我为DocumentRoot部分设置了什么路径,都会出现此消息,因此我不确定真正的问题是什么

另外,我的apache设置为使用localhost,但是它仍然使用10.0.0.50作为IP选择。我以前从未见过这个IP,我对它的来源感到困惑

TLDR:在升级到High Sierra之后,我在apache上遇到了很多问题,我尝试卸载/重新安装。Apache使用10.0.0.50作为IP,DocumentRoot似乎有问题,配置似乎有问题。

检查配置:

httpd -t

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 192.168.1.79. Set the 'ServerName' directive globally to suppress this message
Syntax OK
要解决这个问题:

sudo vi /etc/apache2/httpd.conf
之前:

ServerName www.example.com:80
之后:

ServerName localhost
再次检查配置:

httpd -t

Syntax OK

在从Sierra升级到High Sierra之后,我遵循这个非常有用的指南,使我的“MAMP”环境恢复到工作状态:它指导您完成Apache配置文件所需的所有行编辑