{"id":151,"date":"2015-04-27T12:17:45","date_gmt":"2015-04-27T12:17:45","guid":{"rendered":"http:\/\/betakb.veeble.org\/?p=151"},"modified":"2025-04-22T12:26:44","modified_gmt":"2025-04-22T06:56:44","slug":"how-to-install-and-configure-clamav-on-centos","status":"publish","type":"post","link":"https:\/\/www.veeble.com\/kb\/how-to-install-and-configure-clamav-on-centos\/","title":{"rendered":"How to Install and Configure ClamAV on CentOS"},"content":{"rendered":"<p>ClamAV is an open-source (GPL) antivirus engine designed for detecting Trojans, viruses, malware, and other malicious threats. It is the de facto standard for mail gateway scanning. It provides a high-performance multi-threaded scanning daemon, command line utilities for on-demand file scanning, and an intelligent tool for automatic signature updates. The core ClamAV library provides numerous file format detection mechanisms, file unpacking support, archive support, and multiple signature languages for detecting threats.<\/p>\n<div id=\"toc\" class=\"toc\">\n<div id=\"toctitle\">\n<h2>Contents<\/h2>\n<\/div>\n<ul>\n<li class=\"toclevel-1 tocsection-1\"><a href=\"#Install_from_the_RPMs\"><span class=\"tocnumber\">1<\/span> <span class=\"toctext\">Install from the RPMs<\/span><\/a><\/li>\n<li class=\"toclevel-1 tocsection-2\"><a href=\"#Install_via_epel_repository.\"><span class=\"tocnumber\">2<\/span> <span class=\"toctext\">Install via epel repository.<\/span><\/a><\/li>\n<li class=\"toclevel-1 tocsection-3\"><a href=\"#Updating_the_ClamAV\"><span class=\"tocnumber\">3<\/span> <span class=\"toctext\">Updating the ClamAV<\/span><\/a><\/li>\n<li class=\"toclevel-1 tocsection-4\"><a href=\"#Setting_up_the_cronjob\"><span class=\"tocnumber\">4<\/span> <span class=\"toctext\">Setting up the cronjob<\/span><\/a><\/li>\n<\/ul>\n<\/div>\n<h2><span id=\"Install_from_the_RPMs\" class=\"mw-headline\">Install from the RPMs<\/span><\/h2>\n<p>1. Move to the install directory:<\/p>\n<pre>cd \/usr\/src\n<\/pre>\n<p>2. Download the ClamAV installation package, ClamAV database, ClamAV development libraries, and ClamAV daemon for your operating system type (32 bit of 64 bit):<\/p>\n<p>For 32-bit:<\/p>\n<pre>wget <a class=\"external free\" href=\"http:\/\/pkgs.repoforge.org\/clamav\/clamav-0.97.1-1.el6.rf.i686.rpm\" rel=\"nofollow noopener\" target=\"_blank\">http:\/\/pkgs.repoforge.org\/clamav\/clamav-0.97.1-1.el6.rf.i686.rpm<\/a> <a class=\"external free\" href=\"http:\/\/pkgs.repoforge.org\/clamav\/clamav-db-0.97.1-1.el6.rf.i686.rpm\" rel=\"nofollow noopener\" target=\"_blank\">http:\/\/pkgs.repoforge.org\/clamav\/clamav-db-0.97.1-1.el6.rf.i686.rpm<\/a> <a class=\"external free\" href=\"http:\/\/pkgs.repoforge.org\/clamav\/clamav-devel-0.97.1-1.el6.rf.i686.rpm\" rel=\"nofollow noopener\" target=\"_blank\">http:\/\/pkgs.repoforge.org\/clamav\/clamav-devel-0.97.1-1.el6.rf.i686.rpm<\/a> <a class=\"external free\" href=\"http:\/\/pkgs.repoforge.org\/clamav\/clamd-0.97.1-1.el6.rf.i686.rpm\" rel=\"nofollow noopener\" target=\"_blank\">http:\/\/pkgs.repoforge.org\/clamav\/clamd-0.97.1-1.el6.rf.i686.rpm<\/a>\n<\/pre>\n<p>For 64-bit:<\/p>\n<pre>wget <a class=\"external free\" href=\"http:\/\/pkgs.repoforge.org\/clamav\/clamav-0.97.1-1.el6.rf.x86_64.rpm\" rel=\"nofollow noopener\" target=\"_blank\">http:\/\/pkgs.repoforge.org\/clamav\/clamav-0.97.1-1.el6.rf.x86_64.rpm<\/a> <a class=\"external free\" href=\"http:\/\/pkgs.repoforge.org\/clamav\/clamav-db-0.97.1-1.el6.rf.x86_64.rpm\" rel=\"nofollow noopener\" target=\"_blank\">http:\/\/pkgs.repoforge.org\/clamav\/clamav-db-0.97.1-1.el6.rf.x86_64.rpm<\/a> <a class=\"external free\" href=\"http:\/\/pkgs.repoforge.org\/clamav\/clamav-devel-0.97.1-1.el6.rf.x86_64.rpm\" rel=\"nofollow noopener\" target=\"_blank\">http:\/\/pkgs.repoforge.org\/clamav\/clamav-devel-0.97.1-1.el6.rf.x86_64.rpm<\/a> <a class=\"external free\" href=\"http:\/\/pkgs.repoforge.org\/clamav\/clamd-0.97.1-1.el6.rf.x86_64.rpm\" rel=\"nofollow noopener\" target=\"_blank\">http:\/\/pkgs.repoforge.org\/clamav\/clamd-0.97.1-1.el6.rf.x86_64.rpm<\/a>\n<\/pre>\n<p>3. Install ClamAV<\/p>\n<pre>rpm -Uvh clam*\n<\/pre>\n<p>&#8216;<b>[OR]&#8217;<\/b><\/p>\n<h2><span id=\"Install_via_epel_repository.\" class=\"mw-headline\">Install via the epel repository.<\/span><\/h2>\n<p>1. Install the EPEL package<\/p>\n<pre>cd \/usr\/local\/src\nwget <a class=\"external free\" href=\"http:\/\/ftp.riken.jp\/Linux\/fedora\/epel\/6\/i386\/epel-release-6-7.noarch.rpm\" rel=\"nofollow noopener\" target=\"_blank\">http:\/\/ftp.riken.jp\/Linux\/fedora\/epel\/6\/i386\/epel-release-6-7.noarch.rpm<\/a>  \/\/ for centos 6\nrpm -ivh epel-release-6-7.noarch.rpm\n[or]\nwget <a class=\"external free\" href=\"http:\/\/ftp.riken.jp\/Linux\/fedora\/epel\/5\/i386\/epel-release-5-4.noarch.rpm\" rel=\"nofollow noopener\" target=\"_blank\">http:\/\/ftp.riken.jp\/Linux\/fedora\/epel\/5\/i386\/epel-release-5-4.noarch.rpm<\/a>  \/\/ for centos 5\nrpm -ivh epel-release-5-4.noarch.rpm\n<\/pre>\n<p>2. Install ClamAV<\/p>\n<pre>yum install clamd\n<\/pre>\n<h2><span id=\"Updating_the_ClamAV\" class=\"mw-headline\">Updating the ClamAV<\/span><\/h2>\n<p>Run freshclam to download the newest pattern files:<\/p>\n<pre>\/usr\/bin\/freshclam -v\n<\/pre>\n<h2><span id=\"Setting_up_the_cronjob\" class=\"mw-headline\">Setting up the cronjob<\/span><\/h2>\n<p>1. Create the log file.<\/p>\n<pre>touch \/var\/log\/freshclam.log\nchmod 600 \/var\/log\/freshclam.log\nchown clamav \/var\/log\/freshclam.log\n<\/pre>\n<p>2. Create <b>\/etc\/cron.daily\/clamav-scan<\/b> with the following contents.<\/p>\n<pre>\/usr\/bin\/freshclam\n\/usr\/bin\/clamscan -ri \/\n<\/pre>\n<p>3. Set the permissions.<\/p>\n<pre>chmod +x \/etc\/cron.weekly\/clamav-scan\n<\/pre>\n<p>Now you have installed ClamAV antivirus on your server and set up a cronjob that will update the ClamAV and scan the server every day.<\/p>\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-uagb-call-to-action uagb-block-abb43fd0 wp-block-button\"><div class=\"uagb-cta__wrap\"><h3 class=\"uagb-cta__title\">Unmatched Reliability for Your Node.js Applications with Veeble<\/h3><p class=\"uagb-cta__desc\">Count on Veeble for consistent uptime and performance. Secure, scalable Node.js hosting with global reach.<\/p><\/div><div class=\"uagb-cta__buttons\"><a href=\"https:\/\/www.veeble.com\/in\/nodejs-hosting\/\" class=\"uagb-cta__button-link-wrapper wp-block-button__link\" target=\"_blank\" rel=\"noopener noreferrer\">Explore Node.js Plans<svg xmlns=\"https:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\"><path d=\"M504.3 273.6l-112.1 104c-6.992 6.484-17.18 8.218-25.94 4.406c-8.758-3.812-14.42-12.45-14.42-21.1L351.9 288H32C14.33 288 .0002 273.7 .0002 255.1S14.33 224 32 224h319.9l0-72c0-9.547 5.66-18.19 14.42-22c8.754-3.809 18.95-2.075 25.94 4.41l112.1 104C514.6 247.9 514.6 264.1 504.3 273.6z\"><\/path><\/svg><\/a><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>ClamAV is an open-source (GPL) antivirus engine designed for detecting Trojans, viruses, malware, and other malicious threats. It is the de facto standard for [&hellip;]<\/p>\n","protected":false},"author":12,"featured_media":8662,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[3],"tags":[],"class_list":["post-151","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-installation"],"uagb_featured_image_src":{"full":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2015\/04\/How-to-Install-and-Configure-ClamAV-on-CentOS.jpg",1536,1024,false],"thumbnail":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2015\/04\/How-to-Install-and-Configure-ClamAV-on-CentOS-150x150.jpg",150,150,true],"medium":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2015\/04\/How-to-Install-and-Configure-ClamAV-on-CentOS-300x200.jpg",300,200,true],"medium_large":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2015\/04\/How-to-Install-and-Configure-ClamAV-on-CentOS-768x512.jpg",768,512,true],"large":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2015\/04\/How-to-Install-and-Configure-ClamAV-on-CentOS-1024x683.jpg",1024,683,true],"1536x1536":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2015\/04\/How-to-Install-and-Configure-ClamAV-on-CentOS.jpg",1536,1024,false],"2048x2048":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2015\/04\/How-to-Install-and-Configure-ClamAV-on-CentOS.jpg",1536,1024,false]},"uagb_author_info":{"display_name":"Digin Dominic","author_link":"https:\/\/www.veeble.com\/kb\/author\/digin-dominic\/"},"uagb_comment_info":0,"uagb_excerpt":"ClamAV is an open-source (GPL) antivirus engine designed for detecting Trojans, viruses, malware, and other malicious threats. It is the de facto standard for [&hellip;]","_links":{"self":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts\/151","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/comments?post=151"}],"version-history":[{"count":5,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts\/151\/revisions"}],"predecessor-version":[{"id":8663,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts\/151\/revisions\/8663"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/media\/8662"}],"wp:attachment":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/media?parent=151"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/categories?post=151"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/tags?post=151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}