本文主要是介绍Linux安装clamav(本文转载:https://blog.csdn.net/qq_39564555/article/details/123300014),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1、官网下载
地址:https://www.clamav.net/downloads
wget https://www.clamav.net/downloads/production/clamav-0.104.2.linux.x86_64.rpm
2、安装
rpm -ivh --prefix=/usr/local/clamav clamav-0.104.2.linux.x86_64.rpm
3、添加用户组及创建用户
groupadd clamav
useradd -g clamav clamav
4、创建日志目录和病毒库目录
mkdir -p /usr/local/clamav/logs
mkdir -p /usr/local/clamav/update
5、创建日志文件
touch /usr/local/clamav/logs/clamd.log
touch /usr/local/clamav/logs/freshclam.log
6、文件授权
chown clamav:clamav /usr/local/clamav/logs/clamd.log
chown clamav:clamav /usr/local/clamav/logs/freshclam.log
chown clamav:clamav /usr/local/clamav/update
文件1:clamd.conf
vim /usr/local/clamav/etc/clamd.conf#Example //注释掉这一行
#添加以下内容
LogFile /usr/local/clamav/logs/clamd.log
PidFile /usr/local/clamav/update/clamd.pid
DatabaseDirectory /usr/local/clamav/update
文件2:freshclam.conf
vim /usr/local/clamav/etc/freshclam.conf#Example //注释掉这一行
#添加以下内容
DatabaseDirectory /usr/local/clamav/update
UpdateLogFile /usr/local/clamav/logs/freshclam.log
PidFile /usr/local/clamav/update/freshclam.pid
将这两个文件复制一下:
cp /usr/local/clamav/etc/*.conf /usr/local/etc/
7、从网络更新病毒库
#在原文基础上加此命令修改权限,否则无法写入日志文件导致无法更新病毒库
chown -R clamav.clamav /usr/local/clamav//usr/local/clamav/bin/freshclam
8、配置库文件路径
vim /etc/ld.so.conf#追加一行:/usr/local/clamav/lib64
更新生效
ldconfig
创建软链接
ln -s /usr/local/clamav/bin/clamscan /usr/local/sbin/clamscan
9、运行使用
/usr/local/clamav/bin/clamscan
这篇关于Linux安装clamav(本文转载:https://blog.csdn.net/qq_39564555/article/details/123300014)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!