标签:col libssl freshclam rod 病毒 develop add log sed
1.安装依赖环境
yum install -y zlib openssl-devel yum groupinstall -y "Development Tools"
apt install -y zlib1g zlib1g.dev openssl vim build-essential libssl-dev #ubuntu/debian安装
2.安装clamav软件包
wget http://www.clamav.net/downloads/production/clamav-0.101.0.tar.gz tar zxvf clamav-0.101.0.tar.gz cd clamav-0.101.0 ./configure --prefix=/usr/local/clamav make && make install
3.修改配置文件
cp /usr/local/clamav/etc/clamd.conf.sample /usr/local/clamav/etc/clamd.conf sed -i ‘8s/Example/#Example/g‘ /usr/local/clamav/etc/clamd.conf echo ‘LogFile /usr/local/clamav/logs/clamd.log‘ >> /usr/local/clamav/etc/clamd.conf echo ‘PidFile /usr/local/clamav/updata/clamd.pid‘ >> /usr/local/clamav/etc/clamd.conf echo ‘DatabaseDirectory /usr/local/clamav/updata/clamav‘ >> /usr/local/clamav/etc/clamd.conf
cp /usr/local/clamav/etc/freshclam.conf.sample /usr/local/clamav/etc/freshclam.conf sed -i ‘8s/Example/#Example/g‘ /usr/local/clamav/etc/freshclam.conf echo ‘DatabaseDirectory /usr/local/clamav/updata‘ >> /usr/local/clamav/etc/freshclam.conf echo ‘UpdateLogFile /usr/local/clamav/logs/freshclam.log‘ >> /usr/local/clamav/etc/freshclam.conf echo ‘PidFile /usr/local/clamav/updata/freshclam.pid‘ >> /usr/local/clamav/etc/freshclam.conf
4.创建用户
groupadd clamav
useradd -g clamav clamav
5.创建目录文件
mkdir /usr/local/clamav/logs mkdir /usr/local/clamav/updata
touch /usr/local/clamav/logs/freshclam.log chown clamav:clamav /usr/local/clamav/logs/freshclam.log touch /usr/local/clamav/logs/clamd.log chown clamav:clamav /usr/local/clamav/logs/clamd.log chown clamav:clamav /usr/local/clamav/updata
6.升级病毒库(需要服务器连通外网)
/usr/local/clamav/bin/freshclam
7.扫描病毒
/usr/local/clamav/bin/clamscan -r --bell -i /
标签:col libssl freshclam rod 病毒 develop add log sed
原文地址:https://www.cnblogs.com/omgasw/p/10340535.html