You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Johann Hanne <jh...@gmx.net> on 2007/08/03 13:36:24 UTC
[patch] [rfc] mod_jk: Use Apache's REMOTE_USER variable for ajp
Hi,
I currently have the following requirement:
- "Include" a JSP script within a PHP script
- Let PHP do the authentication
My first try was to use mod_jk, PHP's virtual() command (which triggers Apache
subrequests) and Apache authentication (although I actually need to let PHP
do the authentication).
This worked with the following problems:
- I had to configure "AuthType Basic" twice: Once for the directory where the
PHP script resides (using .htaccess) and once for the virtual path controlled
with JkMount (using <Location> in a global configuration file which only adds
bloat to it)
- Apache authentication is not what I wanted and I could not control the
username which is passed to tomcat within the PHP script
The attached patch modifies mod_jk in order to use the "REMOTE_USER"
environment variable instead of the "user" field in the request structure.
This improves two things:
- Configuring "AuthType Basic" for the JkMount path is no longer required,
i.e. it's sufficient to configure authentication for the PHP script
- The username passed to tomcat can be modified in the PHP script
using 'apache_setenv("REMOTE_USER", "fakeduser");' before the virtual() call
Comments, please?
Cheers, Johann