UNIX下的杀毒软件有好多是商业版本的。但和 Windows系统下一样,杀毒软件的质量决定于病毒库的量已及更新的速度。在这里,我们使用">自由软件 Clam AntiVirus 来建立 Linux下的病毒查杀系统。并且为了消除后来的隐患,建议务必在服务器公开以前构建病毒查杀系统。
安装 Clam AntiVirus
由于 Clam Antivirus不存在于 CentOS中 yum的官方库中,所以用 yum安装 Clam Antivirus需要定义非官方的库。请先确认相应非官方库文件的存在。
[root@sample ~]# ls -l /etc/yum.repos.d/dag.repo ← 确认相应库文件的存在 性 -rw-r--r-- 1 root root 143 Oct 1 21:33 /etc/yum.repos.d/dag.repo ← 确认其存 在(否则不能通过yum 安装Clamd)
如果以上, dag.repo文件不存在,则不能通过 yum安装 Clam Antivirus,需要定义非官方库。定义非官方库的方法请见 “CentOS的下载、安装及初始环境设置”一节中 yum的相关设置。而且,在此前提下也要保证所定义的 dag.repo文件的语法的正确性。
然后,通过 yum来在线安装 Clam Antivirus 。
[root@sample ~]# yum -y install clamd ← 在线安装 Clam AntiVirus Setting up Install Process Setting up repositories dag 100% |=========================| 1.1 kB 00:00 update 100% |=========================| 951 B 00:00 base 100% |=========================| 1.1 kB 00:00 addons 100% |=========================| 951 B 00:00 extras 100% |=========================| 1.1 kB 00:00 Reading repository metadata in from local files primary.xml
.gz 100% |=========================| 1.6 MB 00:08 dag : ################################################## 4610/4610 Added 4610 new packages, deleted 0 old in 94.91 seconds primary.xml.gz 100% |=========================| 103 kB 00:05 update : ################################################## 256/256 Added 56 new packages, deleted 0 old in 4.25 seconds Reducing Dag RPM
Repository for Red Hat Enterprise Linux to included packages only Finished Parsing package install arguments Resol
ving Dependencies --> Populating transaction set with selected packages. Please wait. ---> Downloading header for clamd to pack into transaction set. clamd-0.88.4-1.el4.rf.i38 100% |=========================| 5.3 kB 00:00 ---> Package clamd.
i386 0:0.88.4-1.el4.rf set to be updated --> Running transaction check --> Processing Dependency: clamav = 0.88.4-1.el4.rf for package: clamd --> Processing Dependency: libclamav.so.1 for package: clamd --> Restarting Dependency Resolution with new changes. --> Populating transaction set with selected packages. Please wait. ---> Downloading header for clamav to pack into transaction set. clamav-0.88.4-1.el4.rf.i3 100% |=========================| 8.1 kB 00:00 ---> Package clamav.i386 0:0.88.4-1.el4.rf set to be updated --> Running transaction check --> Processing Dependency: clamav-db = 0.88.4-1.el4.rf for package: clamav --> Restarting Dependency Resolution with new changes. --> Populating transaction set with selected packages. Please wait. ---> Downloading header for clamav-db to pack into transaction set. clamav-db-0.88.4-1.el4.rf 100% |=========================| 3.2 kB 00:00 ---> Package clamav-db.i386 0:0.88.4-1.el4.rf set to be updated --> Running transaction check Dependencies Resolved =========================================================== ================== Package Arch Version Repository Size =========================================================== ================== Installing: clamd i386 0.88.4-1.el4.rf dag 64 k Installing for dependencies: clamav i386 0.88.4-1.el4.rf dag 724 k clamav-db i386 0.88.4-1.el4.rf dag 5.6 M Transaction Summary =========================================================== ================== Install 3 Package(s) Update 0 Package(s) Remove 0 Package(s) Total download size: 6.4 M Downloading Packages: (1/3): clamd-0.88.4-1.el4 100% |=========================| 64 kB 00:01 (2/3): clamav-0.88.4-1.el 100% |=========================| 724 kB 00:04 (3/3): clamav-db-0.88.4-1 100% |=========================| 5.6 MB 00:25 Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing: clamav-db ######################### [1/3] Installing: clamav ######################### [2/3] Installing: clamd ######################### [3/3] Installed: clamd.i386 0:0.88.4-1.el4.rf Dependency Installed: clamav.i386 0:0.88.4-1.el4.rf clamav-db.i386 0:0.88.4-1.el4.rf Complete! ← 安装完毕!