我将服务器从Debian 7升级到了Debian 8.结果,我在Apache 2.4.10上遇到了很多问题
在做:
apache2 -S
结果:
AH00111: Config variable ${APACHE_LOCK_DIR} is not defined AH00111: Config variable ${APACHE_PID_FILE} is not defined AH00111: Config variable ${APACHE_RUN_USER} is not defined AH00111: Config variable ${APACHE_RUN_GROUP} is not defined AH00111: Config variable ${APACHE_LOG_DIR} is not defined AH00526: Syntax error on line 74 of /etc/apache2/apache2.conf: Invalid Mutex directory in argument file:${APACHE_LOCK_DIR}
envvars的内容
export APACHE_RUN_USER=www-data export APACHE_RUN_GROUP=www-data export APACHE_PID_FILE=/var/run/apache2/apache2$SUFFIX.pid export APACHE_RUN_DIR=/var/run/apache2$SUFFIX export APACHE_LOCK_DIR=/var/lock/apache2$SUFFIX export APACHE_LOG_DIR=/var/log/apache2$SUFFIX
这是默认的,所以我不知道为什么它不工作。
到目前为止,我只find了矛盾的解决办法,这些办法都没有帮助,或者我不明白。
然而,Apache正在运行,但显然是垃圾邮件的错误日志。 我非常困惑,我高兴地等待着因为问这样一个愚蠢的问题而被低估。
您没有正确使用apache2 ,请参阅手册页 :
In general, apache2 should not be invoked directly, but rather should be invoked via /etc/init.d/apache2 or apache2ctl. The default Debian configuration requires environment variables that are defined in /etc/apache2/envvars and are not available if apache2 is started directly. However, apache2ctl can be used to pass arbitrary arguments to apache2.