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

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


评论

有免费节点资源,我们会通知你!加入纸飞机订阅群

×
天气预报查看日历分享网页手机扫码留言评论电报频道链接