Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: mod_perl handler for file downloads: good call or bad

by clinton (Priest)
on Jun 20, 2007 at 16:37 UTC ( #622314=note: print w/ replies, xml ) Need Help??

in reply to mod_perl handler for file downloads: good call or bad

I second Fletch's recommendation of the PerlAuthzHandler.

You COULD serve the files via mod_perl (using $r->sendfile($filename) ), but apache does it faster, so I would rather get out of the way and let it do its thing.


Comment on Re: mod_perl handler for file downloads: good call or bad
Replies are listed 'Best First'.
Re^2: mod_perl handler for file downloads: good call or bad
by Errto (Vicar) on Jun 20, 2007 at 18:18 UTC
    Sorry for not mentioning this in the OP, but I don't think I can use an Authz handler, because that seems to require using HTTP authentication, whereas I have my own mechanism for dealing with the "who" aspect.
      You can do anything you like in the PerlAuthzHandler, including returning a login page - HTTP authentication is just how apache implements it by default


        I've been looking over the link sent by Fletch and it really doesn't look like that's the case. The Authz seems to depend on a successful pass of the Authen pahse, which in turn requires the directory to be protected with either Basic or Digest authentication as configured in httpd.conf My application uses neither Basic nor Digest authentication but rather a third-party authentication module that communicates the user ID in a custom manner. The issue is not showing a login page but rather that I have to reject the request if the user ID (as determined through my custom method) should not have access to the resource.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://622314]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2015-11-28 08:05 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (739 votes), past polls