On Thu, Jan 29, 2009 at 4:52 PM, Michael R Boudreau <
mboudr...@press.uchicago.edu> wrote:
> Hi Vince,
>
> Thanks for writing. However, I'm still confused, and it may just be that
> I'm not yet comfortable with the way the documentation phrases things, so
> please excuse me if I'm asking something that seems obvious. The
> documentation says that when decline_dirs is true (the default), "Mason
> should decline directory requests, leaving Apache to serve up a directory
> index or a FORBIDDEN error as appropriate". That's what I want--for Apache
> to serve a directory index--but it's not happening, and I see this in the
> error log:
>
> [Thu Jan 29 14:46:06 2009] [error] [client ::1] Attempt to serve
> directory: /Users/mrb/Sites/mason/
>
> When I add the line "PerlSetVar MasonDeclineDirs 0" to my httpd.conf and
> restart Apache, I still don't get a directory index, but the message in the
> Apache error log is different:
>
> [Thu Jan 29 14:45:31 2009] [error] [Mason] File does not exist:
> /Users/mrb/Sites/mason/
>
> Does my
>
> <Directory /Users/mrb/Sites/mason>
> SetHandler perl-script
> PerlHandler HTML::Mason::ApacheHandler
> </Directory>
>
> mean that Apache's mod_autoindex is not allowed to handle the directory
> request at all, regardless of the value of decline_dirs?
>
> The Admin guide says "If you would like Mason to handle directory requests,
> set decline_dirs to 0. The dhandler that catches a directory request is
> responsible..." Does that mean I would have to write a Mason component (a
> file called 'dhandler' in this directory?) that will present the directory
> contents? I'm already happy with the way Apache does that, so I have no
> desire to write that code myself.
>
> Would a better solution be to replace the <Directory> stuff above with a
> <Location> or <LocationMatch> section to specify files that are in the mason
> directory and that also have certain extensions? (I don't want Mason to
> handle images and other non-text files anyway).
>
> Sorry to run on for so long--I'll be grateful for any advice you can offer.
>
>
Not at all, I just wish I were not so busy, so I could help you more. I
think you're on the right track now. Yes, you could create a dhandler to
handle the directory request, but as you pointed out, that's a waste of
perfectly good OPC (Other People's Code). Removing the directory stanza you
quoted and configuring Mason via a FilesMatch directive will probably do
what you want. I'm not sure which way a LocationMatch will go, but you can
experiment and discover for yourself. :)
--
-Vince Veselosky
http://www.webquills.net
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users