perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ruben Safir <>
Subject Re: lost directory indexes
Date Mon, 15 Sep 2014 21:40:00 GMT
> >
> >
> >Now the error log for an index request says:
> >
> >[Mon Sep 15 12:14:09 2014] [error] [client] Attempt to serve
> >directory: /usr/local/apache/htdocs/resources/, referer:
> >
> >
> >
> >It knows that INDEXES is on but it is ignoring the config files fault.
> >
> >I suppose I need to identify the directory request and then
> >decline to respond to it.
> Yes.
> >But I have no idea how to do this.
> Have you tried
> return DECLINED; # ?

I think I need return Apache2::Const::DECLINED;

It is recieving a DECLINED but it is not acting according to what you
wrote here.

> See first this :

> Leave that page open in a tab, to refer to it during the rest.
> Then open this page in another tab, and read it, up to the RUN_ALL label.
> (Really do this; it takes only a few minutes, and it will save you a
> lot of time in the long run)
> Then see :
> and then follow the RUN_FIRST links, to
> and then to

Yes - I have poured over this docs today.
> Summary :
> When you install you own mod_perl response handler, it gets pushed
> "on top" of the Apache default handler, so it gets called first.
> If your response handler really generates a response, it should
> return OK, so that Apache does not run any more response handlers
> after that (not even the default handler, see below), and skips to
> the next phase (Logging). (Your handler can also return an error
> code, and that also aborts the Response phase and goes to Logging.)
> If your handler decides not to generate a response for this request
> (but leave it for another handler to do that), then it should
> respond DECLINED, 

It does this.  This is the code:

        if ($gate =~ m{///}){
                print STDERR "I have a match\n";
                $r->log_reason("Access Forbidden", $r->filename);
                return Apache2::Const::FORBIDDEN;
                print STDERR "Declining: $gate \n";
                return Apache2::Const::DECLINED;

> so that Apache runs the next handler in the chain.

Whatever apache is running after this is does not include anything
that is supposed to identify indexes or dir_module (the discovery of
index.html).  These things are not happening even as I change the handle
type from PerlResponseHandle to PerlAccessHandler to PerlTransHadler

None of it.

Even if I put 
 return Apache2::Const::DECLINED;

right at the top of the module:
package URL_BLOCK;

use strict;
use Apache2::RequestRec ();
use Apache2::RequestIO ();
use Apache2::Access;
use Apache2::Const -compile => qw(:common);
use Apache2::Const -compile => qw(:options);

sub handler{
        my $r = shift;
        return Apache2::Const::DECLINED;
        my $gate = $r->unparsed_uri;


Still it can no longer identify index.html or perform any fancy

ONLY if I remove the perl handler from the location, only then will
indexing work correctly.

> Eventually, if all the installed Response handlers respond DECLINED,
> Apache will run its default response handler.

that default handler evidently does not include fancy indexing or 
option Indexes

> This default handler is always there, at the end of the Response
> handlers chain.  It is the one which tries to respond to the request
> by sending a static file (e.g. a html page on disk) or the content
> of a directory.
> That's what you want, here; so return DECLINED.

So many immigrant groups have swept through our town
that Brooklyn, like Atlantis, reaches mythological
proportions in the mind of the world - RI Safir 1998 

DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002 - Leadership Development in Free Software - Unpublished Archive - coins! 

Being so tracked is for FARM ANIMALS and and extermination camps, 
but incompatible with living as a free human being. -RI Safir 2013

View raw message