in reply to mod_perl and DirectoryIndex

You don't say how you are running your mod_perl, as handlers, or as ModPerl::Registry etc.

I would hazard a guess that you are using Registry, or one of the other mod_perl enabled CGI-like environments. You have set Registry to handle a particular directory, and while /path/page works, when you make a request to /path/, you're not not getting the directory index that you expect.

When Registry is set as the response handler for a location or directory, mod_dir never receives control.

See this thread for more details about the problem, and see this post in particular for the solution.

Clint

Replies are listed 'Best First'.
Re^2: mod_perl and DirectoryIndex
by NederBoy (Initiate) on Aug 08, 2007 at 16:03 UTC
    First, I want to thank clinton for the relevant thread link. Fixup.pm
    package My::Fixup; use strict; use warnings FATAL => qw(all); use Apache2::Const -compile => qw(DIR_MAGIC_TYPE OK DECLINED); use Apache2::RequestRec; use Apache2::RequestUtil; sub handler { my $r = shift; if ($r->handler eq 'perl-script' && -d $r->filename && $r->is_initial_req) { $r->handler(Apache2::Const::DIR_MAGIC_TYPE); return Apache2::Const::OK; } return Apache2::Const::DECLINED; } 1;
    Add PerlFixupHandler line to httpd.conf
    PerlInputFilterHandler Apache2::ModProxyPerlHtml PerlOutputFilterHandler Apache2::ModProxyPerlHtml SetHandler perl-script PerlFixupHandler My::Fixup PerlAddVar ProxyHTMLURLMap "http://host.doamin.tld /host" PerlAddVar ProxyHTMLURLMap "http://host1.domain.tld /host1" PerlSetVar ProxyHTMLVerbose "On"

    What I am using closely mimics what is in the perldocs of http://www.samse.fr/GPL/ModProxyPerlHtml/Apache2-ModProxyPerlHtml-2.1/ModProxyPerlHtml.pm with the exception that now I am also serving static web pages off of this server as well.


    This seems to have worked.

    Thanks again Perl Monks.