Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 63815 invoked from network); 20 Oct 2010 13:31:24 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 20 Oct 2010 13:31:24 -0000 Received: (qmail 48505 invoked by uid 500); 20 Oct 2010 13:31:20 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 48446 invoked by uid 500); 20 Oct 2010 13:31:17 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 48438 invoked by uid 99); 20 Oct 2010 13:31:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Oct 2010 13:31:17 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [192.93.158.29] (HELO thsbbfxrt02p.thalesgroup.com) (192.93.158.29) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Oct 2010 13:31:10 +0000 Received: from thsbbfxrt02p.thalesgroup.com (localhost.localdomain [127.0.0.1]) by localhost (Postfix) with SMTP id 9286F37A35A for ; Wed, 20 Oct 2010 15:30:49 +0200 (CEST) Message-ID: <15410_1287581449_4CBEEF09_15410_85385_1_4CBEEEEE.8020606@thalesgroup.com> Date: Wed, 20 Oct 2010 15:30:22 +0200 From: "David (Dave) Donnan" User-Agent: Thunderbird 2.0.0.14-milimail0.2.1.000889 (Windows/20080728) MIME-Version: 1.0 To: users@httpd.apache.org References: <4CBEE545.1030400@unil.ch> In-Reply-To: <4CBEE545.1030400@unil.ch> Content-Type: multipart/alternative; boundary="------------040300050402020109090600" X-Virus-Checked: Checked by ClamAV on apache.org Subject: Re: [users@httpd] Re-use of a Setenv directive --------------040300050402020109090600 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable S=E9bastien, hello. I don't have a solution for you but I'm waiting for a= =20 similar reply. I hope the following helps: From my e-mail thread entitled, 'Setting CGI environment variables,=20 dynamically, from httpd.conf leveraging exising variables': ... 2. Technique 2: setenv DAVESETENV "text" > ---------------------------------------------- > > Result: DAVESETENV=3D"text" > > But, I've read that this is only a static string. > > http://www.usenet-forums.com/apache-web-server/10179-setenv-dynamic-var= iable.html Eric Covenor replied: setenvif is a bit more flexible: http://httpd.apache.org/docs/current/mod/mod_setenvif.html#setenv= if =3D=3D> So I reckon you should look at setenvif, rather. ---------- >From my Email entitled, 'RewriteRule .* - [E=3DTEMP_SMUSER:%{SSL:OID("2.5= .29.17")}] # Subject Alternate Name': ... Question 2: Also, I've never gotten SetEnvIf to work, for example: SetEnvIf "LA-U:REMOTE_PORT" "(.*)" =20 A_SETENVIF_LA_U_REMOTE_PORT=3D$1 SetEnvIf ${LA-U:REMOTE_PORT} "(.*)" =20 A_SETENVIF_LA_U_REMOTE_PORT_PERCENT=3D$1 SetEnvIf "LA-F:REMOTE_PORT" "(.*)" =20 A_SETENVIF_LA_F_REMOTE_PORT=3D$1 SetEnvIf ${LA-F:REMOTE_PORT} "(.*)" =20 A_SETENVIF_LA_F_REMOTE_PORT_PERCENT=3D$1 SetEnvIf "ENV:REMOTE_PORT" "(.*)" =20 A_SETENVIF_ENV_REMOTE_PORT=3D$1 SetEnvIf ${ENV:REMOTE_PORT} "(.*)" =20 A_SETENVIF_ENV_REMOTE_PORT_PERCENT=3D$1 SetEnvIf "SSL:REMOTE_PORT" "(.*)" =20 A_SETENVIF_SSL_REMOTE_PORT=3D$1 SetEnvIf ${SSL:REMOTE_PORT} "(.*)" =20 A_SETENVIF_SSL_REMOTE_PORT_PERCENT=3D$1 SetenvIf %{OID("0.9.2342.19200300.100.1.1")} "(.*)" =20 A_SETENVIF_OIDTEST_WITH_PERCENT=3D3D$1 SetenvIf OID("0.9.2342.19200300.100.1.1") "(.*)" =20 A_SETENVIF_OIDTEST=3D3D$1 Result: A_SETENVIF_ENV_REMOTE_PORT=3D"" A_SETENVIF_ENV_REMOTE_PORT_PERCENT=3D"" A_SETENVIF_LA_F_REMOTE_PORT=3D"" A_SETENVIF_LA_F_REMOTE_PORT_PERCENT=3D"" A_SETENVIF_LA_U_REMOTE_PORT=3D"" A_SETENVIF_LA_U_REMOTE_PORT_PERCENT=3D"" A_SETENVIF_OIDTEST=3D"3D" A_SETENVIF_OIDTEST_WITH_PERCENT=3D"3D" A_SETENVIF_SSL_REMOTE_PORT=3D"" =20 If I receive an answer I'll let you know. Cdlt, Dave ----- S=E9bastien Moretti wrote: > Hi > > I have defined a SetEnv Directive this way: > SetEnv BASE_PATH /tmp/smthg > > I would like to re-use this variable in another SetEnv Directive, e.g.: > SetEnv PATHS $BASE_PATH/a:$BASE_PATH/b:$BASE_PATH/c:... > > > But $BASE_PATH is not interpreted as a variable. > I tried with quotes, back-splash, ... > > > How can I re-use this variable in another SetEnv Directive ? > Thanks > > > > > Apache 2.2.3, Linux kernel 2.6.18, x86_64 > --------------040300050402020109090600 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sébastien, hello. I don't have a solution for you but I'm waiting for a similar reply.

