Re: sharing data between two different apache modules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hmm. ProxyPass do not let one append a query string and what I want will not be achievable with mod_proxy.

The other way round is using mod_rewrite, but somehow I am not able to get the translation happening The below configuration is giving me error. Forum please advice
<Location /protected>
 AuthType ECOERP::EcoErpAuthLogin
 AuthName ECOERP
 PerlAuthenHandler ECOERP::EcoErpAuthLogin->authenticate
 PerlAuthzHandler ECOERP::EcoErpAuthLogin->authorize
 require valid-user
 RewriteEngine ON
 RewriteRule /protected http://localhost:9999 [P]
</Location>

How do I read the query string? 
I want all URL in the form http://example.com/protected to proxy to http://localhost:9999/parse.pl?username=<from the login form>&password=<from the login form>

Please help!!!

On Thu, May 28, 2009 at 6:41 PM, Atanu <atanu.das@xxxxxxxxx> wrote:
My setup is Apache 2.x and mod_perl 2.x and AuthCookie(Apache-AuthCookie-3.12). I have been able to do a cookie based authentication with a (hardcoded) user-name and password  (of course from the sample files and configurations) and on authentication success have been able to proxy the request to another URL.
The question is how do I send the username and password parameters to the proxied URL? 

My httpd.conf
PerlRequire /var/www/html/Sample/startup.pl
PerlModule Sample::AuthCookieHandler
PerlSetVar SamplePath /
PerlSetVar SampleLoginScript /login.pl
PerlSetVar AuthCookieDebug 3

<Location /protected>
 AuthType Sample::AuthCookieHandler
 AuthName Sample
 PerlAuthenHandler Sample::AuthCookieHandler->authenticate
 PerlAuthzHandler Sample::AuthCookieHandler->authorize
 require valid-user
</Location>

<FilesMatch "\.pl$">
 SetHandler perl-script
 PerlResponseHandler ModPerl::Registry
 Options +ExecCGI
 AuthType Sample::AuthCookieHandler
 AuthName Sample
</FilesMatch>

# This is the action of the login.pl script above.
<Files  LOGIN>
 AuthType Sample::AuthCookieHandler
 AuthName Sample
 SetHandler perl-script
 PerlResponseHandler Sample::AuthCookieHandler->login
</Files>

ProxyRequests Off

ProxyPass /protected http://192.168.1.3:9999
ProxyPassReverse /protected http://192.168.1.3:9999

I want to do something like
ProxyPassReverse /protected http://192.168.1.3:9999?username=<from input username>&password=<from input password>

As suggested in the thread, it could be possible using mod_rewrite, but I am not able to get the rewrite rule to work in the first place. Please help. 

Thanks,
Atanu

On Wed, May 27, 2009 at 4:56 PM, Atanu <atanu.das@xxxxxxxxx> wrote:
Thanks Nick for the pointer. Let me try this out in my boxes.


On Wed, May 27, 2009 at 4:09 AM, Nick Kew <nick@xxxxxxxxxxxx> wrote:

On 26 May 2009, at 22:37, Atanu wrote:

- The user will still type http://foo.com. This time a mod_proxy handler will display a login page. In fact this my own authentication handler written in mod_perl. It authenticates using a back end system by accepting username and password from the login page.

This is all fairly standard, and you probably don't really need mod_perl.


I want the mod_proxy to ProxyPass to the url in the following format

http://bar.com/bar.pl?sid=APACHE_SESSION&u=UserName

Since you're using mod_perl, it would be fairly painless to
append the query string in Perl.  The alternative is to use
RewriteRule with [P] in place of proxypass.

--
Nick Kew

---------------------------------------------------------------------
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@xxxxxxxxxxxxxxxx
 "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx





[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux