Re: Proxy authentication against a mod_perl backend - how?

2002-04-02 Thread Igor Sysoev

On Mon, 1 Apr 2002, Fury wrote:

> I've recently reconfigured a web server to use the front-end proxy/back-end
> mod_perl configuration.  One application runs happily on the mod_perl
> server, with static content being served from the proxy, and dynamic
> requests forwarded to the backend.
> 
> However, I have a request to insert a bunch of static content onto the proxy
> server, which is fine.  As an added requirement, the content is to be
> protected.  Now, I could just use the standard Apache access files, but
> they're ugly, and get slow as they grow.
> 
> Ideally, I'd like to use the backend database to hold the user information
> used for authentication.  How can I configure the proxy (which doesn't have
> mod_perl) to authenticate against the back end?
> 
> My first thoughts were to use mod_proxy to forward requests for
> /protected/login to the backend, where the authentication will be done.
> Then, just redirect the request to another URL behind /protected.  The
> authentication information should be passed as part of the request, should
> it not?  I'd also reverse proxy the URL's - I don't think this would work if
> I didn't.

mod_accel can do such authorization with directive AccelRevalidateUser.
Authorization can be done via HTTP Basic authorization or cookie.

If directive is active the following happens:
1. if there is no cached response then it request is passed to backend;
2  if backend reponses with 200 code then reponse is cached;

3. if there is cached reponse then request is passed to backend with
   If-Modified-Since header that set to Last-Modified header of cached
   reponse;
4. if backend reponses with code 304 or 200 then cached or received
   reponse send to client;

5. if backend reponses with any other codes then reponse send to client
   but cached reponse is not deleted.

But this feature is usefull only if backend authorization and
304 (Not Modified) generating is cheaper then full reponse (200) generating.

Igor Sysoev
igor @ sysoev.ru





Re: Proxy authentication against a mod_perl backend - how?

2002-04-01 Thread Perrin Harkins

> My first thoughts were to use mod_proxy to forward requests for
> /protected/login to the backend, where the authentication will be
done.
> Then, just redirect the request to another URL behind /protected.  The
> authentication information should be passed as part of the request,
should
> it not?

Sure, but your proxy server won't be checking to see what it is.  People
could go to any of your proctected pages freely if they know the URL.

Sounds like you're going to a lot of trouble to avoid using standard
auth to me.  There are a number of auth modules out there which don't
need mod_perl, and you may find one that will play nicely with your
backend programs.  Modules that auth against MySQL or LDAP servers
exist.

If you're determined to do auth on the backend, I would just let the
backend do the auth and serving of the static pages.  It will dump them
out fast and let the proxy servers do the slow work of dribbling the
bytes out to clients.

- Perrin