First step: ClamAV download
Http://www.clamav.net/downloads
#yuminstall Wget–y
Step Two: Create ClamAV users and Groups
Groupaddclamav (Create ClamAV Group)
Useradd-g ClamAV ClamAV (create ClamAV user and join ClamAV Group)
<ignore_js_op>
Step three: Compile and install
Tar xfclamav-0.99.2.tar.gz
cdclamav-0.99.2
<ignore_js_op>
Install dependent packages
Yuminstall gcc OpenSSL openssl-devel-y
<ignore_js_op>
./configure--prefix=/usr/local/clamav
Make&&make Install
Fourth Step: Configure
Mkdir/usr/local/clamav/logs (log storage directory)
Touch/usr/local/clamav/logs/clamd.log
Touch/usr/local/clamav/logs/freshclam.log
Mkdir/usr/local/clamav/updata (clanav virus Library directory)
Chown-r root.clamav/usr/local/clamav/
Chown-r clamav.clamav/usr/local/clamav/updata/
Chown Clamav.clamav/usr/local/clamav/logs/clamd.log
Chown Clamav.clamav/usr/local/clamav/logs/freshclam.log
Cd/usr/local/clamav/etc
CP Clamd.conf.sample clamd.conf
CP Freshclam.conf.sample freshclam.conf
Vim clamd.conf
#Example comment out this line.
Logfile/usr/local/clamav/logs/clamd.log
Pidfile/usr/local/clamav/updata/clamd.pid
Databasedirectory/usr/local/clamav/updata
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Vim freshclam.conf
#Example comment out this line.
Databasedirectory/usr/local/clamav/updata
Updatelogfile/usr/local/clamav/logs/freshclam.log
Pidfile/usr/local/clamav/updata/freshclam.pid
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Fifth step: Upgrade the virus database
/usr/local/clamav/bin/freshclam
The process is long, about half an hour. You can turn on screen to do it.
/usr/local/clamav/bin/clamscan--remove (avira current directory and delete infected files)
Note: Make sure the network is healthy
Sixth Step: Scheduling tasks
Actual production environment Application
General use of scheduled tasks, so that the server every night regularly with new and timed antivirus. Save the antivirus log, my crontab file is as follows
1 3 * * * */usr/local/clamav/bin/freshclam
3 * * */usr/local/clamav/bin/clamscan--infected-r/--remove-l/var/log/clamscan.log
Linux under ClamAV use