Scott Penrose пишет:

>
> On 01/08/2006, at 15:30, Vladimir S. Tikhonjuk wrote:
>
>> Hi everyone!
>>
>> I have Authentication handler, which I set like:
>>
>> <Location />
>> PerlAuthenHandler Promtelecom::Authentication
>> AuthType Basic
>> AuthName "Promtelecom Network"
>> Require valid-user
>> </Location>
>>
>> Alseo I have 2 simple PerlHandler's: Debitor and DebitorDocuments, which
>> set like:
>>
>> PerlModule Promtelecom::Debitor
>> <Location /debitor>
>> SetHandler perl-script
>> PerlHandler Promtelecom::Debitor
>> </Location>
>>
>> PerlModule Promtelecom::DebitorDocuments
>> <Location /debitor/documents>
>> SetHandler perl-script
>> PerlHandler Promtelecom::DebitorDocuments
>> </Location>
>>
>> When I go to http://localhost/ by my browser, I see working
>> Authentication Handler. When I go for the first time to
>> http://localhost/debitor/ or http://localhost/debitor/documents I see
>> Authentication Handler too.
>> So, the question is: when I go to http://localhost/debitor/documents
>> will the Debitor handler called ?
>> Or will be the next chain: Authentication -> Debitor -> DebitorDocuments
>> invoked ?
>
>
> Only if you reverse the order. e.g.
>
> PerlModule Promtelecom::DebitorDocuments
> <Location /debitor/documents>
> SetHandler perl-script
> PerlHandler Promtelecom::DebitorDocuments
> </Location>
> PerlModule Promtelecom::Debitor
> <Location /debitor>
> SetHandler perl-script
> PerlHandler Promtelecom::Debitor
> </Location>
>
> Apache will often report if you put them in the wrong order at startup
> time.
>
> Basically first one wins - so if the URL is "/debitor/documents/fred"
> and the first Location is "/debitor" - it would win. So you make sure
> that it is always least to most significant.
>
> Scott

So, as I understant, If I want authenticate user before seeing every
page, I have to put

<Location />
PerlAuthenHandler Promtelecom::Authentication
AuthType Basic
AuthName "Promtelecom Network"
Require valid-user
</Location>

to be the first one.

Then, If I want DebitorDocuments Handler (
http://localhost/debitor/documents ) invoked without Debitor handler, I
have to put it before DebitorHandler ?
And vise versa: If I want Debitor Handler and then DebitorDocuments
Handler to be invoked when I go to http://localhost/debitor/documents,
the Debitor Handler have to stand before DebitorDocuments Handler in
httpd.conf ?

Reply via email to