Apache 1.3.1: inconsistency with environment variables?

Apache 1.3.1: inconsistency with environment variables?

Post by Kai Schaetz » Sat, 03 Oct 1998 04:00:00



I have set HostNameLookups off on my server (Apache 1.3.1 BSDI 3.0) and now
SSI won't print the REMOTE_HOST env var (<!--#echo var="REMOTE_HOST"-->).
This is somewhat reasonable ;-) Same for printing this variable specifically
in a CGI script.

However, if I use a Perl script which just scans thru the whole env array

       foreach $key (keys(%ENV)) {
           print "$key = $ENV{$key}<br>\n";
       }

it will print the variable and display correct content.

How is this possible?
This variable should not be available at all if I can't reference it by name.
Or not?

Kai

--

Kai Sch?tzl, Berlin, Germany
IE-Center: http://msie.conactive.com
ClubIE - Activate the Net: http://www.ClubIE.com

 
 
 

Apache 1.3.1: inconsistency with environment variables?

Post by Marc Slemk » Sat, 03 Oct 1998 04:00:00



Quote:>I have set HostNameLookups off on my server (Apache 1.3.1 BSDI 3.0) and now
>SSI won't print the REMOTE_HOST env var (<!--#echo var="REMOTE_HOST"-->).
>This is somewhat reasonable ;-) Same for printing this variable specifically
>in a CGI script.

Correct.

Quote:>However, if I use a Perl script which just scans thru the whole env array
>       foreach $key (keys(%ENV)) {
>           print "$key = $ENV{$key}<br>\n";
>       }

>it will print the variable and display correct content.

Erm.. are you _SURE_?

Are you sure there aren't any other differences between the
above perl script and everything else?  You don't have any
host based access controls, etc. on the script do you?

 
 
 

1. Why does the cgi environment not inherit environment variables?

When using apache it normally inherits the environment in which it was
started and keeps this environment for executing cgi scripts. For example:
if root has oracle environment variables such as ORACLE_SID set when
starting the server then these are normally available to cgi scripts when
they execute much like the path is. However sometimes and specifically this
time they are not. Could someone explain how this works? It seems to be
somewhat random to me. I've had situations where various instances of the
server had different paths than others.

I'm running apache 1.3.4 and apache 1.3.6 on solaris 2.7 with mod_perl 1.18
and 1.19 respectively.

Matt

2. scanner problem:

3. how to export shell environment variables to the primary environment?

4. It's so pathetic it isn't true.......

5. Dynamically setting environment variables on apache startup?

6. LINUX HELP for FTP

7. Apache 1.3.9 environment variables

8. FTP question

9. Apache: Environment variables "en masse"

10. Environment variables with Apache

11. Problem with environment variables and Apache

12. Custom environment variables in Apache?

13. Apache : LISTEN directive and SERVER_PORT environment Variable, HELP