apache2 fails when Checking Configuration

I have tried everythingto get Checking Configuration to pass but it fails all the time and even when I tell VM to NOT check the configuration it still does or its starting apache2 wrong because I do not get these errors in console.

Apache configuration errors were found :

[Wed Jun 01 10:36:45.593068 2016] [core:warn] [pid 8180] AH00111: Config variable ${APACHE_LOCK_DIR} is not defined
[Wed Jun 01 10:36:45.593120 2016] [core:warn] [pid 8180] AH00111: Config variable ${APACHE_PID_FILE} is not defined
[Wed Jun 01 10:36:45.593131 2016] [core:warn] [pid 8180] AH00111: Config variable ${APACHE_RUN_USER} is not defined
[Wed Jun 01 10:36:45.593134 2016] [core:warn] [pid 8180] AH00111: Config variable ${APACHE_RUN_GROUP} is not defined
[Wed Jun 01 10:36:45.593143 2016] [core:warn] [pid 8180] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Wed Jun 01 10:36:45.626632 2016] [core:warn] [pid 8180] AH00111: Config variable ${APACHE_LOCK_DIR} is not defined
[Wed Jun 01 10:36:45.627500 2016] [core:warn] [pid 8180] AH00111: Config variable ${APACHE_RUN_DIR} is not defined
[Wed Jun 01 10:36:45.627886 2016] [core:warn] [pid 8180] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Wed Jun 01 10:36:45.628075 2016] [core:warn] [pid 8180] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Wed Jun 01 10:36:45.628086 2016] [core:warn] [pid 8180] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
AH00526: Syntax error on line 76 of /etc/apache2/apache2.conf:
Invalid Mutex directory in argument file:${APACHE_LOCK_DIR}

Status: 
Active

Comments

Is this using Virtualmin's config check, or the apachectl configcheck command?

VM ckeck. I'm not sure what happened but I ended up having to manually fix the Apache module config to fix the missing envars setting.

Also this was on a fresh server debian Jessie.

On Debian, the apache config has some environment vars in it that are set by the init script ... which means that a regular apachectl configtest won't work.

Which Debian version is this?

On Debian/Ubuntu, using "apache2ctl configtest" should indeed work, it's been modified to handle those environment variables.

The apache2ctl file is a script, that uses /etc/apache2/envvars to populate the environment variables in the Apache config.

However, calling /usr/sbin/apache2 directly could cause the problem he described. Is it possible that "apache2 -t" is what's being used to perform the configcheck?

Debian Jessie.. I copied what I had from another server and some settings were missing or wrong.

In your /etc/webmin/apache/config file, do you have the line test_apachectl=1 ?

Also, does the apachectl_path line point to the correct path for the apachectl command?