2、下载安装
ClamAV的官方下载地址:http://www.clamav.net/download.html
http://nchc.dl.sourceforge.net/project/libpng/zlib/1.2.7/zlib-1.2.7.tar.gz
1)zlib-1.2.7.tar.gz安装# tar xvzf zlib-1.2.7.tar.gz
安装一下gcc编译环境# yum install gc
cd zlib-1.2.7
# CFLAGS="-O3 -fPIC" ./configure --prefix=/usr/local/zlib/
# make && make install
2)添加用户组clamav和组成员clamav
# groupadd clamav
# useradd -g clamav -s /bin/false -c "Clam AntiVirus" clamav
3)安装Clamav-0.99.3
# tar xvzf clamav-0.99.3.tar.gz
# cd clamav-0.99.6
# ./configure --prefix=/opt/clamav --disable-clamav -with-zlib=/usr/local/zlib
# make
# make install
3、配置Clamav
1)创建目录
# mkdir /opt/clamav/logs
# mkdir /opt/clamav/updata
2)创建文件
# touch /opt/clamav/logs/freshclam.log
# touch /opt/clamav/logs/clamd.log
# cd /opt/clamav/logs
# ls -lrt 【按时间排序从旧到新】
total 0
-rw-r--r-- 1 root root 0 Feb 5 16:29 freshclam.log
-rw-r--r-- 1 root root 0 Feb 5 16:29 clamd.log
3)更改属主
# chown clamav:clamav clamd.log
# chown clamav:clamav freshclam.log
# ls -lrt
total 0
-rw-r--r-- 1 clamav clamav 0 Feb 5 16:29 freshclam.log
-rw-r--r-- 1 clamav clamav 0 Feb 5 16:29 clamd.log
4)编辑配置文件
# cp /opt/clamav/etc/clamd.conf.sample /opt/clamav/etc/clamd.conf
# cp /opt/clamav/etc/freshclam.conf.sample /opt/clamav/etc/freshclam.conf
# vim /opt/clamav/etc/clam.conf
# Example 注释掉这一行
增加以下内容
LogFile /opt/clamav/logs/clamd.log
PidFile /opt/clamav/updata/clamd.pid
DatabaseDirectory /opt/clamav/updata
# vim /opt/clamav/etc/freshclam.conf
# Example 注释掉这一行
5)升级病毒库
# mkdir -p /opt/clamav/share/clamav
# chown clamav:clamav /opt/clamav/share/clamav
# /opt/clamav/bin/freshclam
由于ClamAV不是最新版本,所以有告警信息,可以忽略或升级最新版本,病毒库需要定期升级 。
4、ClamAV 使用
# /opt/clamav/bin/clamscan -h 查看相应的帮助信息
# clamscan -r / 扫描计算机上的所有文件并且显示所有的文件的扫描结果
# clamscan -r --bell -i /· 扫描计算机上的所有文件并且显示有问题的文件的扫描结果
# clamscan -r /home 扫描所有用户的主目录
原文地址:http://blog.51cto.com/redone/2074147