Clam AntiVirus (ClamAV) is a free, cross-platform antivirus software tool-kit able to detect many types of malicious software, including viruses. One of its main uses is on mail servers as a server-side email virus scanner. The application was developed for Unix and has third party versions available for AIX, BSD, HP-UX, Linux, Mac OS X, OpenVMS, OSF (Tru64) and Solaris.
To install ClamAV antivirus on CentOS 6.0 along with automatic updates and a nightly full system scan please use the following process:
1. Change to your SRC install directory:
cd /usr/local/src/
For 32 bit:
wget http://pkgs.repoforge.org/clamav/clamav-0.97.1-1.el6.rf.i686.rpm wget http://pkgs.repoforge.org/clamav/clamav-db-0.97.1-1.el6.rf.i686.rpm wget http://pkgs.repoforge.org/clamav/clamav-devel-0.97.1-1.el6.rf.i686.rpm wget http://pkgs.repoforge.org/clamav/clamd-0.97.1-1.el6.rf.i686.rpm
OR
For 64 bit:
wget http://pkgs.repoforge.org/clamav/clamav-0.97.1-1.el6.rf.x86_64.rpm wget http://pkgs.repoforge.org/clamav/clamav-db-0.97.1-1.el6.rf.x86_64.rpm wget http://pkgs.repoforge.org/clamav/clamav-devel-0.97.1-1.el6.rf.x86_64.rpm wget http://pkgs.repoforge.org/clamav/clamd-0.97.1-1.el6.rf.x86_64.rpm
2. Install ClamAV
rpm -Uvh clam*
3. Run Freshclam to download the newest files:
/usr/bin/freshclam -v
4. Configure ClamAV auto-updates:
vi /var/log/freshclam.log chmod 600 /var/log/freshclam.log chown clamav /var/log/freshclam.log
5. Add a update schedule to /etc/crontab
echo "3 * * * * /usr/bin/freshclam --quiet" >> /etc/crontab
6. Create a daily ClamAV scan schedule:
echo "/usr/bin/freshclam" >> /etc/cron.daily/clamav-scan echo "/usr/bin/freshclam" >> /etc/cron.daily/clamav-scan
Make the file executable:
chmod 755 /etc/cron.weekly/clamav-scan
7. That is all and now have ClamAV installed, scheduled to update once every hour and run a full daily scan of your system. A report will be sent in your nightly cron of any issues identified.