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}

3 Answers3

27

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.

22

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

apache2

That doesn't work. Use

sudo service apache2 start

instead.

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