Pages

Wednesday, March 27, 2013

How to install ClamAV on Linux / Centos

This hopefully should help with your installation of ClamAV.

How to install.
#1. Download the file using wget.
$ sudo wget http://pkgs.repoforge.org/clamav/clamav-0.97.2-1.el5.rf.x86_64.rpm
$ sudo wget http://pkgs.repoforge.org/clamav/clamav-db-0.97.2-1.el5.rf.x86_64.rpm

The following commands should install it.
$ sudo rpm -ivh clamav-0.97.2-1.el5.rf.x86_64.rpm
$ sudo rpm -ivh clamav-db-0.97.2-1.el5.rf.x86_64.rpm


Now that it is installed there are a few things we need to know about ClamAV and perform. First thing to do would be to update the definitions.

To do this run the command freshclam.
Freshclam will require an internet connection to download & update all the new virus definitions.
All that should need to be done is type the command freshclam and the rest should be automatic.

#2. To run ClamAV and show the infected files type the following command.
clamscan -ri /home

#3. To remove the infected files and emails etc... Type the following command.
clamscan -ri --remove /home

#4. To run as a daily Cron Job.
To run ClamAV as a Cron Job (daily automatically scan)Type the following command from your command line.
crontab -e f
Then you should add the following command line and then save the file.
This should add it to my root crontab for the below example.
05 2 * * * root clamscan -R /var/www
This should run the Cron Job daily at 2.05 AM scanning the public_html files.
You should be able to change the folder to whichever folder you prefer.
00 10 * * * * root freshclam
This command will update ClamAV database at 10 am every day.

Good Luck!

Note: For different Operating Systems such as i386, you should be able to find the current RPM at the following link. (Or if you would like the current RPM)
http://pkgs.repoforge.org/clamav/

Current upgrade instructions can usually be found at the following URL.
http://wiki.clamav.net/Main/UpgradeInstructions

Current uninstall instructions can usually be found at the following URL.
http://wiki.clamav.net/Main/UninstallClamAV

1 comment:

  1. This is awesome post which increase my knowledge with such a rich information.
    Window hosting

    ReplyDelete