不做第二个别人,永远做第一个自己。
分类: LINUX
2014-04-10 11:16:24
nginx 结合 perl
Configure Nginx to execute Perl script.
This example shows to use fcgiwrap + spawn-fcgi. |
安装一些辅助软件包!
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; } 这个看起来是不是和php的有点像呢??
# /etc/rc.d/init.d/nginx restart
Stopping nginx: [ OK ]
Starting nginx: [ OK ]
Starting spawn-fcgi: [ OK ]
# chkconfig spawn-fcgi on
创建一个cgi的脚本
# vim /usr/share/nginx/html/index.cgi
#!/usr/bin/perl print "Content-type: text/html\n\n"; print "\n\n"; print "\n"; print "CGI Test Page"; print "\n\n"; print " \n\n";