You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Scott Alexander <al...@webmail.humak.edu> on 2000/04/18 11:08:10 UTC

Setting AuthUserFile dynamically ...

Hi,

I asked yesterday about using httpd.conf to set the AuthUserFile dynamically.

Maybe I'm trying to paddle up a creek in a barb wire canoe.

Is it possible to do something like below? i.e. use a variable in the 
AuthUserFile line? Or how can I do this?

<Directory /systems/v2.0>
PerlSendHeader On
SetHandler perl-script
PerlHandler Apache::Registry
Options +ExecCGI

RewriteRule ^/bin/([^/]+)/(.*) /systems/v2.0/$2 [E=STATUS:$1] [PT]
######################## This line
AuthUserFile /systems/$1/passwd/users
######################## and this line
AuthName "$1"
AuthType Basic
require valid-user
<Limit GET POST PUT DELETE>
require valid-user
</Limit>

ErrorDocument 401 /systems/v2.0/error/401.html
ErrorDocument 403 /systems/v2.0/error/403.html
ErrorDocument 404 /systems/v2.0/error/404.html
ErrorDocument 500 /systems/v2.0/error/500.html
</Directory>

regards

Scott

----------------------------------------
Scott Alexander tietoverkkosuunnittelija
scott.alexander@humak.edu
gsm: +358 (0)40 7505640

Re: Setting AuthUserFile dynamically ...

Posted by darren chamberlain <da...@boston.com>.
Scott Alexander (alexsc01@webmail.humak.edu) said something to this effect:
> Hi,
> 
> I asked yesterday about using httpd.conf to set the AuthUserFile dynamically.
> 
> Maybe I'm trying to paddle up a creek in a barb wire canoe.
> 
> Is it possible to do something like below? i.e. use a variable in the 
> AuthUserFile line? Or how can I do this?
> 

Hi Scott,

Have you tried setting the PerlAuthenHandler via $r->push_handlers, in
a PerlInitHandler?  The code, and the assignment, will be in code,
although it could be in a <Perl> section within your conf file.

darren

-- 
Tell a man that there are 400 Billion stars and he'll believe you 
Tell him that a bench has wet paint and he has to touch it