Bước 1: Cài perl

yum --enablerepo=epel -y install spawn-fcgi fcgi-deve
yum -y groupinstall "Development Tools" 

Bước 2: Cài fcgiwrap

wget http://github.com/gnosek/fcgiwrap/tarball/master -O fcgiwrap.tar.gz  
tar zxvf fcgiwrap.tar.gz  
cd gnosek-fcgiwrap-*  
autoreconf -i  
./configure  
make 
make install

Bước 3: Cấu hình

vi /etc/sysconfig/spawn-fcgi 
# add at the last
OPTIONS="-u nginx -g nginx -a 127.0.0.1 -p 9001 -P /var/run/spawn-fcgi.pid -- /usr/local/sbin/fcgiwrap"

- Mở file vhost thêm vào

location ~ \.pl|cgi$ {
        fastcgi_pass   127.0.0.1:9001;
        fastcgi_index  index.cgi;
        fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include        /etc/nginx/fastcgi_params;
    }


- Khởi động lại nginx

service nginx restart 
/etc/rc.d/init.d/spawn-fcgi start  
chkconfig spawn-fcgi on

Đăng nhận xét Blogger

 
Top