{"id":102,"date":"2015-12-16T12:42:58","date_gmt":"2015-12-16T12:42:58","guid":{"rendered":"https:\/\/www.24x7serversupport.com\/24x7serversupport-blog\/?p=102"},"modified":"2015-12-16T12:42:58","modified_gmt":"2015-12-16T12:42:58","slug":"install-clamav-on-centos-7","status":"publish","type":"post","link":"https:\/\/www.24x7serversupport.com\/blog\/install-clamav-on-centos-7\/","title":{"rendered":"Install Clamav on CentOS 7"},"content":{"rendered":"<p><strong>Install EPEL repo first<br \/>\n<\/strong><\/p>\n<p>Clamav is available on EPEL repo. Please install<span class=\"Apple-converted-space\">&nbsp;<\/span><a href=\"https:\/\/fedoraproject.org\/wiki\/EPEL\" target=\"_blank\" rel=\"noopener noreferrer\">EPEL<\/a><span class=\"Apple-converted-space\">&nbsp;<\/span>first then, run the following command:<\/p>\n<p>[code]yum install clamav-server clamav-data clamav-update clamav-filesystem clamav clamav-scanner-systemd clamav-devel clamav-lib clamav-server-systemd[\/code]<\/p>\n<p>Remove \u201c<em>Example<\/em>\u201d line from<span class=\"Apple-converted-space\">&nbsp;<\/span><span class=\"skimlinks-unlinked\">freshclam.conf<\/span><span class=\"Apple-converted-space\">&nbsp;<\/span>and \/etc\/clamd.d\/<span class=\"skimlinks-unlinked\">scan.conf<\/span><span class=\"Apple-converted-space\">&nbsp;<\/span>in default locatiof of<span class=\"Apple-converted-space\">&nbsp;<\/span><span class=\"skimlinks-unlinked\">clamd.conf<\/span>!<\/p>\n<blockquote><p><span class=\"skimlinks-unlinked\">[code]sed -i -e \u201cs\/^Example\/#Example\/\u201d \/etc\/<span class=\"skimlinks-unlinked\">freshclam.conf<\/span>[\/code]<\/span><\/p>\n<p><span class=\"skimlinks-unlinked\">[code]sed -i -e \u201cs\/^Example\/#Example\/\u201d \/etc\/clamd.d\/<span class=\"skimlinks-unlinked\">scan.conf<\/span>[\/code]<\/span><\/p><\/blockquote>\n<p>Run freshclam to update database manually.<\/p>\n<blockquote><p><strong>&nbsp;<\/strong>[code]freshclam[\/code]<\/p><\/blockquote>\n<p>Fresclam is run by cron job from<span class=\"Apple-converted-space\">&nbsp;<\/span><em>\/etc\/cron.d\/clamav-update&nbsp;<\/em><\/p>\n<p>[code]&nbsp;cat \/etc\/cron.d\/clamav-update[\/code]<br \/>\n## Adjust this line\u2026<br \/>\nMAILTO=root<\/p>\n<blockquote><p>## It is ok to execute it as root; freshclam drops privileges and becomes<br \/>\n## user \u2018clamupdate\u2019 as soon as possible<br \/>\n<em>0&nbsp; *\/3 * * * root \/usr\/share\/clamav\/freshclam-sleep<\/em><\/p>\n<p><strong># \/usr\/share\/clamav\/freshclam-sleep<\/strong><br \/>\nWARNING: update of clamav database is disabled; please see<br \/>\n\u2018\/etc\/sysconfig\/freshclam\u2019<br \/>\nfor information how to enable the periodic update resp. how to turn<br \/>\noff this message.<\/p><\/blockquote>\n<p>It seems that freshclam update via cron is disabled. Remove the last line (REMOVE ME) from \/etc\/sysconfig\/freshclam file to active\u2026<\/p>\n<blockquote><p><strong># tail \/etc\/sysconfig\/freshclam<\/strong><br \/>\n## \u2018disabled-warn\u2019&nbsp; \u2026&nbsp; disables the automatic freshclam update and<br \/>\n##&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gives out a warning<br \/>\n## \u2018disabled\u2019&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \u2026&nbsp; disables the automatic freshclam silently<br \/>\n# FRESHCLAM_DELAY=<\/p>\n<p>### !!!!! REMOVE ME !!!!!!<br \/>\n### REMOVE ME: By default, the freshclam update is disabled to avoid<br \/>\n### REMOVE ME: network access without prior activation<br \/>\n<strong>FRESHCLAM_DELAY=disabled-warn&nbsp;&nbsp; &nbsp;# REMOVE ME<\/strong><\/p><\/blockquote>\n<p>run clamd manually for testing purposes<\/p>\n<blockquote><p>[code]\/usr\/sbin\/clamd -c \/etc\/clamd.d\/<span class=\"skimlinks-unlinked\">scan.conf<\/span><span class=\"Apple-converted-space\">&nbsp;<\/span>\u2013nofork=yes[\/code]<br \/>\nERROR: Please define server type (local and\/or TCP)<\/p><\/blockquote>\n<p>If you get error like above, then we need to define server type. Use socket option.<\/p>\n<p>Comment out the following line in \/etc\/clamd.d\/<span class=\"skimlinks-unlinked\">scan.conf<\/span><\/p>\n<blockquote><p><em>#LocalSocket \/var\/run\/<span class=\"skimlinks-unlinked\">clamd.scan\/clamd.sock<\/span><\/em><\/p><\/blockquote>\n<p>to<\/p>\n<blockquote><p><em>LocalSocket \/var\/run\/<span class=\"skimlinks-unlinked\">clamd.scan\/clamd.sock<\/span><\/em><\/p><\/blockquote>\n<p>Enable on startup<\/p>\n<blockquote><p><strong># systemctl&nbsp; enable clamd@scan<\/strong><br \/>\nln -s \u2018\/usr\/lib\/systemd\/system\/clamd@scan.service\u2019 \u2018\/etc\/systemd\/system\/<span class=\"skimlinks-unlinked\">multi-user.target.wants\/clamd@scan.service<\/span>\u2019<\/p><\/blockquote>\n<p>and start the service, check the status<\/p>\n<blockquote><p><strong># systemctl&nbsp; start clamd@scan<\/strong><br \/>\n<strong># systemctl&nbsp; status clamd@scan<\/strong><br \/>\n<em>[code]<\/em><\/p>\n<p><em>clamd@scan.service \u2013 Generic clamav scanner daemon<\/em><br \/>\n<em>&nbsp;&nbsp; Loaded: loaded (\/usr\/lib\/systemd\/system\/clamd@scan.service; enabled)<\/em><br \/>\n<em>&nbsp;&nbsp; Active: active (running) since Mon 2015-01-05 14:45:08 EET; 3s ago<\/em><br \/>\n<em>&nbsp;Main PID: 13588 (clamd)<\/em><br \/>\n<em>&nbsp;&nbsp; CGroup: \/<span class=\"skimlinks-unlinked\">system.slice\/system-clamd.slice\/clamd@scan.service<\/span><\/em><br \/>\n<em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \u00e2\u0094\u0094\u00e2\u0094\u008013588 \/usr\/sbin\/clamd -c \/etc\/clamd.d\/<span class=\"skimlinks-unlinked\">scan.conf<\/span><span class=\"Apple-converted-space\">&nbsp;<\/span>\u2013nofork=yes<\/em><\/p>\n<p><em>Jan 05 14:45:08 Centos7-min systemd[1]: Started Generic clamav scanner daemon.<\/em><br \/>\n<em>Jan 05 14:45:08 Centos7-min clamd[13588]: clamd daemon 0.98.5 (OS: linux-gnu, ARCH: x86_64, CPU: x86_64)<\/em><br \/>\n<em>Jan 05 14:45:08 Centos7-min clamd[13588]: Running as user clamscan (UID 995, GID 994)<\/em><br \/>\n<em>Jan 05 14:45:08 Centos7-min clamd[13588]: Log file size limited to 1048576 bytes.<\/em><br \/>\n<em>Jan 05 14:45:08 Centos7-min clamd[13588]: Reading databases from \/var\/lib\/clamav<\/em><br \/>\n<em>Jan 05 14:45:08 Centos7-min clamd[13588]: Not loading PUA signatures.<\/em><br \/>\n<em>Jan 05 14:45:08 Centos7-min clamd[13588]: Bytecode: Security mode set to \u201cTrustSigned\u201d.<\/em><\/p>\n<p><em>[\/code]<\/em><\/p><\/blockquote>\n<p>Run a test scan:<\/p>\n<blockquote><p><strong># clamdscan -c \/etc\/clamd.d\/<span class=\"skimlinks-unlinked\">scan.conf<\/span><span class=\"Apple-converted-space\">&nbsp;<\/span>\/etc\/hosts<\/strong><br \/>\n\/etc\/hosts: OK<\/p><\/blockquote>\n<p>\u2014\u2014\u2014\u2013 SCAN SUMMARY \u2014\u2014\u2014\u2013<br \/>\nInfected files: 0<br \/>\nTime: 0.002 sec (0 m 0 s)<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Install EPEL repo first Clamav is available on EPEL repo. Please install&nbsp;EPEL&nbsp;first then, run the following command: [code]yum install clamav-server clamav-data clamav-update clamav-filesystem clamav clamav-scanner-systemd clamav-devel clamav-lib clamav-server-systemd[\/code] Remove \u201cExample\u201d line from&nbsp;freshclam.conf&nbsp;and \/etc\/clamd.d\/scan.conf&nbsp;in default locatiof of&nbsp;clamd.conf! [code]sed -i -e \u201cs\/^Example\/#Example\/\u201d \/etc\/freshclam.conf[\/code] [code]sed -i -e \u201cs\/^Example\/#Example\/\u201d \/etc\/clamd.d\/scan.conf[\/code] Run freshclam to update database manually. &nbsp;[code]freshclam[\/code] Fresclam is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[30],"tags":[31,32],"class_list":["post-102","post","type-post","status-publish","format-standard","hentry","category-centos","tag-centos","tag-cpanel"],"jetpack_publicize_connections":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Install Clamav on CentOS 7 \u2013 24x7serversupport-Blog<\/title>\n<meta name=\"description\" content=\"Get full detail information on How to install ImageMagick with PHP. 24x7serversupport.com provides all the information regarding installation of driver softwares and many more.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.24x7serversupport.com\/blog\/install-clamav-on-centos-7\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Install Clamav on CentOS 7 \u2013 24x7serversupport-Blog\" \/>\n<meta property=\"og:description\" content=\"Get full detail information on How to install ImageMagick with PHP. 24x7serversupport.com provides all the information regarding installation of driver softwares and many more.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.24x7serversupport.com\/blog\/install-clamav-on-centos-7\/\" \/>\n<meta property=\"og:site_name\" content=\"24x7serversupport Blog\" \/>\n<meta property=\"article:published_time\" content=\"2015-12-16T12:42:58+00:00\" \/>\n<meta name=\"author\" content=\"24x7support\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@24x7serversuppo\" \/>\n<meta name=\"twitter:site\" content=\"@24x7serversuppo\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"24x7support\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/install-clamav-on-centos-7\/\",\"url\":\"https:\/\/www.24x7serversupport.com\/blog\/install-clamav-on-centos-7\/\",\"name\":\"Install Clamav on CentOS 7 \u2013 24x7serversupport-Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/#website\"},\"datePublished\":\"2015-12-16T12:42:58+00:00\",\"dateModified\":\"2015-12-16T12:42:58+00:00\",\"author\":{\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/#\/schema\/person\/decfb5fad6bde6ac6822d4e965c6d401\"},\"description\":\"Get full detail information on How to install ImageMagick with PHP. 24x7serversupport.com provides all the information regarding installation of driver softwares and many more.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/install-clamav-on-centos-7\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.24x7serversupport.com\/blog\/install-clamav-on-centos-7\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/install-clamav-on-centos-7\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.24x7serversupport.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Install Clamav on CentOS 7\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/#website\",\"url\":\"https:\/\/www.24x7serversupport.com\/blog\/\",\"name\":\"24x7serversupport Blog\",\"description\":\"Linux | CPanel | WHM | webhosting| Plesk | DirectAdmin | CentOs | Debian | Ubuntu Blog\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.24x7serversupport.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/#\/schema\/person\/decfb5fad6bde6ac6822d4e965c6d401\",\"name\":\"24x7support\",\"url\":\"https:\/\/www.24x7serversupport.com\/blog\/author\/24x7support\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Install Clamav on CentOS 7 \u2013 24x7serversupport-Blog","description":"Get full detail information on How to install ImageMagick with PHP. 24x7serversupport.com provides all the information regarding installation of driver softwares and many more.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.24x7serversupport.com\/blog\/install-clamav-on-centos-7\/","og_locale":"en_US","og_type":"article","og_title":"Install Clamav on CentOS 7 \u2013 24x7serversupport-Blog","og_description":"Get full detail information on How to install ImageMagick with PHP. 24x7serversupport.com provides all the information regarding installation of driver softwares and many more.","og_url":"https:\/\/www.24x7serversupport.com\/blog\/install-clamav-on-centos-7\/","og_site_name":"24x7serversupport Blog","article_published_time":"2015-12-16T12:42:58+00:00","author":"24x7support","twitter_card":"summary_large_image","twitter_creator":"@24x7serversuppo","twitter_site":"@24x7serversuppo","twitter_misc":{"Written by":"24x7support","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.24x7serversupport.com\/blog\/install-clamav-on-centos-7\/","url":"https:\/\/www.24x7serversupport.com\/blog\/install-clamav-on-centos-7\/","name":"Install Clamav on CentOS 7 \u2013 24x7serversupport-Blog","isPartOf":{"@id":"https:\/\/www.24x7serversupport.com\/blog\/#website"},"datePublished":"2015-12-16T12:42:58+00:00","dateModified":"2015-12-16T12:42:58+00:00","author":{"@id":"https:\/\/www.24x7serversupport.com\/blog\/#\/schema\/person\/decfb5fad6bde6ac6822d4e965c6d401"},"description":"Get full detail information on How to install ImageMagick with PHP. 24x7serversupport.com provides all the information regarding installation of driver softwares and many more.","breadcrumb":{"@id":"https:\/\/www.24x7serversupport.com\/blog\/install-clamav-on-centos-7\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.24x7serversupport.com\/blog\/install-clamav-on-centos-7\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.24x7serversupport.com\/blog\/install-clamav-on-centos-7\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.24x7serversupport.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Install Clamav on CentOS 7"}]},{"@type":"WebSite","@id":"https:\/\/www.24x7serversupport.com\/blog\/#website","url":"https:\/\/www.24x7serversupport.com\/blog\/","name":"24x7serversupport Blog","description":"Linux | CPanel | WHM | webhosting| Plesk | DirectAdmin | CentOs | Debian | Ubuntu Blog","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.24x7serversupport.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.24x7serversupport.com\/blog\/#\/schema\/person\/decfb5fad6bde6ac6822d4e965c6d401","name":"24x7support","url":"https:\/\/www.24x7serversupport.com\/blog\/author\/24x7support\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/posts\/102","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/comments?post=102"}],"version-history":[{"count":0,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/posts\/102\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/media?parent=102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/categories?post=102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/tags?post=102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}