cd ~
wget http://www.zlib.net/fossils/zlib-1.2.8.tar.gz
tar -xvzf zlib-1.2..tar.gz
cd zlib-1.2.
./configure --prefix=/usr/local/zlib
make -j8 && make install
cd ..
rm -rf /root/zlib-1.2.*
wget https://www.clamav.net/downloads/production/clamav-0.99.1.tar.gz
groupadd clamav
useradd -g clamav -s /bin/false -c "Clam AntiVirus" clamav
tar xvzf clamav.tar.gz
cd clamav-0.99.
./configure --prefix=/usr/local/clamav --disable-clamav
make -j8
make install
mkdir /usr/local/clamav/logs
mkdir /usr/local/clamav/updata
touch /usr/local/logs/freshclam.log
touch /usr/local/logs/clamd.log
cd /usr/local/clamav/logs
touch freshclam.log clamd.log
chmod freshclam.log clamd.log
chown clamav:clamav clamd.log freshclam.log
cd /usr/local/clamav/etc/
rm -rf *
cat >> clamd.conf << EOF
LogFile /usr/local/clamav/logs/clamd.log
PidFile /usr/local/clamav/updata/clamd.pid
DatabaseDirectory /usr/local/clamav/updata
EOF
cat >> freshclam.conf << EOF
DatabaseDirectory /usr/local/clamav/updata
UpdateLogFile /usr/local/clamav/logs/freshclam.log
PidFile /usr/local/clamav/updata/freshclam.pid
DatabaseMirror database.clamav.net
EOF
chown clamav:clamav /usr/local/clamav
chown clamav:clamav /usr/local/clamav/updata/
#清除安装文件
rm -rf /root/clamav*
rm -rf /root/zlib-1.2.*
#更新病毒库
cd /usr/local/clamav/updata
rm -rf *
wget http://database.clamav.net/main.cvd
wget http://database.clamav.net/daily.cvd
wget http://database.clamav.net/main.cvd
chown clamav:clamav *
#查毒
cd /root/
/usr/local/clamav/bin/freshclam
rm -rf /root/clamav.log
rm -rf /root/nohup.out
nohup /usr/local/clamav/bin/clamscan -r / -l /root/clamav.log &
tail -f /root/nohup.out
#/usr/local/clamav/bin/clamscan -r / -l /root/clamav.log
#/usr/local/clamav/bin/clamscan -r --bell -i / -l /root/clamav.log