You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by loredana loredana <lo...@yahoo.com> on 2007/10/19 10:57:29 UTC

[users@httpd] passing enviroment with PasEnv

Ok, here's something I don't understand. I've connected my apache and tomcat using mod_jk
in my httpd.conf I wrote 
SetEnv REMOTE_USER xxx
PassEnv REMOTE_USER

and then in tomcat I just wrote a file 

<% out.print (request.getAttribute("REMOTE_USER")); %> and well enough, I got xxx printed on the page

now, I installed a module for authentication in apache, wrote a small php file that prints out all the headers and I got a big list among which REMOTE_USER had the value equal to the username. But now, in tomcat, the same small file doesn't return anything even though REMOTE_USER has a value and in httpd.conf I left the PassEnv REMOTE_USER line.

So where's the catch? If I set the environment and pass it, tomcat sees it, if it's set by the authentication module and I just pass it, tomcat doesn't see it. anybody knows why?




__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] passing enviroment with PasEnv

Posted by Joshua Slive <jo...@slive.ca>.
On 10/19/07, loredana loredana <lo...@yahoo.com> wrote:
> Ok, here's something I don't understand. I've connected my apache and tomcat using mod_jk
> in my httpd.conf I wrote
> SetEnv REMOTE_USER xxx
> PassEnv REMOTE_USER
>
> and then in tomcat I just wrote a file
>
> <% out.print (request.getAttribute("REMOTE_USER")); %> and well enough, I got xxx printed on the page
>
> now, I installed a module for authentication in apache, wrote a small php file that prints out all the headers and I got a big list among which REMOTE_USER had the value equal to the username. But now, in tomcat, the same small file doesn't return anything even though REMOTE_USER has a value and in httpd.conf I left the PassEnv REMOTE_USER line.
>
> So where's the catch? If I set the environment and pass it, tomcat sees it, if it's set by the authentication module and I just pass it, tomcat doesn't see it. anybody knows why?
>

PassEnv is used to pass environment variables from the OS shell that
starts apache to apache child processes like CGI scripts.

Per-request env variables are process-local and can't be passed back
to tomcat. You should ask on a tomcat list for the standard way to
pass back auth info.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org