I’d like to include one or another external httpd.conf file in my main Apache httpd.conf based on an Environment Variable that is set externally.
So I would like to do something like:
if $(DEV_ENV) == "main"
Include "first file"
if $(DEV_ENV) == "alt"
Include "second file"
I’ve been looking at the mod_setenv module but that is for setting the environment variables within the Apache configuration.
How can I use the environment variables and do comparisons on its values?
Sorry but you can’t do this sort of dynamic logic on Includes. However certainly the Debian version allows direct reference to environment variables through a substitution pattern, e.g.
Have a browse for “Apache2 envvars” to learn more.