tar install clamav on freebsd

groupadd clamav
useradd -g clamav -s/bin/false -d/dev/null clamav
stop any clamav pid
cd /usr/ports/security/clamav
make deinstall clean
cd /usr/ports/distfiles/
tar -zxvpf clamav-0.90.2.tar.gz
cd /usr/ports/distfiles/clamav-0.90.2
./configure –prefix=/usr/local –with-dbdir=/var/db/clamav
make
make check
make install
cd /usr/local/etc/
vi clamd.conf
add:
#Example
LogFile /var/log/clamav/clamd.log
PidFile /var/run/clamav/clamd.pid
DatabaseDirectory /var/db/clamav
LocalSocket /var/run/clamav/clamd
User clamav
AllowSupplementaryGroups no
ScanMail yes
:wq
#mkdir /var/log/clamav
chown -R clamav:clamav /var/log/clamav
chmod -R 744 /var/log/clamav
chown -R clamav:clamav /var/db/clamav
mkdir /var/run/clamav
chmod 700 /var/run/clamav
chown clamav:clamav /var/run/clamav
/usr/local/sbin/clamd
vi freshclam.conf
add:
#Example
DatabaseDirectory /var/db/clamav
UpdateLogFile /var/log/clamav/freshclam.log
PidFile /var/run/clamav/freshclam.pid
DatabaseOwner clamav
AllowSupplementaryGroups yes
NotifyClamd /usr/local/etc/clamd.conf
:wq
/usr/local/bin/freshclam
设置自动更新病毒库
vi /etc/crontab
0 4 * * * root /usr/local/bin/freshclam –quiet -l /var/log/clamav/clamd.log
:wq