httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Querna <>
Subject Re: Environment confusion
Date Mon, 20 Oct 2008 17:56:14 GMT
Graham Leggett wrote:
> Hi all,
> I have just been picking apart the way that environment variables are 
> handled at config time within httpd, and there seems to be some 
> overloading on concepts that has caused some confusion.
> There are two environments within httpd, the first is the read only 
> system environment that is read using getenv(), the second is the 
> server->vars table that is read/write using mod_env and friends.
> A recent addition was made (it's on trunk and 2.2) that allows httpd to 
> include system variables in config directives, like this:
> DocumentRoot ${DOCUMENT_ROOT}
> The system environment variable DOCUMENT_ROOT is parsed and placed in 
> the config line, so far so good.

Actually the feature is just undocumented, and has existed since 2.0 
(maybe 1.3 too?)

> What isn't possible however, is this:
> SetEnv WEBAPP app1
> <Location /${WEBAPP}>
>   ServerAdmin ${WEBAPP}
>   ... other cool template style stuff ...
> </Location>
> In this case, SetEnv sets a variable within mod_env's server->vars, but 
> this is ignored by ap_resolve_env, and so doesn't work as the user might 
> expect it to.

-0, I would prefer to use a 'real' template language for configs, rather 
than continuing to expand our current hacks upon hacks.


View raw message