2014-12-04 112 views
0

我想讓Apache在我的優勝美地機器上運行,但是當我嘗試訪問本地主機時,我得到了http://i.stack.imgur.com/ZzZzB.pngApache設置mac os優勝美地

我跑了一個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

什麼我收到錯了嗎?有任何想法嗎?

+0

你可以發佈你的httpd.conf和/ etc/hosts文件嗎? – liorsolomon 2014-12-04 19:30:27

+0

http://pastebin.com/vpCi1ugs - httpd.conf http://pastebin.com/k2ZUuqx1 - hosts – Angus 2014-12-04 19:33:23

+0

也請粘貼您在目錄中的權限? ls -l/Library/WebServer/Documents。並粘貼error_log。謝謝! – liorsolomon 2014-12-04 19:50:29

回答

1

取消ServerName的註釋並將其更改爲域名解決了問題。

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

+0

它說沒有這樣的填充目錄 – Angus 2014-12-04 21:14:23

+0

請用目錄路徑重新運行它。 – liorsolomon 2014-12-04 21:19:31

+0

現在它說Safari瀏覽器不能連接到本地主機,它回到禁止 – Angus 2014-12-04 21:26:25