Ryan Muldoon wrote:
I'm not able to get *any* variables out from the apache server
environment.

ok, first off, this is a two step process for Apache. the first step is that modules (like mod_ssl) populate the subprocess_env table with various values. then, modules like mod_cgi and mod_perl come along and populate %ENV with the values from subprocess_env as well as various other CGI specific variables (like DOCUMENT_ROOT or whatever else there is). the point is that you're really not after environment variables if you want to test for something like $r->subprocess_env('HTTPS') - that it ends up as $ENV{HTTPS} is a byproduct of modules like mod_cgi and mod_perl.


just for your own edification :)

As you might be able to imagine, this is extremely
frustrating, and inhibits my ability to do anything of use with
mod_perl. My basic technique has been:
        my $uri = $r->uri;
        return unless $r->is_main();
        my $subr = $r->lookup_uri($uri);
        my $apachecertcomp = $subr->subprocess_env($certcomponent);

I don't understand the need for a subrequest to the same URI - subprocess_env has nothing to do with an actual subprocess. each request (including subrequests) have their own subprocess_env table attached to $r. in many cases, modules are coded to behave differently for subrequests than for the main request, so something you may see in $r->subprocess_env() could not be in $r->lookup_uri($uri)->subprocess_env().


But this doesn't work. I also tried
my $var = $r->subprocess_env("VARIABLE_NAME");
And this does not work either. I really need to be able to use
environment variables that mod_ssl sets in my authentication handler.

a few things here too. for the reasons described above, subprocess_env() is not a substitute for %ENV, so if what you want is a true %ENV value (such as those from PerlPassEnv), you will not be able to get to it via $r->subprocess_env().


Any ideas? Thanks!

HTH


--Geoff





Reply via email to