[CentOS] apache env vars - best practices

aurfalien at gmail.com aurfalien at gmail.com
Mon Oct 19 19:16:27 UTC 2009


Hi Les,

What I mean is that if I use the Apache directive;

SetEnv BATCHPATH /foo

It works.

If I set;

SetEnv BATCHPATH /foo:/bar

Apache errors with a syntax that SetEnv takes 2 args only, a key and a  
value.

I need multiple values for 1 key, as one would see in a standard mix  
env.

Any ideas?

On Oct 19, 2009, at 11:11 AM, Les Mikesell wrote:

> aurfalien at gmail.com wrote:
>> I've been setting custom env vars for Apache 1 of 2 ways;
>>
>> 1 - Changing the passwd file so Apache has a shell and loading a
>> custom .bashrc file.
>>
>> 2 - Using the SetEnv directive in my httpd.conf file.
>>
>> I'm crazy about neither one as they both have limitations;
>>
>> 1 - I don't like giving Apache its own shell.
>>
>> 2 - The SetEnv directive only takes 2 args so if I have a var with
>> multiple values like a path, it won't work.
>>
>> What's the cleanest way to set complex env vars for Apache?
>
> I'm not aware of any exceptions to environment variables being single
> key/value strings.  The value of a path is a single string as far as  
> the
> environment mechanism goes, even if the code that evaluates it  
> splits on
> :'s by convention.  I don't think there is such a thing as a complex  
> env
> var.
>
> -- 
>   Les Mikesell
>    lesmikesell at gmail.com
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos



More information about the CentOS mailing list