cPanel, ClamAV and MailScanner

This is totally for my information in the future, but might be useful to somebody.

I have MailScanner installed (via this great package) and ClamAV setup to scan mail that comes through this server. The problem is that lately, ClamAV was sucking up a lot of CPU power when scanning messages. After a ton of searching around on the cPanel forums, I basically came up with this solution which dropped my load considerably. But long story short, you’re changing Mailscanner to use the clamavmodule virus scanner versus the clamav one.

  • Run these comments from the command line (if you don’t know what they do, don’t bother with this at all):

    up2date -i bzip2-devel

    up2date -i gdbm-devel

    /scripts/perlinstaller Mail::ClamAV

  • Edit your MailScanner.conf (probably in /usr/mailscanner/etc/MailScanner.conf). Look for “Virus Scanners = clamav” and change it to “Virus Scanners = clamavmodule”.
  • Then run “killall MailScanner”, wait a bit to make sure all the child processes are killed, and then “/usr/mailscanner/bin/check_mailscanner”.

So far, the load on the server has gone down significantly (at least so far) and made pages load faster as now Apache and MySQL have more breathing room.

Comments

Random cPanel Link Dump

As I’ve mentioned before, I use cPanel on my Web server. I’ve posted links before for using clamavmodule in Mailscanner, completely removing boxtrapper, among a few other things. So here…