Category Archives: Technical

qmail-chkuser Patch

qmail-chkuser is one of the most useful qmail patches available out there. It helps reduce bandwidth usage for spam emails directed to non-existant users by rejecting them at SMTP level. Previous versions of chkuser was named chkusr, I used to use chkuser-0.6 from Bill Shupp‘s website due to its simplicity. The newer version (chkuser — notice the ‘e’) combines several other patches and provides configurable settings. Some people may like this but some (including me) may not. I use many qmail patches and prefer to keep only the patches that I use. I used chkuser for the latest qmail installation I installed and disabled other patches chkuser comes with including logging. Its logging function presented problem with stunnel. Somehow output of the log goes to stunnel instead of the log files causing problem. I looked for a fix on Google and found a similar problem including a fix. My stunnel installation doesn’t have ‘-f’ parameter as suggested by patch author, Antonio Nati, so I decided to disable logging and solved the problem.


I have been using PowerDNS plus PowerAdmin everytime I’m asked to build a web-frontend-enabled DNS system. Unfortunately the developers of PowerAdmin abandoned the project a while ago (last update was in 2004).
Wim Mostrey made an update to the 2 years old out-of-date PowerAdmin in March 2006. His patch introduces two new features for PowerAdmin.
When installing PowerAdmin, make sure that PEAR-DB and MySQL extension for PHP are installed. Otherwise it would produce an error message that’s not helpful (Oops! An error occured!). If those two are installed, then PowerAdmin should work properly.

phpWiki on cPanel

cPanel sucks.. Poorly coded, worded, packaged. Almost-decent documentation, but looks messy and unprofessional. Plesk is much better!
phpWiki won’t run properly when installed from cPanel.
It will print out this error message:
lib/Request.php:299: Warning: ob_start(): output handler ‘ob_gzhandler’ cannot be used after ‘URL-Rewriter’ or something

This can be fixed by uncommenting 1 line in index.php:
define(‘COMPRESS_OUTPUT’, false);

UPDATE: Not sure if this is still valid, since I found this issue in March 2005.

RHEL Apache (Plesk) rebuild

By default, Apache distribution shipped with RHEL is compiled with a hard limit of 300 FDs. A busy server requires a lot more..This is how I increased the FD hard limit based on SW-Soft’s FAQ:
A bit outdated, but that’ll do! 🙂

Add the following line to /etc/sysctl.conf:
fs.file-max = 131072

Run the following shell command:
# sysctl -w fs.file-max=131072

Edit __FD_SETSIZE value in /usr/include/bits/typesizes.h to:
#define __FD_SETSIZE 32768
(before, it is 1024)

Find httpd’s source rpm (try rpmfind or Google) and rebuild the package.
xmlto and pcre-devel are required, install both with up2date.
Other craps will be installed too:
pcre-devel xmlto docbook-dtds docbook-style-xsl passivetex sgml-common tetex xml-common xmltex tetex-fonts tetex-latex
Feel free to remove them once package has been rebuilt.

To rebuild the httpd rpm from the source rpm:
rpmbuild –rebuild sourcerpmfilehere.src.rpm

Once the custom binary rpm is ready, install it with -Uvh –force
Although the rebuild process produces 4 rpm files, I think only the httpd rpm is required.

Restart apache with the following commands:
/usr/local/psa/admin/sbin/websrvmng -a -v (not sure why this is needed)
service httpd restart

Valid for Plesk 7.5.

PowerDNS with Plesk servers

Having separate secondary NS for Plesk servers will be difficult to manage. To ease the process, I came up with an idea of using PowerDNS’ supermasters feature.
Just shove in the IP of the Plesk server, the name of the secondary NS and the server name to the supermasters table.
During initial touch-up of the Plesk server, make sure while modifying the DNS zone template to use THAT Plesk server as the first NS record. Otherwise it would cause problem with wrong SOA name causing PowerDNS not recognizing AXFR sent by the Plesk server.
Also make sure PowerDNS IP is included in the allowed list of AXFR on Plesk!

Some useful queries for PowerDNS’ SQL:
delete records.* from records, domains where records.domain_id = and domains.account = ‘SERVERNAME’;
delete from domains where account = ‘SERVERNAME’;

Valid for Plesk 7.5.