Thanks for the suggestion, Philippe, but Perrin is right and it seems to
be too late to change the handler (I just tried it).

Actually I can 'fix' the issue by putting 
        <FilesMatch \.cgi$>
                SetHandler cgi-script
        </FilesMatch>
in the .htaccess file along with the 'SetHandler modperl'. This side
steps the issue as it doesn't deal with the other special files like PHP.

Perrin asks what am I doing. I want to create a custom directory listing
and modify the output of various file formats when they match a
particular regexp. All the other files (like CGI scripts) should pass
through untouched to be dealt with by Apache as if the perl handle
wasn't there. I'm guessing that this won't work.

I want to somehow chain the handlers together.

Should I be running this in a different phase?

                Anthony

On 26 Jun 2009 at 16:01:31, Philippe M. Chiasson wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On 26/06/09 15:55 , Perrin Harkins wrote:
> > On Thu, Jun 25, 2009 at 5:51 PM, Anthony R Fletcher<a...@mail.nih.gov> 
> > wrote:
> >> I have a mod_perl 2 module, running in Apache 2.2,
> >>
> >> -------------------------------------------------
> >> package Apache2::NNNN;
> >>
> >> use 5;
> >> use strict;
> >>
> >> use Apache2::Const -compile => qw(DECLINED);
> >>
> >> sub handler
> >> {
> >>        return Apache2::Const::DECLINED;
> >> }
> >>
> >>
> >> 1;
> >> -------------------------------------------------
> >>
> >> and this is enabled in a .htaccess file via
> >>
> >>        SetHandler modperl
> >>        PerlResponseHandler Apache2::NNNN
> >>
> >> Without the .htaccess config above CGI scripts run fine. With the above
> >> the actual script is returned.
> > 
> > Hmm.  Why are you doing this?  It's not clear what you're really trying to 
> > do.
> > 
> > If you want to change which module does the response handler phase,
> > you can do that, and you should be able to set it to be the
> > cgi-handler module, but I don't think you can do it when you're
> > already in the response handler phase.
> 
> Yes, so my previous suggestion is most likely no good. It's sort of too
> late indeed, once a content handler has been entered.
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.7 (Darwin)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iD8DBQFKRSkbyzKhB4jDpaURArs/AKCwYDGegAmvQml1MpUaJF2LYQBEtwCfb8ET
> 6OE0366ojElzWlrg/GQPN2M=
> =IZvN
> -----END PGP SIGNATURE-----

-- 
Anthony R Fletcher        
  Room 2033, Building 12A,        http://dcb.cit.nih.gov/~arif
  National Institutes of Health,  a...@mail.nih.gov
  12A South Drive, Bethesda,      Phone: (+1) 301 402 1741.
  MD 20892-5624, USA.

Reply via email to