您的位置:首页 >> 操作系统 >> Linux >> Linux应用技巧 >> 正文
Linux应用技巧 RSS
 

在UNIX/Linux下安装FastCGI的方式

http://www.rdxx.com 03年09月07日 08:35 互连网 我要投稿

标签: 方式 , UNIX , Linux , FastCGI , 安装 , CGI
 

  在Unix/Linux安装FastCGI起来比较复杂。现在就在这里讲一下,在Unix/Linux系统下,Perl语言,Apache服务器环境下安装FastCGI。
  
  Apache里FCGI的模块:
  1、下载http://www.fastcgi.com/dist/mod_fastcgi.tar.gz
  2、解压apache安装文件。解压fastcgi安装文件到apache下的/src/modules/fas tcgi目录
  3、设定Apache加入mod_fastcgi模块:
  ./configure --activate-module=src/modules/fastcgi/libfastcgi.a --enabl e-module=info --enable-shared=info
  4、编译及安装
  $ make
  $ make install
  5、查看编译出来的执行文件是否含有 mod_fastcgi 模块:
  $ apacherunpath/httpd -l
  Compiled-in modules:
  http_core.c
  ...
  mod_fastcgi.c
  ...
  6、加入使用 mod_fastcgi 的相关设定
  编辑httpd.conf加入AddHandler fastcgi-script .fcg .fpl这一行建立youwwwpath/fcgi-bin目录,设置/fcgi-bin/目录指到youwwwpath/fcgi-bin /在httpd.conf加入ScriptAlias /fcgi-bin/ /usr/local/www/fcgi-bin/
  7、检测语法错误
  $ /apachepath/apachectl configtest
  Syntax OK --系统显示
  8、重新激活阿帕契服务器,让新设定生效:
  $ /usr/local/apache/sbin/apachectl graceful
  /usr/local/apache/bin/apachectl graceful: httpd gracefully restarted --系统显示
  
  PERL的FCGI模块:
  1、首先我们安装FastCGI在Perl下的模块。最新版本在http://www.fastcgi.com里下载。
  最新版本:FCGI-0.56.tar.gz
  2、下载 FCGI-0.45.tar.gz 并且解开
  $ gunzip -c FCGI-0.56.tar.gz | tar xvf -
  3、编译及安装
  $ perl Makefile.PL
  $ make
  $ make install
  4、测试
  $ cp echo.fpl {你www里Fastcgi所在目录}
  $ lynx {你www里echo.fpl的地址}
  
  如果顺利的话,应该会看到如下的结果:
  FastCGI echo (Perl)
  Request number 1
  No data from standard input.
  Request environment:
  
  DOCUMENT_ROOT=/usr/local/apache/htdocs
  FCGI_ROLE=RESPONDER
  GATEWAY_INTERFACE=CGI/1.1
  HTTP_ACCEPT=text/html, text/plain, application/applefile, application/
  x-metamai
  l-patch, sun-deskset-message, mail-file, default, postscript-file, aud
  io-file,
  x-sun-attachment, text/enriched, text/richtext, application/andrew-ins
  et, x-be2
  , application/postscript, message/external-body, message/partial, appl
  ication/p
  gp, application/pgp, video/mpeg, video/*, image/*, audio/*, audio/mod,
  text/sgm
  l, video/mpeg, image/jpeg, image/tiff, image/x-rgb, image/png, image/x
  -xbitmap,
  image/x-xbm, image/gif, application/postscript, */*;q=0.01
  HTTP_ACCEPT_ENCODING=gzip, compress
  HTTP_ACCEPT_LANGUAGE=en
  HTTP_HOST=localhost
  HTTP_NEGOTIATE=trans
  HTTP_USER_AGENT=Lynx/2.8.1pre.9 libwww-FM/2.14
  PATH=/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/sbin:/opt/kde/bi
  n:/home/m
  yhsu/bin:/usr/X11R6/bin:/usr/sbin:/opt/kde/bin:/usr/X11R6/bin:/usr/sbi
  n:/opt/kd
  e/bin
  QUERY_STRING=
  REMOTE_ADDR=127.0.0.1
  REMOTE_PORT=1427
  REQUEST_METHOD=GET
  REQUEST_URI=/fcgi-bin/echo.fpl
  SCRIPT_FILENAME=/usr/local/www/fcgi-bin/echo.fpl
  SCRIPT_NAME=/fcgi-bin/echo.fpl
  SERVER_ADMIN=myhsu@localhost.localdomain
  SERVER_NAME=localhost.localdomain

9 7 3 1 2 4 8 :


 
 
打印本文
 
 
  热点搜索
 
 
 



Valid XHTML 1.0 Transitional
Copyright ©2005 - 2008 Rdxx.Com,All Rights Reserved
收藏本页
收藏本站