如何使 CGI::Application::Dispatch 与 mod_perl 一起工作?
好的,所以我正在尝试使用 mod_perl 设置调度程序,但我真的不知道我做错了什么。 我相当肯定问题出在我的 mod_perl 配置上。 以下是我认为相关的内容:
Apache Directory Config
<Directory "C:/Documents and Settings/frew/My Documents/acd">
SetHandler perl-script
PerlHandler ACD::Dispatch
Options Indexes FollowSymLinks ExecCGI
AllowOverride None
Order allow,deny
Allow from all
DirectoryIndex Default.html
</Directory>
注意:ACD::Dispatch 位于 acd/ACD 中。
ACD::Dispatch
package ACD::Dispatch;
use base 'CGI::Application::Dispatch';
sub dispatch_args {
return {
prefix => 'ACD',
table => [
'' => { app => 'Controller', rm => 'awesome' },
':app/:rm' => { },
],
};
}
也许最重要的是,Apache 错误:
[Mon Jan 12 17:42:08 2009] [error] [client 10.6.1.73] failed to resolve handler `ACD::Dispatch': Can't locate ACD/Dispatch.pm in @INC (@INC contains: C:/usr/site/lib C:/usr/lib . C:/Program Files/Apache Software Foundation/Apache2.2) at (eval 3) line 3.\n
感谢您的帮助!
更新:我需要将其添加到我的 Apache 配置中:
<Perl>
use lib '/path/to/acd';
</Perl>
Ok, so I am trying to set up a Dispatcher with mod_perl and I don't really know what I am doing wrong. I am fairly positive that the issue is with my mod_perl configuration. Here is what I think is relevant:
Apache Directory Config
<Directory "C:/Documents and Settings/frew/My Documents/acd">
SetHandler perl-script
PerlHandler ACD::Dispatch
Options Indexes FollowSymLinks ExecCGI
AllowOverride None
Order allow,deny
Allow from all
DirectoryIndex Default.html
</Directory>
Note: ACD::Dispatch is in acd/ACD.
ACD::Dispatch
package ACD::Dispatch;
use base 'CGI::Application::Dispatch';
sub dispatch_args {
return {
prefix => 'ACD',
table => [
'' => { app => 'Controller', rm => 'awesome' },
':app/:rm' => { },
],
};
}
And probably most importantly, the Apache errors:
[Mon Jan 12 17:42:08 2009] [error] [client 10.6.1.73] failed to resolve handler `ACD::Dispatch': Can't locate ACD/Dispatch.pm in @INC (@INC contains: C:/usr/site/lib C:/usr/lib . C:/Program Files/Apache Software Foundation/Apache2.2) at (eval 3) line 3.\n
Thanks for any help!
Update: I needed to add this to my Apache config:
<Perl>
use lib '/path/to/acd';
</Perl>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,根据错误消息:
以及您所说的事实:
看起来您需要使用其绝对路径名将“acd”目录放入@INC 路径中。
尽管你可能会认为“。” 位于 @INC 上,这应该是您的
acd
目录,但我不认为它是在 mod_perl 下。 例如,请参阅此讨论。Well, based on the error message:
and the fact that you said:
It looks like you need to put the "acd" directory in the @INC path, using its absolute pathname.
Although you might think '.' is on @INC and that should be your
acd
directory, I don't that that it is, under mod_perl. See, for example, this discussion.