如何安装FastCGI

Intro
此文并非介绍FastCGI的好处,只是简单的介绍我的一次安装过程。
我的Env为 Win2000+SP4, Apache/2.0.50 (Win32) mod_perl/1.99_15-dev Perl/v5.8.4 mod_ssl/2.0.50 OpenSSL/0.9.7d PHP/4.3.7
$Apache_dir = "C:/Apache2"; $Perl_dir = "C:/usr";
Step by step
http://www.fastcgi.com/dist/ 下载mod_fastcgi-2.4.2-AP20.dll(如果是Apache版本为1.3,下载mod_fastcgi-2.4.2-AP13.dll)。
遵从http://www.fastcgi.com/mod_fastcgi/INSTALL最下面的一段话:
To install mod_fastcgi (built above or retrieved from
http://fastcgi.com/dist/):

  1. Copy the mod_fastcgi.dll to the Apache modules directory
     (e.g. C:/Apache/modules)

  2. Edit the httpd configurion file (e.g. C:/Apache/conf/httpd.conf)
     and add a line like:

     LoadModule fastcgi_module modules/mod_fastcgi.dll

     Note that if there's a ClearModuleList directive after new entry,
     you'll have to either move the LoadModule after the ClearModuleList
     or add (have a look at how the other modules are handled):

     AddModule mod_fastcgi.c

  3. Edit the httpd configuration file(s) to enable your FastCGI
     application(s).  See docs/mod_fastcgi.html for details.
简单翻译为
  1. 拷贝 mod_fastcgi.dll(我们下来的mod_fastcgi-2.4.2-AP*.dll,将其改名) 至Apache modules(模块)目录
     (如 C:/Apache/modules)

  2. 编辑httpd配置文件 (如 C:/Apache/conf/httpd.conf)
     然后增加如下一行:

     LoadModule fastcgi_module modules/mod_fastcgi.dll

     注意如果在此句以后出现 ClearModuleList 指示/directive,你必须要么移动LoadModule到ClearModuleList下面或增加(参考其他handled模块):

     AddModule mod_fastcgi.c

  3. 编辑httpd配置文件去启动你的FastCGI程序。更详细的请参考 docs/mod_fastcgi.html
visit http://www.fastcgi.com/mod_fastcgi/docs/mod_fastcgi.html, 参考此文档在httpd.conf里增加:

<Directory "E:/Fayland/fcgi-bin">
 SetHandler fastcgi-script
 AddHandler fastcgi-script fcg fcgi fpl
 Options +ExecCGI
</Directory>
不要下载FCGI.pm-0.64-win32-x86.zip,可以cpan或ppm FCGI安装FCGI.pm和相关文件。
测试代码:(E:/Fayland/fcgi-bin/test.fpl)
#!/usr/bin/perl
use FCGI;
use strict;

my $count = 0;
my $request = FCGI::Request();

while($request->Accept() >= 0) {
 $count++;
 print "Content-type:text/html/n/n";
 print "total request $count";
}
visit: http://localhost/fcgi-bin/test.fpl.
Refer
搜索"Fastcgi中文参考手册",此文档由hoowa所写。
http://www.fastcgi.com/devkit/doc/fastcgi-prog-guide/ch3perl.htm#3659 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值