全部博文(191)
分类: 系统运维
2009-08-06 00:48:46
1:如何让apache执行一个CGI脚本,当然前提是安装Perl程序和mod_Perl模块(CGI脚本加速器),假设这些已经安装。
实现:
在特定的目录下执行CGI程序的能力
=====================================================================================================
Options +ExecCGI
AddHandler cgi.script .pl .cgi
-----------------------------------------------------------------------------------------------------------------------------
Options +ExecCGI
SetHandler cgi.script
===========================================================================================================
粗体字的指令实现相同的功能
ScriptAlias /cgi-bin/ /usr/local/apache2/cgi-bin/
在这个目录下所有的CGI程序被执行
=============================================================================================================
2:SSI(server-side includes ,服务器端嵌入)
有mod_include模块来定义
详情参见
===========================================================================
3:mod_perl模块,解决了CGI允许速度慢的问题,加速了perl程序的解释过程
详情参见
mod_perl is more than CGI scripting on steroids. It is a whole new way to create dynamic content by utilizing the full power of the Apache web server to create stateful sessions, customized user authentication systems, smart proxies and much more. Yet, magically, your old CGI scripts will continue to work and work very fast indeed. With mod_perl you give up nothing and gain so much!
-- Lincoln Stein
上面这个段英文的大意是:使用mod_perl,提升了apache处理cgi程序的速度。
01、如何安装mod_perl 2.0模块
Before building mod_perl 2.0 you need to have its prerequisites installed. If you don't have them, download and install them first, using the information in the following sections. Otherwise proceed directly to the mod_perl building instructions
The mod_perl 2.0 prerequisites are:
安装mod_perl 2.0 的前提是:
Apache (略过)
Apache 2.0 is required. mod_perl 2.0 does not work with Apache 1.3.
(DSO) mod_perl build requires Apache 2.0.47 or higher. build requires Apache 2.0.51 or higher
需要安装apache 2.0 ,(注意版本要求)可以选择DSO安装,或静态安装。
Perl (略过)
先要把perl 5.0安装
现在可以安装mod_perl 2.0:
//////已源码包的方式安装mod_perl模块
tar -xvzf mod_perl-2.0.4.tar.gz
///////////动态安装mod_perl模块
perl Makefile.PL MP_APXS=/usr/local/apache2/bin/apxs
make && make install
LoadModule perl_module modules/mod_perl.so
====================================================================================================