Apache::Dir 0.03
David Wheeler <[email protected]> Tue, 18 May 2004 17:02:30 -0700
| Newsgroups | gmane.comp.web.mason.announce |
|---|---|
| Message-ID | <[email protected]> |
Hello All,
Apache::Dir is a simple and partial replacement for mod_dir. This will
be of special interest to Mason users, since Mason doesn't currently do
the right thing with directory requests. The documentation explains
all:
This simple module is designed to be a partial replacement for the
standard Apache mod_dir module. One of the things that module does
is
to redirect browsers to a directory URL ending in a slash when they
request the directory without the slash. Since mod_dir seems do its
thing during the Apache response phase, if you use a Perl handler,
it
won't run. This can be problematic if the Perl handler doesn't
likewise
take the directory redirecting into account.
A good example is HTML::Mason. If you've disabled Mason's
decline_dirs
parameter (MasonDeclineDirs 0 in httpd.conf), and there's a
dhandler in
the directory /foo, then for a request for /foo, /foo/dhandler will
respond. This can wreak havoc if you use relative URLs in the
dhandler.
What really should happen is that a request for /foo will be
redirected
to /foo/ before Mason ever sees it.
This is the problem that this module is designed to address.
Configuration would then look something like this:
<Location /foo>
PerlSetVar MasonDeclineDirs 0
PerlModule Apache::Dir
PerlModule HTML::Mason::ApacheHandler
SetHandler perl-script
PerlFixupHandler Apache::Dir
PerlHandler HTML::Mason::ApacheHandler
</Location>
Apache::Dir can also be configured to handle the request during the
response cycle, if you wish. Just specify it before any other Perl
handler to have it execute first:
<Location /foo>
PerlSetVar MasonDeclineDirs 0
PerlModule Apache::Dir
PerlModule HTML::Mason::ApacheHandler
SetHandler perl-script
PerlHandler Apache::Dir HTML::Mason::ApacheHandler
</Location>
See this thread on mason-devel for more information:
http://marc.theaimsgroup.com/?t=108421615500001&r=1&w=2
Enjoy,
David
Begin forwarded message:
> From: PAUSE <[email protected]>
> Date: May 18, 2004 5:00:15 PM PDT
> To: "David Wheeler" <[email protected]>
> Subject: CPAN Upload: D/DW/DWHEELER/Apache-Dir-0.03.tar.gz
> Reply-To: [email protected]
>
> The uploaded file
>
> Apache-Dir-0.03.tar.gz
>
> has entered CPAN as
>
> file: $CPAN/authors/id/D/DW/DWHEELER/Apache-Dir-0.03.tar.gz
> size: 3477 bytes
> md5: ec0eab4111804cd598d6ecbb88d636f1
>
> No action is required on your part
> Request entered by: DWHEELER (David Wheeler)
> Request entered on: Tue, 18 May 2004 23:58:51 GMT
> Request completed: Wed, 19 May 2004 00:00:15 GMT
>
> Thanks,
> --
> paused, v460
-------------------------------------------------------
This SF.Net email is sponsored by: SourceForge.net Broadband
Sign-up now for SourceForge Broadband and get the fastest
6.0/768 connection for only $19.95/mo for the first 3 months!
http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click