我试图启用一个全新安装的Lucid Lynx上的mod_perl(ubuntu 10.04)。
我有安装libapache2-mod-perl2,但我似乎无法得到.pl文件运行,而不是被下载。
5.10.1
-Apache 2
我安装了“LAMP”configuration。
mod_perl可能不是你正在寻找的。 perl脚本是devise用mod_perl运行还是cgi脚本?
首先,让我们考虑这是一个CGI脚本,而不是真正意义上的mod_perl运行。 如果是这样,在你的configuration块,你可以把:
<Directory /path/to/webroot/> Options +ExecCGI AddHandler cgi-script .pl </Directory>
如果脚本在顶部有一个正确的#!/ usr / bin / perl行,并且能够被执行,那么apache应该把它作为一个CGI脚本。
但是,如果你真的想要使用mod_perl,你通常需要在你的VirtualHostconfiguration文件中写一个处理程序,如下所示:
<Location /virtualpath> SetHandler modperl PerlResponseHandler modulename::Function </Location>
你可能还需要把:
PerlRequire /path/to/startupscript.pl
做你的环境修正。 通常,mod_perl处理程序是.pm文件,而不是.pl文件。