Mac OS Server 開啓網站後,用 127.0.0.1 或 IP 訪問報錯,用域名訪問正常。查看錯誤日誌爲:web
[Tue Jan 07 19:24:44 2014] [error] ap_proxy_connect_backend disabling worker for (localhost) [Tue Jan 07 19:24:44 2014] [error] proxy: HTTP: disabled connection for (localhost) [Tue Jan 07 19:24:45 2014] [error] proxy: HTTP: disabled connection for (localhost) [Tue Jan 07 19:24:54 2014] [error] [client 10.6.128.129] File does not exist: /Users/onemade/web/li [Tue Jan 07 19:24:58 2014] [error] proxy: HTTP: disabled connection for (localhost) (61)Connection refused: proxy: HTTP: attempt to connect to [fe80::1]:20559 (localhost) failed
嘗試刪除ServerApp後重裝,無效果。發現經過ServerApp沒法真正關閉Apachctl開啓的httpd,殺掉進程後直接執行httpd正常,猜想是設置故障。遂的此方法:apache
移除設置目錄 Config 和標記文件 .ServerSetupDone,注 /Library 與 Library 爲不一樣的目錄。網絡
sudo rm -rf /Library/Server/Web/Config sudo rm /var/db/.ServerSetupDone
重啓後執行ServerApp將從新初始化,設置恢復正常。app
====================================網站
關閉IPv6的命令,執行後在 打開網絡偏好設置 > 高級 > TCP/IP 中可查看效果。spa
networksetup -setv6off Wi-Fi
查看端口占用,80爲端口號日誌
lsof -i:80
查看當前進程,其中 httpd 爲特徵字符。
code
ps Au |grep httpd
_www 30311 0.0 0.0 2473144 896 ?? S 3:25下午 0:00.00 /usr/sbin/httpd -D FOREGROUND -f /Library/Server/Web/Config/apache2/httpd_server_app.conf -D WEBSERVICE_ON
殺進程,30311爲該進程pid。server
sudo kill 30311