关于我们

质量为本、客户为根、勇于拼搏、务实创新

< 返回新闻公共列表

云服务器在apache下添加fastcgi模块

发布时间:2021/2/28 23:47:07
香港云服务器
1、搭建环境
CentOS5.1,系统只带的apache2.23,默认的apache安装没有带fastcgi模块,要自己手动添加

2、下载
# wget http://www.fastcgi.com/dist/mod_fastcgi-2.4.6.tar.gz

3、安装
# tar zxf mod_fastcgi-2.4.6.tar.gz
# cd mod_fastcgi-2.4.6
# apxs -o mod_fastcgi.so -c *.c
# apxs -i -a -n fastcgi .libs/mod_fastcgi.so
看看modules是否有mod_fastcgi.so,看看httpd.conf文件里是否有mod_fastcgi.so
再看看httpd.conf里是否有下面这行,没有加上
AddHandler fastcgi-script .fcg .fcgi .fpl


PS:所有都是看源安装目录下的INSTALL文件。

4、apache相关配置




  1.     FastCgiWrapper /usr/local/apache/bin/suexec
  2.     # URIs that begin with /fcgi-bin/, are found in /var/www/fcgi-bin/
  3.     Alias /fcgi-bin/ /var/www/fcgi-bin/
  4.     ScriptAlias /wws /var/www/fcgi-bin/b.fcgi
  5.     # Anything in here is handled as a "dynamic" server if not defined as "static" or "external"
  6.    
  7.                 AllowOverride None
  8.                 Options +ExecCGI -Includes
  9.                 #SetHandler fastcgi-script
  10.                 AddHandler fastcgi-script .fcg .fcgi
  11.                 Order allow,deny
  12.                 Allow from all
  13.    
  14.  
  15.     # Anything with one of these extensions is handled as a "dynamic" server if not defined as
  16.     # "static" or "external". Note: "dynamic" servers require ExecCGI to be on in their directory.
  17.     #AddHandler fastcgi-script .fcgi .fpl
  18.  
  19.     # Start a "static" server at httpd initialization inside the scope of the SetHandler
  20.     #FastCgiServer /var/www/fcgi-bin/echo -processes 3
  21.  
  22.     # Start a "static" server at httpd initialization inside the scope of the AddHandler
  23.     #FastCgiServer /var/www/fcgi-bin/b.fcgi -processes 3 -user nobody -group nobody
  24.     #FastCgiServer /var/www/htdocs/some/path/echo.fcgi
  25.     # Start a "static" server at httpd initialization outside the scope of the Set/AddHandler
  26.     #FastCgiServer /var/www/htdocs/some/path/coolapp
  27.     #
  28.     # SetHandler fastcgi-script
  29.     #
  30.  
复制代码