Re: Conditionally process directives based on environment variable values in Apache conf?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux