30

hi every body after clean install of ubuntu 16.04 and tasksel lamp apache2 got this error :

[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}
1
  • 4
    OP, please review the answers below. I recommend the one by @EnterUserNameHere. It worked for me. Dec 2 '16 at 23:04
25

I ran into this once and this worked for me:

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

I haven't had the problem since.

2
  • considering lines like export APACHE_LOCK_DIR=/var/lock/apache2$SUFFIX are in that envvars file that makes total sense :) If not one could do a grep for that var string if your apache config is different. Dec 2 '16 at 23:03
  • apache2 -V gave me error on miss configured vhost. Everything work well after disabled that vhost by using a2dissite site.local .
    – Sadee
    Apr 18 '17 at 9:15
22

That looks like you tried to start Apache by running something like

apache2

That doesn't work. Use

sudo service apache2 start

instead.

9

The correct answer is quite simple yet not obvious.

The apache2 service in Ubuntu/Debian uses the environment file /etc/apache2/envvars during its startup via apache2ctl restart or service apache2 restart.

In order to successfully show apache2 -V details just source the apache2 environment file:

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

There should not be any syntax error with the apache2.conf, since the environment variables shown in line 74 are automatically sourced by apache2 during its startup.

Not the answer you're looking for? Browse other questions tagged or ask your own question.