Monthly Archives: February 2015

Error: rpmdb open failed: Fedora

Error:

[root@localhost ~]# yum clean all
error: db5 error(11) from dbenv->open: Resource temporarily unavailable
error: cannot open Packages index using db5 – Resource temporarily unavailable (11)
error: cannot open Packages database in /var/lib/rpm
CRITICAL:yum.main:

Error: rpmdb open failed

Fix:
cp -a /var/lib/rpm/ /var/lib/rpm___
rm -rf /var/lib/rpm/__db*
rpm –rebuilddb
yum update

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