Kim Goldov wrote:
I'm connecting to a tomcat server from our web server using mod_jk. I'm
setting environment variables with each request in the PerlAuthenHandler and
PerlHeaderParserHandler. I'm able to read the variables in PHP, perl fcgi,
and wsgi, however they are not being passed to tomcat. Is there a way to
pass these environment variables through?
How exactly are you setting these "environment variables" before the request is proxied to
Tomcat ? And how are you trying to read these values at the Tomcat level ?
mod_jk uses the AJP protocol to communicate with Tomcat. This is not exactly the same as
HTTP and it does not really pass "environment values" in the shell sense.
Also, what is named "environment variables" at the Apache level is somewhat
ambiguous.
Most of what is called "Apache environment variables" is passed my mod_jk to Tomcat as
"request attributes", and you have to use the appropriate method in Java on the Tomcat
side to retrieve them.
In a general sense, I have found that the easiest way to pass values from Apache to Tomcat
through mod_jk, is to add a (non-standard) HTTP header to the request before it it is
forwarded, and retrieve this HTTP header in the Tomcat application.
This will work no matter how the proxying from Apache to Tomcat is done (e.g. also with
HTTP proxying).