Apache2 with mod_perl, it doesn't follow symlinks; How can I fix this?

0

Issue

mod_perl/apache doesn’t seem able to follow symlinks.

In httpd.conf I have:

Options FollowSymLinks
<VirtualHost *>
        ServerName cas.devserver.com
        ServerAlias cas.devserver.com
        ServerAdmin webmaster@devserver.com
        DocumentRoot /var/www/htdocs/abc/def
        PerlSwitches -I/var/www/cgi-bin
        PerlSendHeader On
        <Location />
                Options FollowSymLinks
                PerlSendHeader On
                PerlHandler Test1::Test
                SetHandler perl-script
                Order deny,allow
                Allow from all
        </Location>
</VirtualHost>

If /var/www/cgi-bin/Test1 is a directory containing Test.pm, then it works. If it is a symlink to the directory that contains Test.pm (/var/www/cgi-bin/test1/) then it fails:

[error] [client xxx.xxx.xxx.xxx] failed to resolve handler `Test1::Test':
      Can't locate Test1/Test.pm in @INC
      (@INC contains: /var/www/cgi-bin/ <snip> /usr/lib/perl5/5.8.8 . /etc/httpd)
      at (eval 9) line 3.\n

I’ve checked permissions and they seem OK.

Thanks for any help.

Solution

Simple obvious question,

Have you tried running your cgi script from the command line with the symlink in place?

Shouldn’t you also add to the container?

Options +ExecCGI

HTH

cheers,

Answered By – Rob Wells

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave A Reply

Your email address will not be published.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More