in /etc/init.d/apache2 you have start() { checkconfig || return 1 ebegin "Starting apache2" [ -f /var/log/apache2/ssl_scache ] && rm /var/log/apache2/ssl_scache [ -f /usr/lib/apache2/build/envvars ] && . /usr/lib/apache2/build/envvars ${APACHE2} ${APACHE2_OPTS} -k start eend $? } even if /usr/lib/apache2/build/envvars is sourced it is not included in the apache envirionmentas checkconfig has already cleaned up the env for apache
Use the KEEPENV settings to keep an environment variable. If you need to set one, add it to /etc/conf.d/apache2. The line including envvars shouldn't be there and has been removed as of apache 2.0.58.