额济纳:linux下fcgi安装

来源:百度文库 编辑:九乡新闻网 时间:2024/04/28 16:12:24

1、下载并安装FCGI

wget www.fastcgi.com/dist/fcgi.tar.gz

tar xvzf fcgi-2.4.0.tar.gz

cd fcgi-2.4.0

./configure

make

sudo make install

动态连接库默认安装在/usr/local/lib下,可以修改/etc/ld.so.conf文件,添加/usr/local/lib,然后sudo /sbin/ldconfig。

2、下载安装 mod_fcgid

下载地址:httpd.apache.org/download.cgi

tar xvzf mod_fcgid-2.3.6.tar.gz

cd mod_fcgid-2.3.6

APXS=/usr/sbin/apxs ./configure.apxs

若没找到apxs,请sudo yum install httpd-devel,这样apxs默认安装在/usr/sbin/目录下。

make

sudo make install

3、修改配置文件http.conf

sudo vim /etc/httpd/conf/httpd.conf

在最后添加如下:

ScriptAlias /fcgi-bin/ "/var/www/fcgi-bin/"

SetHandler fcgid-script
Options ExecCGI
Allow from all

其中,/var/www/fcgi-bin/为你fcgi的目录。

最后注意的是,得修改/etc/httpd/logs的权限

chmod 555 /etc/httpd/logs (this is a symlink to /var/httpd/logs),这个问题是我在查看错误日志发现的。

这样FCGI在CentOS下便配置完成。