วันอังคารที่ 22 มิถุนายน พ.ศ. 2553

CentOS Howto Install ClamAV on DA DirectAdmin

http://tonnanie.spaces.live.com/blog/cns!21A88F697BA9ECDF!825.entry

ใน DirectAdmin ไม่ได้ติดตั้ง ClamAV Anti Virus มาให้…เราก็มาติดตั้ง clamav + exim เข้าด้วยกันดังนี้ครับ

ติดตั้ง repo จาก atomic
#wget -q -O – http://www.atomicorp.com/installers/atomic |sh

เสร็จแล้วก็ Yum
#yum -y install clamd clamav

#service clamd start

#chkconfig clamd on

#freshclam

#vi /etc/exim.conf
ค้นหาบรรทัด primary_hostname พิมพ์ บรรทัดต่อไปด้วย
av_scanner = clamd:127.0.0.1 3310

## Find check_message:
## Make sure it looks like this:

check_message:
deny message = This message contains malformed MIME ($demime_reason)
demime = *
condition = ${if >{$demime_errorlevel}{2}{1}{0}}
deny message = This message contains a virus or other harmful content ($malware_name)
demime = *
malware = *
deny message = This message contains an attachment of a type which we do not accept (.$found_extension)
demime = bat:com:pif:prf:scr:vbs
warn message = X-Antivirus-Scanner: Clean mail though you should still use an Antivirus
accept

## Save and exit

ทำการ restart clamd services
# service clamd restart
# /etc/init.d/exim restart

## Check for updates 24 times a day
# freshclam -d -c 24

แล้วทำการ monitor ดูครับ
tail -f /var/log/exim/mainlog

เสร็จแล้วจะเจอ ข้อความประมาณนี้
rejected after DATA: This message contains a virus or other harmful content (Email.Ecard-51)

————–
หลังจากนั้นให้ ติดตั้ง service monitor ของ DA
HOWTO: Control ClamAV from Service Monitor

Reference:
http://www.directadmin.com/forum/showthread.php?t=10478

——————————————————————————–
ทำตามนี้
http://www.directadmin.com/forum/showthread.php?t=17730