nginx支持perl网页:
注:
该文档基于Redhat/CentOS系统
安装nginx略
先下载fcgi、fcgi-devel、spawn-fcgi rpm并进行安装
tar zxfv fcgiwrap.tar.gz
cd gnosek-fcgiwrap-99c942c
autoreconf -i
./configure
make && make install
vi /etc/sysconfig/spawn-fcgi
OPTIONS="-u nginx -g nginx -a 127.0.0.1 -p 8999 -P /var/run/spawn-fcgi.pid -- /usr/local/sbin/fcgiwrap"
:wq
/etc/init.d/spawn-fcgi start
chkconfig --level 35 spawn-fcgi on
vi /etc/nginx/conf.d/default.conf
location ~ \.pl$
{
include fastcgi_params;
fastcgi_pass 127.0.0.1:8999;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.pl;
}
:wq
service nginx restart
测试页面:
vi /usr/share/nginx/html/test.pl
#!/usr/bin/perl
print "Content-type:text/html\n\n";
print "\n
\n";print "
print "CGI Test Page";
print "\n