1.Make sure clamavconnector is NOT installed in WHM > Manage Plugins as this will break MailScanner
2.Next you will need to create a user for clamav to use:
useradd clamav
Some OS’s require you to add the group as well:
groupadd clamav
Don’t worry if the user and/or group already exist.
3.Create and chown the /usr/local/share/clamav directory:
mkdir /usr/local/share/clamav
chown clamav:clamav /usr/local/share/clamav
4.Download the latest stable ClamAV distribution from http://www.clamav.net
5.Expand the distribution and cd into the resultant directory and build ClamAV using:
tar -xzf clamav-*
cd clamav*
./configure –disable-zlib-vcheck
make
make install
mv -fv /usr/local/etc/freshclam.conf.sample /usr/local/etc/freshclam.conf
Vi /usr/local/etc/freshclam.conf
Comment out the line (put a # as the first character on the line) near the top that says simply:
Example
Vi /usr/local/etc/clamd.conf
Change the following line:
#LocalSocket /tmp/clamd.socket
to this:
LocalSocket /tmp/clamd
6.Run ldconfig to create the necessary links and cache to most recent shared libraries
ldconfig
7.Run freshclam to download the latest definitions:
freshclam
8.Install the example init script that we provide:
curl configserver.com/free/clamd -o /etc/init.d/clamd
chown root:root /etc/init.d/clamd
chmod +x /etc/init.d/clamd
chkconfig clamd on
service clamd restart
9. vi /etc/chkserv.d/clamav
Add the following line:
service[clamav]=x,x,x,service clamd restart,clamd,root
10. Create an empty log file for clamav updates:
touch /var/log/clam-update.log
chown clamav:clamav /var/log/clam-update.log
11.Add clamav to chkservd so that it will be monitored:
vi /etc/chkserv.d/chkservd.conf
clamav:1
12.At this point you can setup clamd in the MailScanner configuration:
vi /usr/mailscanner/etc/MailScanner.conf
Set the following options:
Virus Scanners = clamd
Clamd Socket = /tmp/clamd
13. Then restart MailScanner with:
service MailScanner restart
14. Now run
which clamscan
That’s all…..!!!
Recent Comments