perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Hilbig <thil...@yahoo.com>
Subject Re: DirectoryIndex ignored when using perl-handler
Date Sat, 21 May 2005 04:39:59 GMT
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 

Mime
View raw message