cd /usr/local/src
If you have a previous version of ClamAV on your system, you will first need to remove it
(in reverse order of installation), for example:
rpm -e clamd-0.88.2
The system will save copies of your config files. You may choose to use the old clamd.conf,
or reconfigure the new one (preferred). Remember to add the clamav user to the amavisd user's group as
described below.
Now you can install (and configure) the new version:
rpm -Uvh clamav-db-0.88.3-1.rh9.rf.i386.rpm |
If you would like to use the default TCPSocket method of communication, then
you do not necessarily need to make changes to the supplied clamd.conf. The default
in our Dag Wieers clamd.conf is 'TCPSocket 3310' and 'TCPAddr 127.0.0.1'. Simply skip to the next
section. If you would like to use the LocalSocket method, then: vi /etc/clamd.conf Uncomment 'LocalSocket /var/run/clamav/clamd.sock' Comment out 'TCPSocket 3310' Save and exit. Here we use LocalSocket instead of TCPSocket. These settings cannot be used together. |
Let's add the 'clamav' user to the 'amavis' group; modify if your group is 'vscan' or some other name:gpasswd -a clamav amavis |
groups clamav
'/var/run/clamav/clamd.sock'
which is the file
that the two programs use to talk to each other (the Unix socket). If using TCPSocket / TCPAddr,
the value would be '127.0.0.1:3310'.
vi /etc/amavisd.conf To enable virus scanning, comment out: @bypass_virus_checks_acl = qw( . ); You may need to uncomment the ClamAV section: ['Clam Antivirus-clamd', \&ask_daemon, ["CONTSCAN {}\n", '/var/amavis/clamd'], qr/\bOK$/, qr/\bFOUND$/, qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],If you choose to use LocalSocket as opposed to TCPSocket: Notice the value after CONTSCAN in this example above is currently '/var/amavis/clamd' Edit this to reflect what our LocalSocket is set to, which in our case is: '/var/run/clamav/clamd.sock' If you choose to use TCPSocket instead of LocalSocket, edit the value after CONTSCAN like so: ['Clam Antivirus-clamd', \&ask_daemon, ["CONTSCAN {}\n", '127.0.0.1:3310'], qr/\bOK$/, qr/\bFOUND$/, qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],You should take a look at these items in amavisd.conf and modify them to meet your needs (my personal settings are shown): $final_virus_destiny = D_DISCARD; # I created a new mailbox to accommodate this.$mailfrom_notify_admin = "postmaster\@$mydomain";
|
Start clamd using the command:clamd Run freshclam using the command: freshclam Stop amavisd-new: amavisd stop Start up amavisd-new in debug mode: amavisd debug Now test the system by sending the email containing the eicar test virus through the system. You should see: Clam Antivirus-clamd: Connecting to socket and: INFECTED (Eicar-Test-Signature)
If all goes well, stop debug mode with [Ctrl]+c and restart amavisd-new: amavisd start |
vi /etc/cron.d/freshclam And insert the following: MM * * * * clamav [ -x /usr/bin/freshclam ] && /usr/bin/freshclam --quiet Replace MM with a number between 1 and 59. It is best not to use the digit "0" |
/var/log/clamav/clamd.log
and /var/log/clamav/freshclam.log
. It is a good idea to insure
the daily freshclam cron job and the hourly freshclam cron job do not
run at exactly the same time.