31

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}
tal shulgin
  • 313
  • 1
  • 3
  • 4

3 Answers3

26

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.

  • 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. – Oliver Williams Dec 02 '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 09: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.

Florian Diesch
  • 86,013
  • 17
  • 224
  • 214
10

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.

dimib
  • 201
  • 2
  • 3