centos编译安装clamav-0.100.1

  sre

yum install gcc openssl openssl-devel  -y

cd /data
wget http://www.clamav.net/downloads/production/clamav-0.100.1.tar.gz
tar zxvf clamav-0.100.1.tar.gz
cd clamav-0.100.1
#要带pcre,要不然执行clamscan会报错
./configure –prefix=/opt/clamav –with-pcre && make -j 4 && make install

#配置
cd /opt/clamav/etc
cp clamd.conf.sample clamd.conf
cp freshclam.conf.sample freshclam.conf

Example 注释掉这一行

sed -ri 's/Example/#Example/g' clamd.conf
sed -ri 's/Example/#Example/g' freshclam.conf

#clamAV user
groupadd clamav
useradd -g clamav clamav -s /sbin/nologin
chown -R clamav:clamav /opt/clamav

#更新病毒库
mkdir -p /opt/clamav/share/clamav
chown -R clamav:clamav /opt/clamav
/opt/clamav/bin/freshclam

#也可手动下载:
#cd /opt/clamav/share/clamav
#wget http://database.clamav.net/main.cvd
#wget http://database.clamav.net/daily.cvd
#wget http://database.clamav.net/bytecode.cvd

#service clamd start
用clamdscan扫描,需要开始服务才能使用。速度快,不用带-r,默认会递归扫描子目录
#clamdscan /usr
用clamscan扫描,不需要开始服务就能使用。速度慢,要带-r,才会递归扫描子目录
#clamscan -r /usr
这个命令不仅会显示找到的病毒,正常的扫描文件也会显示出来。
可以用下面这个命令,只显示找到的病毒信息

clamscan –no-summary -ri /tmp

-r 递归扫描子目录
-i 只显示发现的病毒文件
–no-summary 不显示统计信息

One Reply to “centos编译安装clamav-0.100.1”

  • i686平台有报错:
    Time: 0.301 sec (0 m 0 s)
    [root@server bin]# ./clamscan -r /root
    LibClamAV Error: cli_cvdload: Corrupted CVD header
    LibClamAV Error: Can’t load /opt/clamav/share/clamav/daily.cvd: Malformed database
    ERROR: Malformed database

LEAVE A COMMENT

Captcha Code