Re: DirectoryIndex ignored when using perl-handler

[prev] [thread] [next] [Date index for 2005/04/14]

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

William McKee wrote:
> On Tue, Apr 12, 2005 at 08:33:59PM -0400, Geoffrey Young wrote:
> 
>>for a good discussion, and a fixup handler that will likely fix your
>>problem.  you can also search the archives for the Apache::Dir discussion
>>that (IIRC) yielded that document.
> 
> 
> Geoff,
> 
> I tried using Apache::Dir. The current version on CPAN only supports
> mp1. Adding support for mp2 was easy enough but yielded no beneficial
> results (i.e., I still get 404 errors and the Apache log error).
> 
> I wrote to David W. who maintains the module; he had no further
> suggestions so I did some further debugging. It turns out that I'm not
> having a problem with appending a trailing slash; Apache seems to be
> doing this just fine with or without the Apache::Dir module.
> 
> The problem I'm having is that Apache is not setting the DirectoryIndex
> to a valid filename. It is instead complaining that it's trying to serve
> a directory. This is probably because ModPerl::Registry is handling the
> directory as turning off the SetHandler allows those indexes to be
> served (albeit I'm getting the script displayed as a text file instead
> of run as a perl script).

hmm.  I'm sorry I didn't get back to you today, but I had something
unexpected come up.  I'll be rolling rc5 tomorrow, but if you want to create
a bug tarball for me I'll look into it with whatever resources I can
scrounge up.

in the meanwhile here's my preliminary analysis...

SetHandler is forcing the handler to be mod_perl, but really mod_dir needs
to step in and handle the / -> DirectoryIndex conversion. so... what I would
do is alter that fixup handler to do something like this

  if ($r->handler('perl-script') && -d $r->filename && $r->is_initial_req) {
    $r->hander(Apache2::Const::DIR_MAGIC_TYPE);
  }

or somesuch.  basically, what you want to happen is for mod_dir to apply the
directory index and issue it's normal internal_direct to mod_perl.  un-doing
mod_mime's SetHandler for just the main request ought to do that.

however, I am on some severe pain killers at the moment, so who knows...

> 
> I also searched the archives for Apache::Dir as well as the Apache log
> error but could not find a discussion about this issue. Any more ideas
> for me?

http://marc.theaimsgroup.com/?t=108431004200002&r=1&w=2

--Geoff

(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