您的位置:首页 > 移动开发 > Swift

swift 杀毒 和ClamAV集成

2014-01-20 09:51 375 查看
This article will guide you through the installation of ClamAV on CentOS. Once installed, we will also configure a daily scan on our CentOS server.

ClamAV is an open source (GPL) antivirus engine designed for detecting Trojans, viruses, malware and other malicious threats on Linux. In this article, we will only be configuring ClamAV to run scheduled/on-demand scans; not resident scans.

A. Install ClamAV

1. Install EPEL repo
Before we can do proceed, you must ensure that you have the EPEL yum repository enabled. To do this,click
here.

CentOS 6 – 32-bit

1
rpm -Uvh http://mirror.overthewire.com.au/pub/epel/6/i386/epel-release-6-8.noarch.rpm[/code]

CentOS 6 – 64-bit

view sourceprint?

1
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm[/code]
2. Install required packages
yum install clamav clamd clamav-devel


3. Start the clamd service and set it to auto-start
/etc/init.d/clamd on
chkconfig clamd on
/etc/init.d/clamd start

4.更新病毒库,并设置为定时任务.
[code] freshclam -v

#chown search:search /etc/clamav.conf
#chown -R searcha:search /var/lock/subsys/clamd
#chown -R searcha:search /var/run/clamav
[code]#chown -R searcha:search /var/clamav


freshclam >> /tmp/clamavfresh.log

5.下载python库 clamd-1.0.1.zip解压,进入目录,执行$ ./setup.py install
6.进入python命令行模式.python import clamd
from six import BytesIO as bi

cd = clamd.ClamdNetworkSocket('127.0.0.1',3310)
cd.instream(bi(clamd.EICAR))

[/code]6.

from six import BytesIO as bi#
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: