發新話題

如何安裝FastCGI

如何安裝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
  • 訪客無法瀏覽此圖片或連結,請先 註冊登入會員 下載mod_fastcgi-2.4.2-AP20.dll(如果是Apache版本為1.3,下載mod_fastcgi-2.4.2-AP13.dll)。
  • 遵從訪客無法瀏覽此圖片或連結,請先 註冊登入會員 最下面的一段話: 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 訪客無法瀏覽此圖片或連結,請先 註冊登入會員 , 參考此文檔在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/perluse 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所寫。
  • 訪客無法瀏覽此圖片或連結,請先 註冊登入會員

TOP

發新話題

本站所有圖文均屬網友發表,僅代表作者的觀點與本站無關,如有侵權請通知版主會盡快刪除。