这一周,我遇到了Apache的主要问题。我在mac上的开发环境在我更新到High Sierra后停止工作。我自己尝试了几个小时来解决这个问题,但没有找到解决方案。
服务器版本: 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配置,但没有看到任何改进。
我的网站之前所在的位置没有指向文档根路径。在找到它并将它指向正确的位置后,“它起作用了!”消息我每次都会消失,而现在我只收到一条消息:
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似乎有问题,配置似乎混乱。
发布于 2018-04-11 04:38:18
检查配置:
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 OKhttps://stackoverflow.com/questions/47441615
复制相似问题