一、yum
yum update clamav
二、编译更新
暂停
systemctl stop clamav-freshclam.service
systemctl status clamav-freshclam.service
删除
rm -rf /usr/local/clamav/
ls /usr/local
下载
wget http://www.clamav.net/downloads/production/clamav-0.101.1.tar.gz
ls
解压
tar xf clamav-0.100.0.tar.gz
clamav用户和用户组
groupadd clamav && useradd -g clamav clamav && id clamav
日志存放目录
mkdir -p /usr/local/clamav/logs
touch /usr/local/clamav/logs/clamd.log
touch /usr/local/clamav/logs/freshclam.log
chown clamav.clamav /usr/local/clamav/logs/clamd.log
chown clamav.clamav /usr/local/clamav/logs/freshclam.log
病毒存放目录
mkdir -p /usr/local/clamav/updata
chown -R root.clamav /usr/local/clamav/
chown -R clamav.clamav /usr/local/clamav/updata/
编译更新
cd clamav-0.100.0/
./configure --prefix=/usr/local/clamav --with-pcre
make && make install
echo $?
配置clamav
cd /usr/local/clamav/etc
cp clamd.conf.sample clamd.conf
cp freshclam.conf.sample freshclam.conf
vim clamd.conf
Example 注释掉这一行. 添加下面三行:
LogFile /usr/local/clamav/logs/clamd.log PidFile /usr/local/clamav/updata/clamd.pid DatabaseDirectory /usr/local/clamav/updata
vim freshclam.conf #Example 注释掉这一行. 添加下面三行 DatabaseDirectory /usr/local/clamav/updata
UpdateLogFile /usr/local/clamav/logs/freshclam.log
PidFile /usr/local/clamav/updata/freshclam.pid
启动clamav
chown -R clamav.clamav /usr/local/clamav/
systemctl start clamav-freshclam.service
systemctl enable clamav-freshclam.service
systemctl status clamav-freshclam.service