geektron has asked for the wisdom of the Perl Monks concerning the following question:

so i'm launching an application on a new server, and i'm having an odd problem. i *think* i understand why, but i need to correct it.

if i set up httpd.conf like so:

<Location /index.pl> SetHandler perl-script PerlHandler Module </Location>
my images, style, etc work. there *is* no index.pl .. so if the site is access as www.site.com/ users get a 403 error because i've denied directory listings in httpd.conf

but if i use this conf:

<Location /> SetHandler perl-script PerlHandler Module </Location>
my images and styles don't work.

so i'm stumped. there is no index.pl ... and i don't see the need for one ( unless i'm doing something wrong )

Replies are listed 'Best First'.
•Re: "proper" mod_perl config directives
by merlyn (Sage) on Sep 02, 2003 at 18:24 UTC
    Untested, but I often get this stuff right anyway {grin}:
    <Files index.pl> SetHander perl-script PerlHandler Apache::Registry </Files> DirectoryIndex index.pl index.html
    That'll try an index.pl file if it's present, otherwise fall back to an index.html, whenever you ask for a directory instead of a file.

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.

      creating a bogus index.pl seems to have done the job along with the suggested fix.
        Uh, why a bogus index.pl? Isn't your code to handle the directory in there?

        If not, you didn't spell things out very carefully. Do you have a handler that should apply only to directories? If so, it needs to simply decline anything it doesn't want to handle.

        I have an example of that at my mod_perl-enabled Picture handler, In particular, simply return DECLINED if content-type is not DIR_MAGIC_TYPE.

        -- Randal L. Schwartz, Perl hacker
        Be sure to read my standard disclaimer if this is a reply.