planteg
Posts: 13
Joined: Tue Apr 26, 2016 10:04 pm

Apache2 error about ${APACHE_RUN_DIR} not set

Tue May 07, 2019 8:32 pm

Hi,

on latest Raspbian stretch, April 2018, I got this error after installing apache2:

Code: Select all

[Tue May 07 16:07:12.221849 2019] [core:warn] [pid 1067] AH00111: Config variable ${APACHE_RUN_DIR} is not defined
apache2: Syntax error on line 80 of /etc/apache2/apache2.conf: DefaultRuntimeDir must be a valid directory, absolute or relative to ServerRoot
I get the same error when running

Code: Select all

apache2 -S
Where is that variable supposed to be defined ? I installed apache2 on previous version of Raspbian and never got that error.

Things is apache2 seems to run fine because if I enter localhost in the browser, the page is correctly displayed.

Many thanks

User avatar
DougieLawson
Posts: 36141
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Apache2 error about ${APACHE_RUN_DIR} not set

Tue May 07, 2019 10:02 pm

Use
sudo systemctl start apache2
or
sudo apachectl start
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

planteg
Posts: 13
Joined: Tue Apr 26, 2016 10:04 pm

Re: Apache2 error about ${APACHE_RUN_DIR} not set

Tue May 07, 2019 10:31 pm

Dougie,

I found out here https://bugs.debian.org/cgi-bin/bugrepo ... bug=879571 that now we must use apacthe2ctrl as you noted.

Does that mean that the installation is wrong stating that the variable is not set ? Running

Code: Select all

apache2ctrl -S
states that

Code: Select all

ServerRoot: "/etc/apache2"
Thanks

Gilles Plante

User avatar
DougieLawson
Posts: 36141
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Apache2 error about ${APACHE_RUN_DIR} not set

Tue May 07, 2019 10:46 pm

The systemd stuff sets the right environment variables on Raspbian Stretch systems.

Just use sudo systemctl start apache2.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Return to “Networking and servers”