apache: fixing ‘config variable XX is not defined’ error
PROBLEM:
You try to execute from a shell some apache command like this:
# apache2 -t -D DUMP_MODULES
and you get the following error messages:
[Sun Nov 01 21:21:22.767389 2015] [core:warn] [pid 2923] AH00111: Config variable ${APACHE_LOCK_DIR} is not defined [Sun Nov 01 21:21:22.767698 2015] [core:warn] [pid 2923] AH00111: Config variable ${APACHE_PID_FILE} is not defined [Sun Nov 01 21:21:22.767936 2015] [core:warn] [pid 2923] AH00111: Config variable ${APACHE_RUN_USER} is not defined [Sun Nov 01 21:21:22.768226 2015] [core:warn] [pid 2923] AH00111: Config variable ${APACHE_RUN_GROUP} is not defined [Sun Nov 01 21:21:22.768530 2015] [core:warn] [pid 2923] AH00111: Config variable ${APACHE_LOG_DIR} is not defined [Sun Nov 01 21:21:22.770286 2015] [core:warn] [pid 2923:tid 139821306185600] AH00111: Config variable ${APACHE_LOG_DIR} is not defined [Sun Nov 01 21:21:22.770573 2015] [core:warn] [pid 2923:tid 139821306185600] AH00111: Config variable ${APACHE_LOG_DIR} is not defined [Sun Nov 01 21:21:22.770772 2015] [core:warn] [pid 2923:tid 139821306185600] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
CAUSE:
The user in your linux server does not have the apache2 environment variables properly set
SOLUTION:
Before executing any apache command, run this:
# source /etc/apache2/envvars
after this, all your apache commands will run successfully:
# apache2 -t -D DUMP_MODULES Loaded Modules: core_module (static) so_module (static) watchdog_module (static) http_module (static) log_config_module (static) logio_module (static) version_module (static) unixd_module (static) access_compat_module (shared) alias_module (shared) auth_basic_module (shared) authn_core_module (shared) authn_file_module (shared) authz_core_module (shared) authz_host_module (shared) authz_user_module (shared) autoindex_module (shared) deflate_module (shared) dir_module (shared) env_module (shared) filter_module (shared) mime_module (shared) mpm_event_module (shared) negotiation_module (shared) setenvif_module (shared) socache_shmcb_module (shared) ssl_module (shared) status_module (shared)
Leave a Reply