ClamAV 0.96.1 にバージョンアップ

ClamAV を 0.96.1 にアップデートしますた。ClamAV はバージョンアップが多いのでメモメモ。

postfix + clamav-milter タイプ

ClamAV 0.96.1 のインストール

wget "http://downloads.sourceforge.net/project/clamav/clamav/0.96.1/clamav-0.96.1.tar.gz?use_mirror=jaist"
tar zxf clamav-0.96.1.tar.gz
cd clamav-0.96.1/
./configure --prefix=/usr/local/clamav-0.96.1 --enable-milter 2>&1 | tee configure-$(date +%Y%m%d%H%M%S).log
make 2>&1 | tee make-$(date +%Y%m%d%H%M%S).log
sudo make install 2>&1 | tee make_install-$(date +%Y%m%d%H%M%S).log

freshclam.conf の設定

sudo cp -a /usr/local/clamav-0.96.1/etc/freshclam.conf /usr/local/clamav-0.96.1/etc/freshclam.conf.orig
sudo sed -i 's/^Example/#Example/' /usr/local/clamav-0.96.1/etc/freshclam.conf
sudo sed -i 's/^#DatabaseDirectory \/var\/lib\/clamav/DatabaseDirectory \/var\/lib\/clamav/' /usr/local/clamav-0.96.1/etc/freshclam.conf
sudo sed -i 's/^#UpdateLogFile \/var\/log\/freshclam.log/UpdateLogFile \/var\/log\/clamav\/freshclam.log/' /usr/local/clamav-0.96.1/etc/freshclam.conf
sudo sed -i 's/^#LogFileMaxSize 2M/LogFileMaxSize 0/' /usr/local/clamav-0.96.1/etc/freshclam.conf
sudo sed -i 's/^#LogTime yes/LogTime yes/' /usr/local/clamav-0.96.1/etc/freshclam.conf
sudo sed -i 's/^#PidFile \/var\/run\/freshclam.pid/PidFile \/var\/run\/clamav\/freshclam.pid/' /usr/local/clamav-0.96.1/etc/freshclam.conf
sudo sed -i 's/^#NotifyClamd \/path\/to\/clamd.conf/NotifyClamd \/usr\/local\/clamav\/etc\/clamd.conf/' /usr/local/clamav-0.96.1/etc/freshclam.conf

clamd.conf の設定

sudo cp -a /usr/local/clamav-0.96.1/etc/clamd.conf /usr/local/clamav-0.96.1/etc/clamd.conf.orig
sudo sed -i 's/^Example/#Example/' /usr/local/clamav-0.96.1/etc/clamd.conf
sudo sed -i 's/^#LogFile \/tmp\/clamd.log/LogFile \/var\/log\/clamav\/clamd.log/' /usr/local/clamav-0.96.1/etc/clamd.conf
sudo sed -i 's/^#LogFileMaxSize 2M/LogFileMaxSize 0/' /usr/local/clamav-0.96.1/etc/clamd.conf
sudo sed -i 's/^#LogTime yes/LogTime yes/' /usr/local/clamav-0.96.1/etc/clamd.conf
sudo sed -i 's/^#PidFile \/var\/run\/clamd.pid/PidFile \/var\/run\/clamav\/clamd.pid/' /usr/local/clamav-0.96.1/etc/clamd.conf
sudo sed -i 's/^#DatabaseDirectory \/var\/lib\/clamav/DatabaseDirectory \/var\/lib\/clamav/' /usr/local/clamav-0.96.1/etc/clamd.conf
sudo sed -i 's/^#User clamav/User clamav/' /usr/local/clamav-0.96.1/etc/clamd.conf
sudo sed -i 's/^#LocalSocket \/tmp\/clamd.socket/LocalSocket \/var\/run\/clamav\/clamd.socket/' /usr/local/clamav-0.96.1/etc/clamd.conf

clamav-milter.conf の設定

sudo cp -a /usr/local/clamav-0.96.1/etc/clamav-milter.conf /usr/local/clamav-0.96.1/etc/clamav-milter.conf.orig
sudo sed -i 's/^Example/#Example/' /usr/local/clamav-0.96.1/etc/clamav-milter.conf
sudo sed -i 's/^#MilterSocket \/tmp\/clamav-milter.socket/MilterSocket \/var\/run\/clamav\/clamav-milter.socket/' /usr/local/clamav-0.96.1/etc/clamav-milter.conf
sudo sed -i 's/^#User clamav/User clamav/' /usr/local/clamav-0.96.1/etc/clamav-milter.conf
sudo sed -i 's/^#PidFile \/var\/run\/clamav-milter.pid/PidFile \/var\/run\/clamav\/clamav-milter.pid/' /usr/local/clamav-0.96.1/etc/clamav-milter.conf
sudo sed -i 's/^#ClamdSocket tcp:scanner.mydomain:7357/ClamdSocket unix:\/var\/run\/clamav\/clamd.socket/' /usr/local/clamav-0.96.1/etc/clamav-milter.conf
sudo sed -i 's/^#LogFile \/tmp\/clamav-milter.log/LogFile \/var\/log\/clamav\/clamav-milter.log/' /usr/local/clamav-0.96.1/etc/clamav-milter.conf
sudo sed -i 's/^#LogFileMaxSize 2M/LogFileMaxSize 0/' /usr/local/clamav-0.96.1/etc/clamav-milter.conf
sudo sed -i 's/^#LogTime yes/LogTime yes/' /usr/local/clamav-0.96.1/etc/clamav-milter.conf
sudo sed -i 's/^#LogInfected Basic/LogInfected Basic/' /usr/local/clamav-0.96.1/etc/clamav-milter.conf

