Macports Apache httpd无法在Mac OS X Yosemite上启动


0

所以,经过2天努力想象为什么Macports Apache httpd突然决定停止工作,最后它归结为:

$ sudo bash -x /opt/local/apache2/bin/apachectl -k start
ARGV='-k start'
HTTPD=/opt/local/apache2/bin/httpd
test -f /opt/local/apache2/bin/envvars
. /opt/local/apache2/bin/envvars
test x '!=' x
DYLD_FALLBACK_LIBRARY_PATH=/opt/local/lib
export DYLD_FALLBACK_LIBRARY_PATH
LYNX='lynx -dump'
STATUSURL=http://localhost:80/server-status
ULIMIT_MAX_FILES=
'[' x '!=' x ']'
ERROR=0
'[' 'x-k start' = x ']'
case $ARGV in
/opt/local/apache2/bin/httpd -k start
ERROR=1
exit 1

这是房间里的大象,ERROR=1是什么意思?

我运行调试,我得到上面相同的错误:

$ sudo bash -x /opt/local/apache2/bin/apachectl -k start -e Debug -E /dev/stdout

本地Mac Apache没有返回错误并httpd正常启动,它给出了这个输出:

$ sudo bash -x /usr/sbin/apachectl -k start
ACMD=-k
ARGV='-k start'
HTTPD=/usr/sbin/httpd
test -f /usr/sbin/envvars
. /usr/sbin/envvars
test x '!=' x
DYLD_LIBRARY_PATH=/usr/lib
export DYLD_LIBRARY_PATH
LYNX='lynx -dump'
STATUSURL=http://localhost:80/server-status
ULIMIT_MAX_FILES=
LAUNCHCTL=/bin/launchctl
LAUNCHD_JOB=/System/Library/LaunchDaemons/org.apache.httpd.plist
'[' x '!=' x ']'
ERROR=0
'[' 'x-k start' = x ']'
case $ARGV in
/usr/sbin/httpd -k start
ERROR=0
exit 0

这可能是我最后一次对此,2天后我愿意放弃!

Answers:


1

ERROR = 1表示bash脚本将环境变量“ERROR”设置为值1。

apachectl基本上做了:

$HTTPD $ARGV
ERROR=$?

exit $ERROR

问题是/opt/local/apache2/bin/httpd -k start退出时退出代码为1.您应该弄清楚原因是什么。你说你跑了sudo /opt/local/apache2/bin/httpd -k start -e Debug -E /dev/stdout但没看错。什么是退出代码?


对不起,我的意思是,当我跑步时,sudo bash -x /opt/local/apache2/bin/apachectl -k start -e Debug -E /dev/stdout我也得到ERROR = 1并退出1
最大值

它是否可能与之相关DYLD_FALLBACK_LIBRARY_PATH,因为如果你注意到在本地Apache中运行它不会使用回退DYLD_LIBRARY_PATH
Max

1

我早些时候在MAMP上记得那个叫做unique_id_module阻止它启动的模块。所以我禁用它httpd.conf,现在Macports Apache启动没有错误。

只需将其取消注释:

#LoadModule unique_id_module modules/mod_unique_id.so
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.