httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Kew <n...@webthing.com>
Subject Re: [users@httpd] Conditionally process directives based on environment variable values in Apache conf?
Date Thu, 01 Apr 2010 04:37:26 GMT

On 31 Mar 2010, at 19:16, Jeffery Martin wrote:

> For example, suppose the directive I am looking for were named
> "IfMatch".  I would want to do something like this.
> 
> <IfMatch ${MYVAR1} "production">
>    # Directives related to production.
> </IfMatch>
> 
> <IfMatch ${MYVAR1} "test">
>    # Directives related to test.
> </IfMatch>
> 
> <IfMatch ${MYVAR1} "development">
>    # Directives related to development.
> </IfMatch>

The easy/clean way to implement that would be in apachectl.
You use three <IfDefine>s, and pick the right one from your MYVAR1
within apachectl.

You can do more with <If ....>, and of course a great deal more with
a scripting language.  But that would be overkill for selecting from a
menu of pre-defined options.

-- 
Nick Kew

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message