munin running on nginx (ubuntu)

apt-get install nginx libfcgi-perl wget
mv -v /etc/nginx/sites-available/default /etc/nginx/sites-available/default.old
vi /etc/nginx/sites-available/default

server {
listen 80;
server_name linux4you.tk www.linux4you.tk;
root /var/www/linux4you.tk;
access_log /var/www/logs/example.com.access.log;

location / {
index index.html index.htm index.pl;
}

location ~ \.pl|cgi$ {
try_files $uri =404;
gzip off;
fastcgi_pass 127.0.0.1:8999;
fastcgi_index index.pl;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}

mkdir /var/www/linux4you.tk
chown -R www-data:www-data /var/www/linux4you.tk

If you want enlarge your munin grahics, you need install fastcgi:

wget –spider -v http://nginxlibrary.com/downloads/perl-fcgi/fastcgi-wrapper | grep exists

If exists run:

wget http://nginxlibrary.com/downloads/perl-fcgi/fastcgi-wrapper -O /usr/bin/fastcgi-wrapper.pl
wget http://nginxlibrary.com/downloads/perl-fcgi/perl-fcgi -O /etc/init.d/perl-fcgi
chmod +x /usr/bin/fastcgi-wrapper.pl
chmod +x /etc/init.d/perl-fcgi
update-rc.d perl-fcgi defaults
insserv perl-fcgi

service nginx start
service perl-fcgi start

vi /var/www/linux4you.tk/index.pl
#!/usr/bin/perl

print "Content-type:text/html\n\n";
print <Perl Environment Variables

Perl Environment Variables

EndOfHTML

foreach $key (sort(keys %ENV)) {
print "$key = $ENV{$key}
\n";
}

print "";

chmod 755 /var/www/linux4you.tk/index.pl

Leave a Reply

Your email address will not be published. Required fields are marked *