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

发布于 2024-07-16 16:15:59 字数 1277 浏览 5 评论 0原文

mod_perl/apache 似乎无法跟踪符号链接。

httpd.conf 中,我有:

Options FollowSymLinks
<VirtualHost *>
        ServerName cas.devserver.com
        ServerAlias cas.devserver.com
        ServerAdmin [email protected]
        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

我已检查权限并他们看起来还不错。

谢谢你的帮助。

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 [email protected]
        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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

狠疯拽 2024-07-23 16:15:59

简单明显的问题,

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

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

Options +ExecCGI

HTH

欢呼,

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,

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文