Re: sethandlers question

2008-10-15 Thread Torsten Foertsch
On Tue 14 Oct 2008, Torsten Foertsch wrote: > On Tue 14 Oct 2008, André Warnier wrote: > > 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 /

Re: SetHandlers question, Phase II

2008-10-15 Thread Torsten Foertsch
On Wed 15 Oct 2008, André Warnier wrote: > > I think you're wanting: > > > >      $r->set_handlers(PerlFixupHandler => sub > > {$_[0]->handler('modperl')}); > > Yes.  That works. Better to return something sane from the handler: sub {$_[0]->handler('modperl');0} # 0==Apache2::Const::OK Also co

Re: SetHandlers question, Phase II

2008-10-15 Thread André Warnier
Thanks. Duh. Clinton Gormley wrote: $r->set_handlers(PerlFixupHandler => \{$_[0]->handler('modperl')});  The funny thing is, the way I understand that code above is to mean : "take a reference to the piece of code between the curly brackets, and pass that code reference as the 2d argume

Re: SetHandlers question, Phase II

2008-10-15 Thread Clinton Gormley
> $r->set_handlers(PerlFixupHandler => \{$_[0]->handler('modperl')});  > The funny thing is, the way I understand that code above is to mean : > "take a reference to the piece of code between the curly brackets, and > pass that code reference as the 2d argument to $r->set_handlers()". > But

SetHandlers question, Phase II

2008-10-15 Thread André Warnier
Help ! (please) To make a long story short, I created an Apache/mod_perl module for AAA, which after major help from Torsten Foertsch now works fine... on one system, but not on another relatively similar one. The module is called AUTH::StarLogCookie. the critical line is line 419 of the mo

Re: sethandlers question

2008-10-14 Thread Torsten Foertsch
On Tue 14 Oct 2008, André Warnier wrote: > At this moment, I cannot see clearly how the ErrorDocument solution > would allow me to send back a login page created dynamically, as I > need to do.  I will look it up, but as a definitive solution for the > time being I would prefer the $r->internal_red

Re: sethandlers question

2008-10-14 Thread André Warnier
Torsten Foertsch wrote: [...] The apache-way to do this has a name: ErrorDocument or in mod_perl $r->custom_response. Configure an ErrorDocument for 403 and return HTTP_FORBIDDEN in your A...Handler. That has the benefit that the 403 status is logged and that the browser (think about search eng

Re: sethandlers question

2008-10-14 Thread Torsten Foertsch
On Tue 14 Oct 2008, André Warnier wrote: > I doubly appreciate not only because my immediate problem is solved, > but also because I learned a lot in the process. Try the $r->add_config again with the right override flag (OR_FILEINFO) and you'll see it will also work. > It seems to me that this

Re: sethandlers question

2008-10-14 Thread André Warnier
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 stru

Re: sethandlers question

2008-10-14 Thread Torsten Foertsch
On Tue 14 Oct 2008, André Warnier wrote: > 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 li

Re: sethandlers question

2008-10-14 Thread André Warnier
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 ph

Re: sethandlers question

2008-10-14 Thread Torsten Foertsch
On Tue 14 Oct 2008, André Warnier wrote: > reminder of my config : > >> > >>     SetHandler jakarta-servlet ... > >> > > And, in summary, what I was trying to do is : > if the PerlAuthenHandler finds that the request is not authenticated, > then it tries to change the response handler for this re

Re: sethandlers question

2008-10-14 Thread André Warnier
Hi. I have read and pondered your earlier responses, and I am sure that the correct solution is somewhere around the ErrorDocument or the $r->internal_redirect. But I wanted to exhaust the other possibilities first, for the sake of completeness and also to learn more about this all. So one l

Re: sethandlers question

2008-10-13 Thread Torsten Foertsch
On Mon 13 Oct 2008, André Warnier wrote: > As explained the other thread (requests and subrequests), I thought > it was more elegant and mod_perl-ish, instead of doing a re-direct to > a login page if the user needed authentifying, to having the login > page returned by a content handler. The apac

Re: sethandlers question

2008-10-13 Thread André Warnier
Hi Torsten. Once again, I thank you for the time spent researching and answering my question(s). Unfortunately, I am less fluent in C than you (which is why after all I like and use mod_perl), so sometimes referring me to the C code is not as enlightening to me as it undoubtedly is to you. But

Re: sethandlers question

2008-10-13 Thread Torsten Foertsch
On Sun 12 Oct 2008, André Warnier wrote: > > >    SetHandler jakarta-servlet >    SetEnvIf REQUEST_URI "\.(htm|web|css|gif|jpg|js|html?)$" no-jk > >    PerlXXXHandler My::Module->some_method > >    ... > > > > ("jakarta-servlet" above means mod_jk --> Tomcat) > (and PerlXXXHandler being any kind

sethandlers question

2008-10-12 Thread André Warnier
Hi. Still around a new perl AAA module I'm writing, a question : If I have a Location like so : SetHandler jakarta-servlet SetEnvIf REQUEST_URI "\.(htm|web|css|gif|jpg|js|html?)$" no-jk PerlXXXHandler My::Module->some_method ... ("jakarta-servlet" above means mod_jk --> Tomcat) (