Ubuntu Apache2 DefaultRuntimeDir must be a valid directory, absolute or relative to ServerRoot

The command

source /etc/apache2/envvars

sorted my problem out (after trying ALL the others).

To check whether all is well or not use the command

apache2 -S

I found that was quicker than using my DNS records.


There is a missing update in "man apache2", at least for option -V;

Today, one should use either "apachectl" or "apache2ctl" instead of

"apache2" for at least some options, as stated in

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=879571


Apache2 uses /etc/apache2/envvars to set environment variables. You can use this information to make sure the directory ${APACHE_RUN_DIR} points to is valid.

I was experiencing the same issue while upgrading from 14.04 to 17.04. Problem was: ${APACHE_RUN_DIR} was set to /var/run/apache2, but the apache2 folder was missing in /var/run.

The fix for me was: mkdir /var/run/apache2


in my case it was regarding "Require all denied" line in apache2.conf file which (again) in my case was typed in as just "Require denied"