CartMetrix - Do you know yours?

9/10/2007

rpmdb: unable to join the environment

This weekend I was contacted by a client regarding a server that had run out of room on the main hard drive. Among the things that were corrupted by the drive filling up was the RPM database.

When trying to query of upgrade any package, the error message

rpmdb: unable to join the environment
error: db4 error(11) from dbenv->open: Resource temporarily unavailable
error: cannot open Packages index using db3 - Resource temporarily unavailable (11)
error: cannot open Packages database in /var/lib/rpm
warning: /root/webmin-1.360-1.noarch.rpm: V3 DSA signature: NOKEY, key ID 11f63c51
rpmdb: unable to join the environment
error: db4 error(11) from dbenv->open: Resource temporarily unavailable
error: cannot open Packages database in /var/lib/rpm
rpmdb: unable to join the environment
error: db4 error(11) from dbenv->open: Resource temporarily unavailable
error: cannot open Packages database in /var/lib/rpm

A search turned up this howto on repairing the db.

These two commands made quick work of the fix. First remove any old lock files:

rm -f /var/lib/rpm/__db*

Then rebuild the RPM database:

rpm -vv --rebuilddb

Popularity: 83%

8/7/2007

SSH-Keygen For Public Key Authentication

ssh-keygen -t dsa -b 1024
[root@titan .ssh]# ssh-keygen -t dsa -b 1024
Generating public/private dsa key pair.
Enter file in which to save the key (/root/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_dsa.
Your public key has been saved in /root/.ssh/id_dsa.pub.
The key fingerprint is:
d2:32:02:4e:25:27:53:8f:c1:ab:80:02:0f:25:da:af root@host.domain.com

Then copy in any public keys into ~/.ssh/authorized_keys

Popularity: 38%

Lighttpd vs thttpd Update3

I have been asked several times recently about my original comparison of Lighttpd and thttpd and subsequent benchmarks for Lighttpd vs thttpd.

I do not have updated benchmarks for these two. However, Lighttpd is still under active development with the latest release Lighttpd 1.4.16 dated 7/24/07. The most recent thttpd release has a newest file date of 6/29/05 (I couldn’t find an official release date for thttpd 2.25b). I would surmise that the performance for Lighttpd would only have increased as it is still under active development. Without a new release, thttpd’s performance surely hasn’t changed since my benchmark.

Popularity: 33%

7/7/2007

Plesk Qmail and Remote Black Lists (or Plesk says Qmail not started)

With the recent increase in SPAM volume, I have had two clients contact me with Qmail problems on Plesk servers. The error they were receiving was in the status page of the Plesk admin panel. Under the status line for Qmail, Plesk said

Qmail not started

Several attempts to restart Qmail produced the same results. Restart the server… still no Qmail. Looking through the Qmail settings in Plesk I noticed the server owner had ticked _all_ RBL. Each blacklist check requires a distinct call to the specified RBL service for every email. A busy server with many domains might have several thousand email addresses on it. With only a hundred SPAMs a day to each email address (I get 400+ a day on my main accounts), its easy to see how Qmail could get worked over with a million RBL checks a day. Not to mention the load added to the RBL servers themselves.

I un-ticked all but two RBL checks and Qmail started right up. There is a limit to how many RBL services Plesk Qmail can support. I would recommend only a couple. If many SPAMs are still getting through select a few different ones, don’t just blindly add more checks. More is not always better. Sometimes more is just more. I suggest testing various combinations until you find the best for your server and users.

Another worthwhile note is that these RBLs sometimes go away or are inaccessible for a period of time. If you are trying to use one that is down, all of your mail will be delayed while each attempt has to time out before Qmail can process the mail further. If you have problems with sluggish mail check the sites of the RBLs in use to verify they are indeed active.

Popularity: 27%

6/28/2007

Exim Queue Snippets

These are all useful when trying to track down an open formmail script.

List bounce messages

exiqgrep -f ‘^<>$’

Freeze bounce messages

exiqgrep -i -f ‘^<>$’ | xargs exim -Mf

Freeze messages from user@domain.com

exiqgrep -i -f user@domain.com| xargs exim -Mf

Find out what user your webserver runs as. Use this as the email address to key on. For example, my Apache runs as nobody so I want to freeze all messages sent from the user nobody@domain.com so I can look through them to see if I can deduce where the insecure formmail script is.

Delete frozen messages

exiqgrep -z -i | xargs exim -Mrm

Popularity: 27%

6/27/2007

Recursive Chmod Tricks

Recursively chmod only directories

find . -type d -exec chmod 755 {} \;

Similarly, recursively set the execute bit on every directory

chmod -R a+X *

The +X flag sets the execute bit on directories only

Recursively chmod only files

find . -type f -exec chmod 644 {} \;

Recursively chmod only PHP files (with extension .php)

find . -type f -name ‘*.php’ -exec chmod 644 {} \;

Popularity: 32%

Next Page »


damonparker.org is proudly powered by WordPress
Entries (RSS) and Comments (RSS).

copyright © 2002-2008 damonparker.org. all rights reserved.

Close
E-mail It