Clam AntiVirus(简称 ClamAV) 是一个类UNIX系统上使用的反病毒软件包。主要应用于邮件服务器,采用多线程后台操作,可以自动升级病毒库。
以下 是安装 0.99 版本的脚本:
#!/bin/bash
CLAM_PATH=/opt/clamav-0.99 #安装目录
yum install -y zlib
cd /usr/local/src
wget http://sourceforge.net/projects/clamav/files/clamav/0.99/clamav-0.99.tar.gz
sleep 10
tar xvzf clamav-0.99.tar.gz
groupadd clamav
useradd -g clamav -s /bin/false -c "Clam AntiVirus" clamav
cd clamav-0.99
./configure --prefix=$CLAM_PATH --disable-clamav
make
make install
mkdir $CLAM_PATH/logs
mkdir $CLAM_PATH/updata
touch $CLAM_PATH/logs/freshclam.log
touch $CLAM_PATH/logs/clamd.log
chown clamav:clamav $CLAM_PATH/logs/clamd.log
chown clamav:clamav $CLAM_PATH/logs/freshclam.log
mkdir -p $CLAM_PATH/share/clamav
chown clamav:clamav $CLAM_PATH/share/clamav
cp $CLAM_PATH/etc/clamd.conf.sample $CLAM_PATH/etc/clamd.conf
cp $CLAM_PATH/etc/freshclam.conf.sample $CLAM_PATH/etc/freshclam.conf
sed -i ‘s/Example/#Example/g‘ $CLAM_PATH/etc/clamd.conf
sed -i ‘s/#LogFile\ \/tmp\/clamd.log/LogFile\ $CLAM_PATH\/logs\/clamd.log/g‘ $CLAM_PATH/etc/clamd.conf
sed -i ‘s/#PidFile\ \/var\/run\/clamd.pid/PidFile\ $CLAM_PATH\/updata\/clamd.pid/g‘\ $CLAM_PATH/etc/clamd.conf
sed -i ‘s/#DatabaseDirectory\ \/var\/lib\/clamav/DatabaseDirectory\ $CLAM_PATH\/updata/g‘\ $CLAM_PATH/etc/clamd.conf
sed -i ‘s/Example/#Example/g‘ $CLAM_PATH/etc/freshclam.conf
本文出自 “蒲芦” 博客,请务必保留此出处http://7116805.blog.51cto.com/7106805/1751659
原文地址:http://7116805.blog.51cto.com/7106805/1751659