install ClamAV antivirus on CentOS 6.0

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/src

2. Download the ClamAV installation package, ClamAV database, ClamAV development libraries and ClamAV daemon for your operating system type (32 bit of 64 bit):

For 32 bit:

# wget http://pkgs.repoforge.org/clamav/clamav-0.97.1-1.el6.rf.i686.rpm http://pkgs.repoforge.org/clamav/clamav-db-0.97.1-1.el6.rf.i686.rpm http://pkgs.repoforge.org/clamav/clamav-devel-0.97.1-1.el6.rf.i686.rpm http://pkgs.repoforge.org/clamav/clamd-0.97.1-1.el6.rf.i686.rpm

For 64 bit:

# wget http://pkgs.repoforge.org/clamav/clamav-0.97.1-1.el6.rf.x86_64.rpm http://pkgs.repoforge.org/clamav/clamav-db-0.97.1-1.el6.rf.x86_64.rpmhttp://pkgs.repoforge.org/clamav/clamav-devel-0.97.1-1.el6.rf.x86_64.rpm http://pkgs.repoforge.org/clamav/clamd-0.97.1-1.el6.rf.x86_64.rpm

3. Install ClamAV

# rpm -Uvh clam*

4. Run Freshclam to download the newest pattern files:

# /usr/bin/freshclam -v

5. Configure ClamAV auto-updates:

# touch /var/log/freshclam.log
# chmod 600 /var/log/freshclam.log
# chown clamav /var/log/freshclam.log

6. Add a update schedule to /etc/crontab

# nano -w /etc/crontab

Add a line at the bottom of the crontab:

3 * * * * /usr/bin/freshclam --quiet

Then press CTRL+X then type: Y then Enter.

7. Create a daily ClamAV scan schedule:

# nano -w /etc/cron.daily/clamav-scan

Paste the following in the file:

/usr/bin/freshclam
/usr/bin/clamscan -ri /

Then press CTRL+X then type: Y then Enter.

Make the file exectuable:

# chmod +x /etc/cron.weekly/clamav-scan

8. That’s it, you 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.

Leave a Reply