我正试图弄清楚为什么我的apache没有在启动时启动…(我希望它能启动(。
我的操作系统:OSX Mojave
我的印象:我正在运行自制软件的apache
新启动后…
如果我命中http://localhost在浏览器中我得到
Unable to connect
Firefox can’t establish a connection to the server at localhost.
启动终端…
$brew services list
返回
httpd started bigpimpin /Users/bigpimpin/Library/LaunchAgents/homebrew.mxcl.httpd.plist
php started bigpimpin /Users/bigpimpin/Library/LaunchAgents/homebrew.mxcl.php.plist
(第一行让我觉得httpd正在运行,我应该能够访问localhost(。
$which -a apachectl
返回
/usr/local/bin/apachectl
/usr/sbin/apachectl
然后
$apachectl configtest
返回
Syntax OK
然后
$sudo apachectl -V
退货(除其他外(
-D SERVER_CONFIG_FILE="/usr/local/etc/httpd/httpd.conf"
(这不是啤酒的httpd.conf吗?(
我已经运行了一个brew命令(我忘记了(,它应该在启动时运行httpd。
一旦我运行
$sudo apachectl start
一切都是杰克。因此,这是一个优先级较低的问题,但我想解决并理解这个问题。
我在使用Homebrew NGINX时遇到了同样的问题。使用sudo
运行brew services命令为我解决了这个问题
Homebrew web服务器包似乎需要sudo
启动|停止|重新启动。
尝试运行:
sudo brew services start apache2