0

我试图让 Apache 在我的优胜美地机器上运行,但是当我尝试访问 localhost 时,我得到http://i.stack.imgur.com/ZzZzB.png

我运行了一个 apache configtest 并得到了以下信息

Angus-Mac:mysql root# apachectl configtest AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using Angus-Mac.local. Set the 'ServerName' directive globally to suppress this message Syntax OK

我怎么了?有任何想法吗?

4

2 回答 2

1

取消注释ServerName并将其更改为域名解决了该问题。

于 2014-12-08T04:05:49.880 回答
1

将该文件夹的组权限更改为 _www

sudo chgrp -R _www /Library/WebServer/Documents (all web content is now group _www)
chmod -R go-rwx /Library/WebServer/Documents (nobody other than owner can access web content)
chmod -R g+rx /Library/WebServer/Documents (all web content is now readable/executable/enterable by _www)

然后重新启动 apache 似乎您在 httpd.conf 中的用户与 web 目录中的用户不同

我在这里找到了解决方案

请取消注释第 212 行 (httpd.conf) 中的 ServerName 并将域 www.example.com 更改为您的域。重启阿帕奇

于 2014-12-04T20:37:22.077 回答