Ben's Pro Tips

Tech Tips Made Easy

April 12, 2014 Apache Tips, Linux Server Tips

Apache 2 error: Invalid Mutex directory in argument file:${APACHE_LOCK_DIR}

Had this one crop up today when debugging an apache config problem. In a moment of non-clarity (ok, stupidity) I tried running apache2 directly hoping to see the error preventing the service from restarting. The common cause of this error is attempting to launch the apache2 daemon directly from the command line.

The fix is simple: always use init scripts to launch Apache. Some daemons can be launched directly from the commandline, for example memcached and mysqld. Apache isn’t that way. Launching from the commandline won’t set the requisite env variables causing odd messages like the one in the post title.

If you’re troubleshooting an error in your config file, the error message will be in your /etc/log/apache2/error.log (or equivalent)

Also, as a bonus tip, don’t forget your good friend in config file debugging:

apachectl configtest

Leave a comment

Time limit is exhausted. Please reload the CAPTCHA.