nginx支持perl网页

nginx支持perl网页:

注:
该文档基于Redhat/CentOS系统

安装nginx略

先下载fcgi、fcgi-devel、spawn-fcgi rpm并进行安装

wget http://github.com/gnosek/fcgiwrap/tarball/master -O fcgiwrap.tar.gz

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 "<html>\n<body>\n";
print "<dir style=\"width: 100%; font-size: 40px; font-weight: bold; text-align: center;\">\n";
print "CGI Test Page";
print "\n</div>\n";
print "</body>\n</html>\n";

:wq

chmod 705 /usr/share/nginx/html/test.pl

验证:

http://ip/test.pl

转载于:https://blog.51cto.com/yangzhiming/2154231

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值