【问题标题】:Apache2 with mod_perl, it doesn't follow symlinks; How can I fix this?带有 mod_perl 的 Apache2,它不遵循符号链接;我怎样才能解决这个问题?
【发布时间】:2009-04-06 15:24:33
【问题描述】:

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

在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>

如果/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

我已经检查了权限,它们似乎没问题。

感谢您的帮助。

【问题讨论】:

    标签: apache2 symlink mod-perl


    【解决方案1】:

    简单明了的问题,

    您是否尝试过从带有符号链接的命令行运行您的 cgi 脚本?

    你不应该也添加到容器中吗?

    Options +ExecCGI
    

    HTH

    干杯,

    【讨论】:

    • 谢谢罗伯。它从命令行运行良好。 +ExecCGI 修复了它。
    猜你喜欢
    • 2013-10-24
    • 1970-01-01
    • 2019-04-10
    • 1970-01-01
    • 2012-03-16
    • 2020-11-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多