I hope the following helps:

>From my e-mail thread entitled, 'Setting CGI environment variables, dynamically, from httpd.conf leveraging exising variables':
...
2. Technique 2: setenv DAVESETENV "text"
> ----------------------------------------------
>
>     Result: DAVESETENV="text"
>
> But, I've read that this is only a static string.
>
> http://www.usenet-forums.com/apache-web-server/10179-setenv-dynamic-variable.html
Eric Covenor replied:
setenvif is a bit more flexible:
http://httpd.apache.org/docs/current/mod/mod_setenvif.html#setenvif
==> So I reckon you should look at setenvif, rather.

----------

>From my Email entitled, 'RewriteRule .* - [E=TEMP_SMUSER:%{SSL:OID("2.5.29.17")}]  # Subject Alternate Name':

...

Question 2: Also, I've never gotten SetEnvIf to work, for example:
SetEnvIf "LA-U:REMOTE_PORT"               "(.*)"            A_SETENVIF_LA_U_REMOTE_PORT=$1
SetEnvIf ${LA-U:REMOTE_PORT}               "(.*)"            A_SETENVIF_LA_U_REMOTE_PORT_PERCENT=$1

SetEnvIf "LA-F:REMOTE_PORT"               "(.*)"            A_SETENVIF_LA_F_REMOTE_PORT=$1
SetEnvIf ${LA-F:REMOTE_PORT}               "(.*)"            A_SETENVIF_LA_F_REMOTE_PORT_PERCENT=$1

SetEnvIf "ENV:REMOTE_PORT"               "(.*)"            A_SETENVIF_ENV_REMOTE_PORT=$1
SetEnvIf ${ENV:REMOTE_PORT}               "(.*)"            A_SETENVIF_ENV_REMOTE_PORT_PERCENT=$1

SetEnvIf "SSL:REMOTE_PORT"               "(.*)"            A_SETENVIF_SSL_REMOTE_PORT=$1
SetEnvIf ${SSL:REMOTE_PORT}               "(.*)"            A_SETENVIF_SSL_REMOTE_PORT_PERCENT=$1

SetenvIf %{OID("0.9.2342.19200300.100.1.1")} "(.*)"            A_SETENVIF_OIDTEST_WITH_PERCENT=3D$1
SetenvIf OID("0.9.2342.19200300.100.1.1") "(.*)"            A_SETENVIF_OIDTEST=3D$1
Result:
A_SETENVIF_ENV_REMOTE_PORT=""
A_SETENVIF_ENV_REMOTE_PORT_PERCENT=""
A_SETENVIF_LA_F_REMOTE_PORT=""
A_SETENVIF_LA_F_REMOTE_PORT_PERCENT=""
A_SETENVIF_LA_U_REMOTE_PORT=""
A_SETENVIF_LA_U_REMOTE_PORT_PERCENT=""
A_SETENVIF_OIDTEST="3D"
A_SETENVIF_OIDTEST_WITH_PERCENT="3D"
A_SETENVIF_SSL_REMOTE_PORT=""
  

If I receive an answer I'll let you know.

Cdlt, Dave
-----
Sébastien Moretti wrote:
Hi

I have defined a SetEnv Directive this way:
    SetEnv BASE_PATH /tmp/smthg

I would like to re-use this variable in another SetEnv Directive, e.g.:
    SetEnv PATHS $BASE_PATH/a:$BASE_PATH/b:$BASE_PATH/c:...


But $BASE_PATH is not interpreted as a variable.
I tried with quotes, back-splash, ...


How can I re-use this variable in another SetEnv Directive ?
Thanks




Apache 2.2.3, Linux kernel 2.6.18, x86_64


--------------040300050402020109090600--