首页 > 其他分享 > Install ClamAV

Install ClamAV

时间:2022-10-11 17:45:51浏览次数:44  
标签:conf ClamAV freshclam clamav clamd usr Install local


title: Install ClamAV

How to install ClamAV


wget http://www.clamav.net/downloads/production/clamav-0.103.5.tar.gz

# 创建组
groupadd clamav
# 创建用户
useradd -g clamav clamav


 yum install gcc openssl openssl-devel libcurl-devel gcc-c++ -y
# 编译
./configure --prefix=/usr/local/clamav
 make;make install


# 创建你日志目录与病毒库目录
mkdir /usr/local/clamav/{logs,updata}

# 创建日志文件
 touch /usr/local/clamav/logs/{clamd.log,freshclam.log}

# 赋权
chown -R root.clamav /usr/local/clamav/
chown -R clamav.clamav /usr/local/clamav/updata/
chown -R clamav.clamav /usr/local/clamav/logs/

# 修改配置文件
cd /usr/local/clamav/etc
cp clamd.conf.sample clamd.conf
cp freshclam.conf.sample freshclam.conf

# 修改clamd.conf
sed -i s/Example/#Example/g clamd.conf




sed -i s@'#LogFile /tmp/clamd.log'@'LogFile /usr/local/clamav/logs/clamd.log'@g clamd.conf

sed -i s@'#PidFile /var/run/clamd.pid'@'PidFile /usr/local/chamav/updata/clamd.pid'@g clamd.conf

# 修改freshclam.conf
sed -i s/Example/#Example/g freshclam.conf

sed -i s@'#UpdateLogFile /var/log/freshclam.log'@'UpdateLogFile /usr/local/clamav/logs/freshclam.log'@g freshclam.conf

sed -i s@'#PidFile /var/run/freshclam.pid'@'PidFile /usr/local/chamav/updata/freshclam.pid'@g freshclam.conf

sed -i s@'#DatabaseDirectory /var/lib/clamav'@'DatabaseDirectory /usr/local/clamav/updatals'@g freshclam.conf



#8、升级病毒库
# 更新病毒库
/usr/local/clamav/bin/freshclam

# 扫描病毒
 /usr/local/clamav/bin/clamscan

#9、设置计划任务
[root@instance-iq88yiwv ~]# crontab -l
1  4 * * *     /usr/local/clamav/bin/freshclam
50 4 * * *     /usr/local/clamav/bin/clamscan  -l /var/log/clamscan.log



标签:conf,ClamAV,freshclam,clamav,clamd,usr,Install,local
From: https://www.cnblogs.com/kaosay/p/16780022.html

相关文章