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相关配置
<IfModule mod_fastcgi.c> FastCgiWrapper /usr/local/apache/bin/suexec # URIs that begin with /fcgi-bin/, are found in /var/www/fcgi-bin/ Alias /fcgi-bin/ /var/www/fcgi-bin/ ScriptAlias /wws /var/www/fcgi-bin/b.fcgi # Anything in here is handled as a "dynamic" server if not defined as "static" or "external" <Directory /var/www/fcgi-bin/> AllowOverride None Options +ExecCGI -Includes #SetHandler fastcgi-script AddHandler fastcgi-script .fcg .fcgi Order allow,deny Allow from all </Directory>
# Anything with one of these extensions is handled as a "dynamic" server if not defined as # "static" or "external". Note: "dynamic" servers require ExecCGI to be on in their directory. #AddHandler fastcgi-script .fcgi .fpl
# Start a "static" server at httpd initialization inside the scope of the SetHandler #FastCgiServer /var/www/fcgi-bin/echo -processes 3
# Start a "static" server at httpd initialization inside the scope of the AddHandler #FastCgiServer /var/www/fcgi-bin/b.fcgi -processes 3 -user nobody -group nobody #FastCgiServer /var/www/htdocs/some/path/echo.fcgi # Start a "static" server at httpd initialization outside the scope of the Set/AddHandler #FastCgiServer /var/www/htdocs/some/path/coolapp #<Directory /var/www/htdocs/some/path/coolapp> # SetHandler fastcgi-script #</Directory>
</IfModule>
|
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。