How do I fix apache2 so that it starts with its environment variables?My system is Linux Mint 17.I installed Apache2 with this command:sudo apt-get install php5 libapache2-mod-php5Testing with a web browser worked correctly.The problem is that this command says that there is an issue/usr/sbin/apache2 -V...AH00526: Syntax error on line 74 of /etc/apache2/apache2.conf: Invalid Mutex directory in argument file:${APACHE_LOCK_DIR}If I run these commands,(from su -)source /etc/apache2/envvarsservice apache2 stopservice apache2 start/usr/sbin/apache2 -Vthe output looks OK (except for FQDN not determined).The problem is fixed.When I reboot the system, apache starts up but does not have the envvars.How do I fix this so that apache starts with its envvars?Here is my /etc/init.d/apache2:#!/bin/sh### BEGIN INIT INFO# Provides:          apache2# Required-Start:    $local_fs $remote_fs $network $syslog $named# Required-Stop:     $local_fs $remote_fs $network $syslog $named# Default-Start:     2 3 4 5# Default-Stop:      0 1 6# X-Interactive:     true# Short-Description: Start/stop apache2 web server# Description:       Start the web server and associated helpers#  This script will start apache2, and possibly all associated instances.#  Moreover, it will set-up temporary directories and helper tools such as#  htcacheclean when required by the configuration.### END INIT INFODESC=web serverNAME=apache2DAEMON=/usr/sbin/$NAMESCRIPTNAME=${0##*/}SCRIPTNAME=${SCRIPTNAME##[KS][0-9][0-9]}if [ -n $APACHE_CONFDIR ] ; then    if [ ${APACHE_CONFDIR##/etc/apache2-} != ${APACHE_CONFDIR} ] ; then            DIR_SUFFIX=${APACHE_CONFDIR##/etc/apache2-}    else            DIR_SUFFIX=    fielif [ ${SCRIPTNAME##apache2-} != $SCRIPTNAME ] ; then    DIR_SUFFIX=-${SCRIPTNAME##apache2-}    APACHE_CONFDIR=/etc/apache2$DIR_SUFFIXelse    DIR_SUFFIX=    APACHE_CONFDIR=/etc/apache2fiif [ -z $APACHE_ENVVARS ] ; then    APACHE_ENVVARS=$APACHE_CONFDIR/envvarsfiexport APACHE_CONFDIR APACHE_ENVVARSENV=env -i LANG=C PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/binif [ $APACHE_CONFDIR != /etc/apache2 ] ; then    ENV=$ENV APACHE_CONFDIR=$APACHE_CONFDIRfiif [ $APACHE_ENVVARS != $APACHE_CONFDIR/envvars ] ; then    ENV=$ENV APACHE_ENVVARS=$APACHE_ENVVARSfi#edit /etc/default/apache2 to change this.HTCACHECLEAN_RUN=autoHTCACHECLEAN_MODE=daemonHTCACHECLEAN_SIZE=300MHTCACHECLEAN_DAEMON_INTERVAL=120HTCACHECLEAN_PATH=/var/cache/apache2$DIR_SUFFIX/mod_cache_diskHTCACHECLEAN_OPTIONS=# Read configuration variable file if it is presentif [ -f /etc/default/apache2$DIR_SUFFIX ] ; then    . /etc/default/apache2$DIR_SUFFIXelif [ -f /etc/default/apache2 ] ; then    . /etc/default/apache2fiPIDFILE=$(. $APACHE_ENVVARS && echo $APACHE_PID_FILE)VERBOSE=noif [ -f /etc/default/rcS ]; then    . /etc/default/rcSfi. /lib/lsb/init-functions# Now, set defaults:APACHE2CTL=$ENV apache2ctlHTCACHECLEAN=$ENV htcachecleanPIDFILE=$(. $APACHE_ENVVARS && echo $APACHE_PID_FILE)APACHE2_INIT_MESSAGE=CONFTEST_OUTFILE=cleanup() {    if [ -n $CONFTEST_OUTFILE ] ; then        rm -f $CONFTEST_OUTFILE    fi}trap cleanup 0  # 0 means EXIT, but EXIT is not portableapache_conftest() {    [ -z $CONFTEST_OUTFILE ] || rm -f $CONFTEST_OUTFILE    CONFTEST_OUTFILE=$(mktemp)    if ! $APACHE2CTL configtest > $CONFTEST_OUTFILE 2>&1 ; then        return 1    else        rm -f $CONFTEST_OUTFILE        CONFTEST_OUTFILE=        return 0    fi}
Apache2 Evironment Variables Missing at boot up
linux mint;apache httpd