centos7 clamav 杀毒软件安装

壹:编译安装

1,官网获取源码包

clamav官网地址

2,创建clamav 用户和存放病毒库目录

a, 创建clamav 用户和用户组

groupadd clamav && useradd -g clamav clamav && id clamav

b,日志存放目录

mkdir -p /henan/clamav/logs 
touch /henan/clamav/logs/clamd.log
touch /henan/clamav/logs/freshclam.log
chown clamav.clamav /henan/clamav/logs/clamd.log
chown clamav.clamav /henan/clamav/logs/freshclam.log

c, 病毒库存放目录

mkdir -p /henan/clamav/updata
chown -R root.clamav /henan/clamav/
chown -R clamav.clamav /henan/clamav/updata/

3,安装

a,上传解压安装包

tar -zxvf clamav-0.103.7.tar.gz

b,安装依赖

yum -y install gcc 
yum -y install gcc-c++
yum -y install openssl-devel
yum -y install libcurl-devel
yum -y install e2fsprogs-devel

c, 编译安装

./configure --prefix=/henan/clamav --disable-clamav --with-pcre
make && make install

d, 配置clamav

cd /henan/clamav/etc
cp clamd.conf.sample clamd.conf
cp freshclam.conf.sample freshclam.conf


vim clamd.conf
#Example    注释掉这一行.
添加下面三行:
LogFile /henan/clamav/logs/clamd.log    
PidFile /henan/clamav/updata/clamd.pid     
DatabaseDirectory /henan/clamav/updata

vim freshclam.conf
#Example    注释掉这一行. 
添加下面三行 
DatabaseDirectory /henan/clamav/updata
UpdateLogFile /henan/clamav/logs/freshclam.log
PidFile /henan/clamav/updata/freshclam.pid

e, 启动clamav

chown -R clamav.clamav  /henan/clamav/
systemctl start   clamav-freshclam.service

此时你会发现,若系统联网,clamav会自动下载病毒库
centos7 clamav 杀毒软件安装_第1张图片

贰,关于离线下载病毒库

main.cvd 下载链接
daily.cvd 下载链接
bytecode.cvd 下载链接

下载完成后,上传至/henan/clamav/update目录下
并执行如下命令
clamdscan --reload。它会通知clamd去重新加载病毒库。
在守护进程关闭的情况下,运行如下命令进行扫描
/henan/clamav/bin/clamscan -r /henan/pack/

clamdscan --version,查看版本信息。
centos7 clamav 杀毒软件安装_第2张图片

叁,有网络的情况下更新病毒库:

运行如下命令更新病毒库:

systemctl stop clamav-freshclam #关闭守护进程

/usr/local/clamav/bin/freshclam #

你可能感兴趣的:(Linux,系统基础,服务器,linux,运维)