参数文件中的无效Mutex目录:$ {APACHE_LOCK_DIR}


25

大家好,干净安装ubuntu 16.04和Taskel灯apache2后,每个人都收到此错误:

[Mon Jul 18 22:42:00.114578 2016] [core:warn] [pid 4654] AH00111: Config variable ${APACHE_LOCK_DIR} is not defined
[Mon Jul 18 22:42:00.114623 2016] [core:warn] [pid 4654] AH00111: Config variable ${APACHE_PID_FILE} is not defined
[Mon Jul 18 22:42:00.114641 2016] [core:warn] [pid 4654] AH00111: Config variable ${APACHE_RUN_USER} is not defined
[Mon Jul 18 22:42:00.114645 2016] [core:warn] [pid 4654] AH00111: Config variable ${APACHE_RUN_GROUP} is not defined
[Mon Jul 18 22:42:00.114657 2016] [core:warn] [pid 4654] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Mon Jul 18 22:42:00.133748 2016] [core:warn] [pid 4654] 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}

2
OP,请查看以下答案。我推荐一个@EnterUserNameHere。它为我工作。
奥利弗·威廉姆斯

Answers:


19

看起来您尝试通过运行以下命令来启动Apache

apache2

那不行 使用

sudo service apache2 start

代替。


18

我碰到过一次,这对我有用:

source /etc/apache2/envvars 
apache2 -V
sudo service apache2 restart

从那以后我再也没有问题了。


考虑这样的行export APACHE_LOCK_DIR=/var/lock/apache2$SUFFIX是完全有意义的envvars文件中的行:)如果grep您的apache配置不同,则不能为该var字符串做a 。
奥利弗·威廉姆斯

apache2 -V给我关于配置错误的虚拟主机的错误。使用禁用该虚拟主机后,一切正常a2dissite site.local
Sadee '17

8

正确答案很简单,但并不明显。

apache2Ubuntu / Debian中的服务在/etc/apache2/envvars启动时通过apache2ctl restart或使用环境文件service apache2 restart

为了成功显示apache2 -V详细信息,只需提供apache2环境文件即可:

# source /etc/apache2/envvars
# apache2 -V

apache2.conf不应有任何语法错误,因为第74行中显示的环境变量由apache2在启动期间自动提供。

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.