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

I'm trying to install mod_perl 1.99 on my gentoo apache2 box. I added this to my httpd.conf:
LoadModule perl_module extramodules/mod_perl.so Alias /mod-perl/ /home/teun/mod-perl/ <Location /mod-perl/> SetHandler perl-script PerlResponseHandler ModPerl::Registry PerlOptions +ParseHeaders Options +ExecCGI </Location>
But when i try to run http://formula.wtb.tue.nl/mod-perl/env.pl i get a 403 forbidden. The error_log only tells me this:
[Mon Nov 22 02:17:35 2004] [error] [client 82.161.115.80] client denie +d by server configuration: /home/teun/mod-perl/env.pl
Does anybody have any idea on what the problem is?

Replies are listed 'Best First'.
Re: Apache mod_perl configuration
by perrin (Chancellor) on Nov 21, 2004 at 19:22 UTC
    Most likely the user who the server runs as does not have access to the /home/teun/mod-perl/ directory.
      teun@formula/: ll /home/teun total 36 drwxr-xr-x 4 teun users 4096 Nov 21 22:18 ./ drwxr-xr-x 4 root root 4096 Oct 20 12:30 ../ -rw------- 1 teun users 467 Nov 21 22:51 .bash_history -rw-r--r-- 1 teun users 232 Oct 15 00:35 .bash_profile -rw-r--r-- 1 teun users 833 Oct 19 10:19 .bashrc -rw------- 1 teun users 4859 Nov 21 22:18 .viminfo drwxr-xr-x 2 teun users 4096 Nov 21 22:02 htdocs/ drwxr-xr-x 2 teun users 4096 Nov 21 22:18 mod-perl/
        Humor me. Change to nobody (or whoever your server runs as) and try to read the files.
Re: Apache mod_perl configuration
by Arunbear (Prior) on Nov 21, 2004 at 20:09 UTC
    I think
    Alias /mod-perl/ /home/teun/mod-perl/
    is the problem. It should be
    Alias /mod-perl /home/teun/mod-perl

    ... but I could be wrong; trailing /'s are nearly as confusing as temporal paradoxes.
      The help sais:
      # Note that if you include a trailing / on fakename then the server wi +ll # require it to be present in the URL. So "/icons" isn't aliased in t +his # example, only "/icons/".. # #Alias /icons/ /var/www/localhost/icons/
Re: Apache mod_perl configuration
by CountZero (Bishop) on Nov 21, 2004 at 20:24 UTC
    What happens if you change <Location> to <Directory>?

    I always thought that <Location> was not to be used for physically existing directories.

    CountZero

    "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

      Nope, you've got it backwards. Locations do not have to be real paths.
        That's exactly what I said!

        CountZero

        "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

      I think the fact that the <Location> is aliased may be a problem. Try <Directory /home/teun/mod-perl> instead.

      Update: also try adding an Allow from all line to the <Directory> block.