做CGI和mod_perl的发挥很好地在一起吗? [英] Do CGI and mod_perl play nicely together?

查看:217
本文介绍了做CGI和mod_perl的发挥很好地在一起吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Apache Web服务器(不用mod_perl)一个已经运行就好了很长一段时间。
有人建议,我们使用的mod_perl改善一些脚本的性能

I've got an apache web server (without mod_perl) that's been running just fine for a long time. It has been suggested that we use mod_perl to improve the performance of some scripts.

我想继续和服务器,这似乎是一个相对简单的过程上安装的mod_perl,但我对一些即将在谷歌搜索的东西迷惑。
如果我安装的mod_perl(通过Debian仓库),将我所有的现有的CGI突然开始使用的mod_perl,并表现出潜在靠不住的行为呢?

I want to go ahead and install mod_perl on the server, which seems to be a relatively straightforward process, but I'm confused by some of the stuff coming up on Google searches. If I install mod_perl (through the debian repositories), will all of my existing CGIs suddenly start "using mod_perl" and exhibiting potentially wonky behavior?

还是有Apache中的一些配置,需要一个老的CGI需做开始使用的mod_perl?

Or is there some configuration in apache that needs to be done for an old CGI to "start using mod_perl"?

道歉,如果这是一个很简单的答案,但我被混淆的术语中的文件以多种方式被使用。

Apologies if this is a straightforward answer but I am confused by the terminology being used in multiple ways in the documentation.

推荐答案

的mod_perl在你的httpd.conf进行配置,以启用。因此,您的服务器上不是每个脚本将开始自动使用的mod_perl。

mod_perl has to be configured in your httpd.conf to be enabled. So not every script on your server will start to use mod_perl automatically.

通常情况下,你让每虚拟主机的mod_perl。的mod_perl的一个虚拟主机通常的配置是这样的:

Usually, you enable mod_perl per VHost. A usual configuration of mod_perl for a vhost looks like this:

<VirtualHost some.funny-domain.com>  
    ServerName some.funny-domain.com
    ServerAdmin admin@funny-domain.com
    DocumentRoot /data/path/to/root/
    Perlrequire /data/path/to/startup.pl
    PerlModule Apache2::Reload
    PerlInitHandler Apache2::Reload
    PerlModule Apache2::RequestRec

    ScriptAlias /cgi-bin/ "/data/path/to/root/cgi-bin/"

    <Location /cgi-bin/>
            SetHandler perl-script
            PerlResponseHandler ModPerl::Registry
            PerlOptions +ParseHeaders
            PerlOptions +SetupEnv
            Options +ExecCGI
    </Location>
    CustomLog logs/access.log combined
    ErrorLog logs/error.log
</VirtualHost>

要当心与自动安装过程!它可能错误的主机由于某种原因上启用的mod_perl!备份您的配置和Apache的安装首先要能够回滚很容易。

Be carefull with the automated install-process! It may enable mod_perl on the wrong host for some reason! BackUp your config and apache-installation first to be able to "roll back" easily.

注释:该生产线的 Perlrequire /data/path/to/startup.pl 的不是必需的。它是可选的,并设置一些环境变量的mod_perl的ENV下运行脚本。

Comment: The line "Perlrequire /data/path/to/startup.pl" is not required. It is optional and sets some environment variables for the running scripts under the mod_perl env.

这篇关于做CGI和mod_perl的发挥很好地在一起吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