Install ClamAV Antivirus

Install EPEL repo:

For CentOS 6 32-bit execute command:
rpm -Uvh
For CentOS 6 64-bit execute command:

rpm -Uvh

Install required packages:

yum install clamav clamd

Start the clamd service and set it to auto-start
/etc/init.d/clamd on
chkconfig clamd on
/etc/init.d/clamd start
Update ClamAV's signatures:


Note: ClamAV will update automatically, as part of /etc/cron.daily/freshclam.

Configure daily scan

In this example, we will configure a cronjob to scan the /var/www directory every day. Create cron file:

nano /etc/cron.daily/man_clamscan

Add the following to the file above. Be sure to change SCAN_DIR to the directory that you want to scan:
/usr/bin/clamscan -i -r $SCAN_DIR >> $LOG_FILE
Give our cron script executable permissions:

chmod +x /etc/cron.daily/man_clamscan

That's it.
Sign In or Register to comment.