Ruben Safir wrote:
On Mon, Sep 15, 2014 at 12:24:13AM -0400, Ruben Safir wrote:
Oh yeah --

Server version: Apache/2.2.23 (Unix)
Server built:   Dec  9 2012 17:26:38




Continuing on this

I'm looking at what are the allowed options

I added:
use Apache2::Access;
use Apache2::Const -compile => qw(:common);
use Apache2::Const -compile => qw(:options);

and

        if($r->allow_options & Apache2::Const::OPT_INDEXES){
                print STDERR "INDEXES ON\n";
        }else {
                print STDERR "INDEXES OFF\n";
        }


        if($r->allow_options & Apache2::Const::OPT_SYM_LINKS){
                print STDERR "SYMLINS ON\n";
        }else {
                print STDERR "SYMLINKS OFF\n";
        }

        if($r->allow_options & Apache2::Const::OPT_EXECCGI){
                print STDERR "CGI ON\n"}
        else {
                print STDERR "CGI OFF\n";
        }


Now the error log for an index request says:

[Mon Sep 15 12:14:09 2014] [error] [client 10.0.0.57] Attempt to serve
directory: /usr/local/apache/htdocs/resources/, referer:
http://www.mrbrklyn.com/
INDEXES ON
SYMLINKS OFF
CGI OFF


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; # ?

See first this : http://perl.apache.org/docs/2.0/user/handlers/http.html#HTTP_Request_Cycle_Phases

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 : 
http://perl.apache.org/docs/2.0/user/handlers/http.html#PerlResponseHandler
and then follow the RUN_FIRST links, to
http://perl.apache.org/docs/2.0/user/handlers/intro.html#item_RUN_FIRST
and then to
http://perl.apache.org/docs/2.0/user/handlers/intro.html#C_RUN_FIRST_

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, so that Apache runs the next handler in the chain. Eventually, if all the installed Response handlers respond DECLINED, Apache will run its default response handler. 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.

Reply via email to