Apache设置了mac os yosemite

时间:2014-12-04 19:14:56

标签: apache localhost localserver

我想让Apache在我的yosemite机器上运行,但是当我尝试访问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

我错了什么?任何想法?

2 个答案:

答案 0 :(得分: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目录中的用户不同

我找到了解决方案here

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

答案 1 :(得分:1)

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