{"id":320,"date":"2013-09-08T17:37:46","date_gmt":"2013-09-08T17:37:46","guid":{"rendered":"http:\/\/blog.shineservers.com\/?p=320"},"modified":"2013-09-08T17:37:46","modified_gmt":"2013-09-08T17:37:46","slug":"installing-clamav-mailscanner","status":"publish","type":"post","link":"https:\/\/www.shineservers.com\/2013\/09\/08\/installing-clamav-mailscanner\/","title":{"rendered":"Installing ClamAV with MailScanner"},"content":{"rendered":"<p>These instructions will configure ClamAV to use the clamd daemon:<\/p>\n<ul>\n<li>Make sure clamavconnector is NOT installed in WHM &gt; Manage Plugins as this will break MailScanner<\/li>\n<li>If you would like to verify ClamAV&#8217;s digital signatures on the virus definition files as they are updated through freshclam, you need to install\u00a0<a href=\"http:\/\/www.swox.com\/gmp\/\" target=\"_blank\" rel=\"noopener noreferrer\">GMP<\/a>\u00a0first:<br \/>\n\/scripts\/ensurerpm gmp gmp-devel\u00a0bzip2-devel<\/li>\n<li>Next you will need to create a user for clamav to use:<br \/>\n<b><span style=\"font-family: 'Courier New', Courier, mono;\">useradd clamav<\/span><\/b><br \/>\nSome OS&#8217;s require you to add the group as well:<br \/>\n<b><span style=\"font-family: 'Courier New', Courier, mono;\">groupadd clamav<\/span><\/b><br \/>\nDon&#8217;t worry if the user and\/or group already exist.<\/li>\n<li>Create and chown the \/usr\/local\/share\/clamav directory:<br \/>\n<b><span style=\"font-family: 'Courier New', Courier, mono;\">mkdir \/usr\/local\/share\/clamav<br \/>\nchown clamav:clamav \/usr\/local\/share\/clamav<\/span><\/b><\/li>\n<li>Download the latest stable ClamAV distribution from\u00a0<a href=\"http:\/\/www.clamav.net\/\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/www.clamav.net<\/a><br \/>\n<strong>Note:<\/strong>\u00a0If you are running Fedora Core 4 or earlier, you cannot install any version of ClamAV later than 0.91.2 because of a broken gcc.<\/li>\n<li>Expand the distribution and cd into the resultant directory and build ClamAV using:<br \/>\n<span style=\"font-family: 'Courier New', Courier, mono;\"><strong>tar -xzf clamav-*<br \/>\ncd clamav*<br \/>\n.\/configure &#8211;disable-zlib-vcheck<br \/>\nmake<br \/>\nmake install<\/strong><\/span><\/li>\n<li><b><span style=\"font-family: 'Courier New', Courier, mono;\">pico -w \/usr\/local\/etc\/freshclam.conf<\/span><\/b><br \/>\nComment out the line (put a # as the first character on the line) near the top that says simply:<br \/>\n<strong><em>Example<\/em><\/strong><\/li>\n<li><b><span style=\"font-family: 'Courier New', Courier, mono;\">pico -w \/usr\/local\/etc\/clamd.conf<\/span><\/b><br \/>\nComment out the line (put a # as the first character on the line) near the top that says simply:<br \/>\n<strong><em>Example<\/em><\/strong><\/li>\n<li><b><span style=\"font-family: 'Courier New', Courier, mono;\">pico -w \/usr\/local\/etc\/clamd.conf<\/span><\/b><br \/>\nChange the following line:<br \/>\n<strong>#LocalSocket \/tmp\/clamd.socket<\/strong><br \/>\nto this:<br \/>\n<strong>LocalSocket \/tmp\/clamd<\/strong><\/li>\n<li>Run ldconfig to create the necessary links and cache to most recent shared libraries<br \/>\n<strong>ldconfig<\/strong><\/li>\n<li>Run freshclam to download the latest definitions:<br \/>\n<span style=\"font-family: 'Courier New', Courier, mono;\"><strong>freshclam<\/strong><\/span><\/li>\n<li>Install the example init script that we provide:<br \/>\n<strong>curl configserver.com\/free\/clamd -o \/etc\/init.d\/clamd<\/strong><span style=\"font-family: 'Courier New', Courier, mono;\"><strong><br \/>\nchown root:root \/etc\/init.d\/clamd<br \/>\nchmod +x \/etc\/init.d\/clamd<br \/>\nchkconfig clamd on<br \/>\nservice clamd restart<\/strong><\/span><\/li>\n<li><b><span style=\"font-family: 'Courier New', Courier, mono;\">pico -w \/etc\/chkserv.d\/clamav<br \/>\n<\/span><\/b>Add the following line:<span style=\"font-family: 'Courier New', Courier, mono;\"><b><br \/>\nservice[clamav]=x,x,x,service clamd restart,clamd,root<br \/>\n<\/b><\/span><\/li>\n<li>Create an empty log file for clamav updates:<br \/>\n<b><span style=\"font-family: 'Courier New', Courier, mono;\">touch \/var\/log\/clam-update.log<br \/>\nchown clamav:clamav \/var\/log\/clam-update.log<\/span><\/b><\/li>\n<li>Add clamav to chkservd so that it will be monitored:<br \/>\n<strong>pico -w \/etc\/chkserv.d\/chkservd.conf<br \/>\nclamav:1<\/strong><\/li>\n<li>At this point you can setup clamd in the MailScanner configuration:<br \/>\n<span style=\"font-family: 'Courier New', Courier, mono;\"><strong>pico -w \/usr\/mailscanner\/etc\/MailScanner.conf<\/strong><\/span><\/p>\n<p>Set the following options:<br \/>\n<em><strong>Virus Scanners = clamd<br \/>\n<\/strong><\/em><em><strong>Clamd Socket = \/tmp\/clamd<\/p>\n<p><\/strong><\/em><\/li>\n<li>Then restart MailScanner with:<br \/>\n<span style=\"font-family: 'Courier New', Courier, mono;\"><strong>service MailScanner restart\u00a0<\/strong><\/span><\/li>\n<li>You can now set what domains you want scanned for viruses in:<br \/>\n<em><strong>\/usr\/mailscanner\/etc\/rules\/virus.scanning.rules<\/strong><\/em><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>These instructions will configure ClamAV to use the clamd daemon: Make sure clamavconnector is NOT installed in WHM &gt; Manage Plugins as this will break MailScanner If you would like to verify ClamAV&#8217;s digital signatures on the virus definition files as they are updated through freshclam, you need to install\u00a0GMP\u00a0first: \/scripts\/ensurerpm gmp gmp-devel\u00a0bzip2-devel Next you [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[58,60],"tags":[],"class_list":["post-320","post","type-post","status-publish","format-standard","hentry","category-cpanel-control-panel","category-linux"],"acf":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/posts\/320","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/comments?post=320"}],"version-history":[{"count":0,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/posts\/320\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/media?parent=320"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/categories?post=320"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/tags?post=320"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}