2005-12-11

如何安装FastCGI

来源: 本站收集整理 作者:佚名 评论 0 条
 

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

  1. 从 http://www.fastcgi.com/dist/ 下载mod_fastcgi-2.4.2-AP20.dll(假如是Apache版本为1.3,下载mod_fastcgi-2.4.2-AP13.dll)。
  2. 遵从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
    
    
  3. 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>
    
    
  4. 不要下载FCGI.pm-0.64-win32-x86.zip,可以cpan或ppm FCGI安装FCGI.pm和相关文件。
  5. 测试代码:(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

(本文仅表明作者个人观点,不代表本站及其管理员立场.) 推荐 收藏 投稿 打印 返回 关闭
上一篇:如何将Perl代码着色  
下一篇:Sqlserver 优化的方法
    评论加载中…
 推荐文章
     

网站首页  -  网站地图 -   站长论坛  -  网站投稿  -    -  网站管理
Copyright © 2008 芜湖站长站 All Rights Reserved 皖ICP备07500611号