André Warnier wrote:
I am trying the 4 receipes one after the other, in order of easiest to
more complicated.
Torsten Foertsch wrote:
2) replace $r->handler('modperl') in the aaa phase by
$r->add_config(['SetHandler modperl']). This way you override the
handler set in the configuration structure. In the fixup phase it is
then automagically copied to $r->handler.
When I try this, I get an Apache error with the following logfile message :
[Tue Oct 14 16:19:39 2008] [error] [client 84.158.163.207]
$r->add_config() has failed: SetHandler not allowed here at
/usr/local/lib/apache2/perllib/AUTH/StarLogCookie.pm line 416.\n
3) leave the $r->handler('modperl') and add a
$r->add_config(['SetHandler none']);
When I try this, I get an Apache error with the following logfile message :
[Tue Oct 14 16:10:40 2008] [error] [client 84.158.163.207]
$r->add_config() has failed: SetHandler not allowed here at
/usr/local/lib/apache2/perllib/AUTH/StarLogCookie.pm line 414.\n
So it seems that something does not like the $r->add_config from within
an AAA method, or at least not when trying to change the handler.
But
> 4) set $r->handler in a fixup handler.
this works :
$r->set_handlers(PerlAuthzHandler => []); # disable authorization
$r->set_handlers(PerlResponseHandler => \&_send_login_form);
$r->set_handlers(PerlFixupHandler => \{$_[0]->handler('modperl')});
Many, many thanks for all the explanations and tips.
I doubly appreciate not only because my immediate problem is solved, but
also because I learned a lot in the process.
It seems to me that this whole thread could be collected and re-arranged
into a Tutorial on mod_perl phases, authentication, interactions with
Apache etc.. but honestly at the moment I don't know where to begin.