红联Linux门户
Linux帮助

linux下安装clamav扫描病毒文件

发布时间:2008-09-21 00:43:36来源:红联作者:tronrms
应研发需求,需要在linux环境下安装可以扫描出windows下的病毒木马文件,于是找到了lamav。lamav病毒库可以免费升级,但只能查毒不能杀毒。官网地址:http://www.clamav.net/

安装过程如下:

##需要zlib库支持
apt-get install zlib1g-dev

##安装clamav
axel -a -n 10 http://nchc.dl.sourceforge.net/sourceforge/clamav/clamav-0.94.tar.gz
tar zxvf clamav-0.94.tar.gz
cd clamav-0.94

groupadd clamav
useradd -g clamav -s /bin/false -d /dev/null clamav

./configure
make && make install

##创建日志目录
mkdir -p /var/log/clamav
chown -R clamav.clamav /var/log/clamav

##默认配置文件在/usr/local/etc
vi /usr/local/etc/clamd.conf
========================================================
#Example 注释掉Example行
LogFile /var/log/clamav/clamd.log
LogVerbose yes
LogTime yes
LocalSocket /tmp/clamav.socket
PidFile /var/run/clamd.pid
##默认安装病毒库在此目录
DatabaseDirectory /usr/local/share/clamav
MaxDirectoryRecursion 15
ScanMail
ScanArchive

##设定freshclam.conf
##编辑/usr/local/etc/freshclam.conf
# vi /usr/local/etc/freshclam.conf
========================================================
#Example 注释掉Example行
##默认安装病毒库在此目录
DatabaseDirectory /usr/local/share/clamav
UpdateLogFile /var/log/clamav/freshclam.log
LogSyslog yes
LogVerbose yes
DatabaseMirror db.CN.clamav.net
DatabaseMirror database.clamav.net

##计划任务定时升级病毒库
freshclam

##扫描目录、文件
clamscan -r /data
clamscan data.gz
文章评论

共有 1 条评论

  1. yeung 于 2008-10-29 13:16:53发表:

    (e:e2s (e:e2s