0

I upgraded the server from Debian 7 to Debian 8. As a result I have multiple issues with Apache 2.4.10

When doing:

apache2 -S

The result:

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}

The content of 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

This is the default, so I do not know why it is not working.

So far I have only found contradictory solutions, which by the way all did not help or I did not understand.

Apache is however running but obviously spamming it's error log. I am very much confused and I cheerfully await for being downvoted for asking such a stupid question.

kghbln
  • 411
  • 2
  • 10
  • 20
  • 1
    Man page [apache2](http://manpages.debian.org/cgi-bin/man.cgi?query=apache2&apropos=0&sektion=0&manpath=Debian+4.0+etch&format=html&locale=en): _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`._ – Federico Sierra Apr 11 '16 at 17:34

1 Answers1

3

You're not using apache2 correctly, see man page:

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.
Federico Sierra
  • 3,589
  • 1
  • 20
  • 26
  • Oops, that's a bit confusing for me since I have been told and also read on mailing lists that apache2 should imperatively handled with the service command. Hmmm... Will now use apache2ctl! – kghbln Apr 11 '16 at 17:50
  • I cannot officially appreciate your answer since I have a bad reputation so thank you! Besides: The website you linked is down but this should not worry me now. – kghbln Apr 11 '16 at 17:56
  • @kghbln You are right, seems manpages.debian.org down – Federico Sierra Apr 11 '16 at 18:11
  • @Frederico_Sierra No worries, will look at them as soon as it is up again. – kghbln Apr 11 '16 at 18:13