Re: DirectoryIndex ignored when using perl-handler

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

From: Thomas Hilbig
Subject: Re: DirectoryIndex ignored when using perl-handler
Date: 16:07 on 22 May 2005
--- Geoffrey Young <geoff@xxxxxxxxxxxxxxx.xxx> wrote:
> since you're new to mod_perl it's probably not
> obvious from that thread what
> the solution is.
> 
>  
>
http://marc.theaimsgroup.com/?l=apache-modperl&m=111445150218566&w=2
> 
> the code at the bottom of that link (My::Fixup)
> needs to be enabled from a
> PerlFixupHandler so that mod_dir can serve the
> request.  in other words, if
> you put it in the PerlResponseHandler like you are
> it's too late for mod_dir
> to take action and DTRT.  so
> 
>   PerlFixupHandler My::Fixup
>   PerlResponseHandler My::Dummy
>   ...etc...
> 
> HTH
> 
> --Geoff
> 
I have been using Apache::Registry to turbo-charge my
CGI scripts for several years, but yes this is the
first time writing a handler.

Still not working for me.  Here are my steps...

httpd.conf:

<Location /tempsecure >
  Options Indexes
  SetHandler perl-script
  PerlFixupHandler My::Fixup
  PerlResponseHandler My::Dummy
</Location>

My/Dummy.pm package just returns DECLINED (for now)

My/Fixup.pm package exactly as 
http://marc.theaimsgroup.com/?l=apache-modperl&m=111445150218566&w=2

Note 1:
  - All references to Apache2 changed to Apache (fresh
install of Fedora Core 3 & one up2date
    (httpd is 2.0.52 and mp2 is 1.99_16-3)
  - no complaints

Problem 1:
  - Error: Bareword "Apache::Const::DIR_MAGIC_TYPE"
not allowed while "strict subs" in use ..
  - Same complaint with Apache::Const::OK and
Apache::Const::DECLINED 
  - Bad practice, but I commented out the use strict
and use warnings ;

Problem 2:
  - calling URL to location (without file) 
  - error: "Can't locate object method is_initial_req
via package Apache::RequestReq 
  - I'm worried.  

Problem 3:
  - remove conditional logic from Fixup.pm so it
always forces directory index
	sub handler {
          my $r = shift;
	  $r->handler(Apache::Const::DIR_MAGIC_TYPE);
	  return Apache::Const::OK;
        }
  - call URL with location (no specific file)
  - error log: "Attempt to Serve directory"

Help.  I'm stuck.
Tom

__________________________________________________
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