古いバージョンで動いているサービスを停止

sudo /sbin/service clamav-milter stop
sudo /sbin/service clamd stop
sudo /sbin/service freshclam stop

シンボリックリンクで新しいバージョンに切り替え

sudo rm -f /usr/local/clamav
sudo ln -s /usr/local/clamav-0.96.1 /usr/local/clamav

新しいバージョンでサービスを開始

sudo /sbin/service freshclam start
sudo /sbin/service clamd start
sudo /sbin/service clamav-milter start

qmail + clamav タイプ

ClamAV 0.96.1 のインストール

wget "http://downloads.sourceforge.net/project/clamav/clamav/0.96.1/clamav-0.96.1.tar.gz?use_mirror=jaist"
tar zxf clamav-0.96.1.tar.gz
cd clamav-0.96.1/
./configure --prefix=/usr/local/clamav-0.96.1 --disable-zlib-vcheck 2>&1 | tee configure-$(date +%Y%m%d%H%M%S).log
make 2>&1 | tee make-$(date +%Y%m%d%H%M%S).log
sudo make install 2>&1 | tee make_install-$(date +%Y%m%d%H%M%S).log

freshclam.conf の設定

sudo cp -a /usr/local/clamav-0.96.1/etc/freshclam.conf /usr/local/clamav-0.96.1/etc/freshclam.conf.orig
sudo sed -i 's/^Example/#Example/' /usr/local/clamav-0.96.1/etc/freshclam.conf
sudo sed -i 's/^#UpdateLogFile \/var\/log\/freshclam.log/UpdateLogFile \/var\/log\/clamav\/freshclam.log/' /usr/local/clamav-0.96.1/etc/freshclam.conf
sudo sed -i 's/^#LogFileMaxSize 2M/LogFileMaxSize 0/' /usr/local/clamav-0.96.1/etc/freshclam.conf
sudo sed -i 's/^#LogTime yes/LogTime yes/' /usr/local/clamav-0.96.1/etc/freshclam.conf
sudo sed -i 's/^#PidFile \/var\/run\/freshclam.pid/PidFile \/var\/run\/clamav\/freshclam.pid/' /usr/local/clamav-0.96.1/etc/freshclam.conf
sudo sed -i 's/^#DatabaseOwner clamav/DatabaseOwner qscand/' /usr/local/clamav-0.96.1/etc/freshclam.conf
sudo sed -i 's/^#NotifyClamd \/path\/to\/clamd.conf/NotifyClamd \/usr\/local\/clamav\/etc\/clamd.conf/' /usr/local/clamav-0.96.1/etc/freshclam.conf

clamd.conf の設定

sudo cp -a /usr/local/clamav-0.96.1/etc/clamd.conf /usr/local/clamav-0.96.1/etc/clamd.conf.orig
sudo sed -i 's/^Example/#Example/' /usr/local/clamav-0.96.1/etc/clamd.conf
sudo sed -i 's/^#LogFile \/tmp\/clamd.log/LogFile \/var\/log\/clamav\/clamd.log/' /usr/local/clamav-0.96.1/etc/clamd.conf
sudo sed -i 's/^#LogFileMaxSize 2M/LogFileMaxSize 0/' /usr/local/clamav-0.96.1/etc/clamd.conf
sudo sed -i 's/^#LogTime yes/LogTime yes/' /usr/local/clamav-0.96.1/etc/clamd.conf
sudo sed -i 's/^#PidFile \/var\/run\/clamd.pid/PidFile \/var\/run\/clamav\/clamd.pid/' /usr/local/clamav-0.96.1/etc/clamd.conf
sudo sed -i 's/^#User clamav/User qscand/' /usr/local/clamav-0.96.1/etc/clamd.conf
sudo sed -i 's/^#LocalSocket \/tmp\/clamd.socket/LocalSocket \/var\/run\/clamav\/clamd.socket/' /usr/local/clamav-0.96.1/etc/clamd.conf

古いバージョンで動いているサービスを停止

sudo /sbin/service clamd stop
sudo /sbin/service freshclam stop

シンボリックリンクで新しいバージョンに切り替え

sudo rm -f /usr/local/clamav
sudo ln -s /usr/local/clamav-0.96.1 /usr/local/clamav

新しいバージョンでサービスを開始

sudo /sbin/service freshclam start
sudo /sbin/service clamd start
タイトルとURLをコピーしました