wget http://www.nginx.eu/nginx-fcgi/nginx-fcgi.txt
mv nginx-fcgi.txt nginx-fcgi.pl
mv nginx-fcgi.pl /usr/bin/
chmod 777 /usr/bin/nginx-fcgi.pl
perl -MCPAN -e shell
cpan> install FCGI
cpan> install IO::All
cpan> install Socket
nginx-fcgi.pl -l /tmp/nginx-fcgi.log -pid /tmp/nginx-fcgi.pid -S /tmp/nginx-fcgi.sock
chmod 777 /tmp/nginx-fcgi.*
vi /etc/nginx/vhosts/nagios.conf
server
{
listen 80;
server_name www.server110.com;
index index.php index.html index.htm;
root /usr/local/nagios/share;
location ~ .*.php?$
{
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /usr/local/nagios/share$fastcgi_script_name;
}
location /nagios/
{
gzip off;
alias /usr/local/nagios/share/;
index index.html index.htm index.php;
}
location ~ .cgi$ {
rewrite ^/nagios/cgi-bin/(.*).cgi /$1.cgi break;
fastcgi_pass unix:/tmp/nginx-fcgi.sock;
fastcgi_index index.cgi;
fastcgi_param SCRIPT_FILENAME /usr/local/nagios/sbin$fastcgi_script_name;
fastcgi_param HTTP_ACCEPT_LANGUAGE en_US;
include fastcgi_params;
}
location ~ .pl$ {
fastcgi_pass unix:/tmp/nginx-fcgi.sock;
fastcgi_index index.pl;
fastcgi_param SCRIPT_FILENAME /usr/local/nagios/sbin$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
}
声明: 此文观点不代表本站立场;转载须要保留原文链接;版权疑问请联系我们。