ClamAV - Updating Version

Revision as of 20:58, 14 August 2007 by Cfremon (talk | contribs)

Thanks to "Unilogic" AKA: Ben for most of this writeup. Parts have been updated to reflect lastest revision.

If you have no idea how to upgrade or are a little shakey in doing the upgrade yourself, I recommend that you wait for the Zimbra official release.

Note: This was done on Fedora Core 4 minimal install. Also, all the following can be done either as root or as the zimbra user. If you do it all as 'root', make sure you change ownership for the resulting clamav-0.90.2 folder in /opt/zimbra to zimbra:zimbra. This HOWTO also assumes that you are upgrading from 0.90.1 to 0.90.2 Please substitute the versions above for what you are upgrading from and to.

When ClamAV releases a new version and gets out of date, it will complain in its log files as such.

clamd.log shows the following warning:

LibClamAV Warning: ********************************************************

LibClamAV Warning: *** This version of the ClamAV engine is outdated. ***

LibClamAV Warning: *** DON'T PANIC! Read ***

LibClamAV Warning: ********************************************************


freshclam.log shows the following warning:

( Below may be different but will be similer )

Received signal: wake up

ClamAV update process started at Fri May 4 15:44:46 2007

WARNING: Your ClamAV installation is OUTDATED!

WARNING: Local version: 0.90.1 Recommended version: 0.90.2


main.cvd is up to date (version: 42, sigs: 83951, f-level: 10, builder: tkojm)

WARNING: Your ClamAV installation is OUTDATED!

WARNING: Current functionality level = 9, recommended = 10


daily.cvd is up to date (version: 2580, sigs: 7879, f-level: 13, builder: ccordes)

WARNING: Your ClamAV installation is OUTDATED!

WARNING: Current functionality level = 9, recommended = 13



If upgrading from anything below 0.90.x, please refer to: *Updating CLAMAV from version lower than 0.90.0

To update, follow the following: First go grab the latest ClamAV source from (Current Stable Version is 0.90.2 ) Extract it to where ever you please. All this can either be done as root or as the zimbra user. If you do it all as root make sure you change ownership for the resulting clamav folder in /opt/zimbra to zimbra:zimbra.

Assuming that the new clamav version is in the directory: /home/snelson ( substitute your username for 'snelson' )

tar -xvf clamav-0.90.2.tar.gz

cd clamav-0.90.2

Next run configure inside of the clamav extract as following:

./configure --prefix=/opt/zimbra/clamav-0.90.2 --with-user=zimbra --with-group=zimbra

This assumes 'zimbra' is user and group id 'zimbra', change it accordingly to your system to match your zimbra user.

Note: I had to install gmp-devel and bzip2-devel so the configure could find all its header files. Your mileage may very. If you get an error about GNU MP missing install gmp-devel. "yum install gmp-devel", and "yum install bzip2-devel" in Fedora and Red Hat.

If your 'configure' goes well, and make sure it does as you don't really want ClamAV installed without some of its available testing ability being compiled.

Run: make

Assuming there are no errors,

Run: make check and then make install. Again assuming no errors, you now have the new version installed into /opt/zimbra/clamav-0.90.2

Now we compare then copy your old clamd.conf and freshclam.conf from the previous version to the new version directory:

cd /opt/zimbra/clamav-0.90.1/etc/

diff clamd.conf ../../clamav-0.90.2/etc/clamd.conf

diff freshclam.conf ../../clamav-0.90.2/etc/freshclam.conf

Above is just incase you are curious of what we are changing/over writing from the clamav defaults.

cd /opt/zimbra/clamav-0.90.2/etc/

mv clamd.conf

mv freshclam.conf

cd /opt/zimbra/conf

cp clamd.conf /opt/zimbra/clamav-0.90.2/etc/

cp freshclam.conf /opt/zimbra/clamav-0.90.2/etc/

Run: zmcontrol stop to stop Zimbra.

Now need to delete the symbolic link and re-link it to the new install:

cd /opt/zimbra

ls -la 'grep' clamav ( should see 'clamav -> /opt/zimbra/clamav-0.90.1' )

if so:

rm -rf clamav

ln -s /opt/zimbra/clamav-0.90.2 /opt/zimbra/clamav

Create directory /opt/zimbra/clamav/db

mkdir /opt/zimbra/clamav/db

Now you should make sure zimbra owns all of clamav.

chown -R zimbra:zimbra /opt/zimbra/clamav-0.90.2

Next we need to update the virus database.

su zimbra

Run: /opt/zimbra/clamav/bin/freshclam

Need to start Zimbra. Run zmcontrol start

Run zmcontrol status to make sure antivirus is running. If it is, you're good to go.

You should check /opt/zimbra/log/clamd.log for errors, as well as freshclam in the same directory. Also /var/log/zimbra.log. To test out ClamAV I would suggest to send different variations of the EICAR test virus to one of your email addresses. Depending on if you have "Send notice ot recipient" check in Global Settings of the Admin Web UI, the user should receive around 20 email notifications of the emails being quarantined. Don't worry about the two that got through. Apparently ClamAV doesn't check for the techniques. There are although no virii included in those two emails, so it doesn't worry me. You can delete the previous install of clamav once you make sure everything is working. Delete the /opt/zimbra/clamav-0.90.1 directory and everythnig it contains. Again may want to wait a weelk or two to make sure you have the other version working well first.

Jump to: navigation, search