Re: DirectoryIndex ignored when using perl-handler

[prev] [thread] [next] [Date index for 2005/05/21]

From: Thomas Hilbig
Subject: Re: DirectoryIndex ignored when using perl-handler
Date: 04:39 on 21 May 2005
I really apologize for resurrecting a thread that was
put to rest almost a month ago.  I am just running
into this problem now, and I don't quite understand
what the fix is.  I'm very new to writing a MP
handler.

I am trying to write a (yet another) authentication
handler for a directory that is to be indexed.  By I
am finding that no matter what I try, based on the
April thread, I just can't get the normal directory
indexing to work.

I've stripped out all of the handler's real logic and
the usual MP1/MP2 detection below, and it just returns
a simple DECLINE.  As with the original poster's
problem, unless I specify the filename in the URL it
fails with the error log "Attempt to Server Directory"

Using just the stub code below, I would like to know
how to get it to give the directory index.  I've tried
adding .. 
   $r->handler(Apache::Const::DIR_MAGIC_TYPE); 
   return OK;
.. just to see if it gives a directory index, but only
an empty file is returned to the browser (but no
error). What am I doing wrong?  

Tom

Linux, httpd 2.0.52

httpd.conf snippet:
<Location /tempsecure >
  Options Indexes
  SetHandler perl-script
  PerlResponseHandler My::Dummy
</Location>

site_perl\My\Dummy.pm file:
  package My::Dummy ;
  
  use Apache::Const -compile => qw(DIR_MAGIC_TYPE OK
DECLINED);
  use Apache::RequestRec;

  use strict;
  use warnings;
  use CGI qw/header path_info redirect
path_translated/;

  sub handler { 
      my $r = shift;
      # fix to detect blank file and pass to directory
index goes here...
      return DECLINED ; 
  }
  1;
__END__

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

(message missing)

DirectoryIndex ignored when using perl-handler
William McKee 00:06 on 13 Apr 2005

Re: DirectoryIndex ignored when using perl-handler
Geoffrey Young 00:33 on 13 Apr 2005

Re: DirectoryIndex ignored when using perl-handler
William McKee 13:54 on 13 Apr 2005

Re: DirectoryIndex ignored when using perl-handler
William McKee 19:14 on 13 Apr 2005

Re: DirectoryIndex ignored when using perl-handler
Geoffrey Young 00:21 on 14 Apr 2005

Re: DirectoryIndex ignored when using perl-handler
William McKee 14:08 on 25 Apr 2005

Re: DirectoryIndex ignored when using perl-handler
Geoffrey Young 17:51 on 25 Apr 2005

Re: DirectoryIndex ignored when using perl-handler
Geoffrey Young 15:39 on 27 Apr 2005

Re: DirectoryIndex ignored when using perl-handler
William McKee 20:35 on 25 Apr 2005

Re: DirectoryIndex ignored when using perl-handler
Thomas Hilbig 04:39 on 21 May 2005

Re: DirectoryIndex ignored when using perl-handler
Geoffrey Young 05:39 on 21 May 2005

Re: DirectoryIndex ignored when using perl-handler
Thomas Hilbig 16:07 on 22 May 2005

Re: DirectoryIndex ignored when using perl-handler
Geoffrey Young 14:43 on 23 May 2005

Re: DirectoryIndex ignored when using perl-handler
Thomas Hilbig 15:56 on 24 May 2005

Generated at 15:53 on 25 May 2005 by mariachi v0.52