httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From SixArm <six...@gmail.com>
Subject [users@httpd] Re: What EnvVars are available?
Date Mon, 13 Mar 2006 19:46:11 GMT
I managed to get something working.  I'm just not sure if it's the best way
to solve the problem.  I've also noticed that on some of my systems
REMOTE_PORT is blank.  Has anyone else run into this?

Here's the working config:

   RewriteEngine on
   RewriteCond %{REMOTE_ADDR} (.*)
   RewriteRule .* - [E=REMOTE_ADDR:%1]
   RewriteCond %{REMOTE_PORT} (.*)
   RewriteRule .* - [E=REMOTE_PORT:%1]
   RewriteCond %{SERVER_ADDR} (.*)
   RewriteRule .* - [E=SERVER_ADDR:%1]
   RewriteCond %{SERVER_ADDR} (.*)
   RewriteRule .* - [E=SERVER_ADDR:%1]
   RewriteCond %{SERVER_PORT} (.*)
   RewriteRule .* - [E=SERVER_PORT:%1]
   Header set ServerID testcase_1
   Header set SERVER_ADDR %{SERVER_ADDR}e
   Header set SERVER_PORT %{SERVER_PORT}e
   Header set REMOTE_ADDR %{REMOTE_ADDR}e
   Header set REMOTE_PORT %{REMOTE_PORT}e


On 3/11/06, SixArm <sixarm@gmail.com> wrote:
>
> I'm trying to add server reply headers to describe the connection to
> Apache for tesing purposes.
>
> This is on Apache/2.0.52 on RedHat EL3.
>
> <VirtualHost $ip_alias:$web_server_port>
>     DocumentRoot /doc_root
>     PassEnv SERVER_ADDR
>     PassEnv SERVER_PORT
>     PassEnv REMOTE_ADDR
>     PassEnv REMOTE_PORT
>     PassEnv PATH
>     Header set SERVER_ADDR %{SERVER_ADDR}e
>     Header set SERVER_PORT %{SERVER_PORT}e
>     Header set REMOTE_ADDR %{REMOTE_ADDR}e
>     Header set REMOTE_PORT %{REMOTE_PORT}e
>     Header set PATH %{PATH}e
> </VirtualHost>
>
>
> The Env Vars are not defined but I can insert a header for PATH.  I can
> view all these variable in a simple phpinnfo() call.  I've also written an
> Apache 1.3 module which accomplishes the same thing.  I was hoping I could
> accomplish without an additional module or php.
>
> Can anyone explain why these variable are not available?  Or how I can see
> what variables are available.  From what I've read in the Apache docs they
> should be available.
>
> Thanks for any help,
>
> -Sixarm
>

Mime
View raw message