Apache2与mod_perl,它不遵循符号链接;我怎样才能解决这个问题?

时间:2022-10-05 18:20:14

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

mod_perl / apache似乎无法遵循符号链接。

In httpd.conf I have:

在httpd.conf我有:

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:

如果/ var / www / cgi-bin / Test1是包含Test.pm的目录,那么它可以工作。如果它是包含Test.pm(/ var / www / cgi-bin / test1 /)的目录的符号链接,那么它将失败:

[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.

谢谢你的帮助。

1 个解决方案

#1


Simple obvious question,

简单明显的问题,

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

您是否尝试使用符号链接从命令行运行cgi脚本?

Shouldn't you also add to the container?

你不应该加入容器吗?

Options +ExecCGI

HTH

cheers,

#1


Simple obvious question,

简单明显的问题,

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

您是否尝试使用符号链接从命令行运行cgi脚本?

Shouldn't you also add to the container?

你不应该加入容器吗?

Options +ExecCGI

HTH

cheers,