Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Install clamav in DirectAdmin  (Read 6989 times)

0 Members and 1 Guest are viewing this topic.

jominj

  • Guest
Install clamav in DirectAdmin
« on: January 08, 2014, 08:10:39 pm »
Clam antivirus or clamav is very popular and open source antivirus application. Here is the steps how we can Install clamav in the DirectAdmin panel

1.   Change the current working directory to DirectAdmin’s custom build directory
Code: [Select]
# cd /usr/local/directadmin/custombuild2.   Compile ClamAV by executing the following commands:
Code: [Select]
./build update
./build set clamav yes
./build clamav
3.   After the compiling is done, you may get the following error message when ClamAV will try to start:
Starting clamd: LibClamAV Error: cli_loaddb(): No supported database files found in /usr/share/clamav
ERROR: Can't open file or directory

It means thare is no ClamAV virus database on your server. The database can be easily generated:
Code: [Select]
# freshclam -v and start the clamav service
Code: [Select]
# /etc/init.d/clamd start4.   Now, we will integrate ClamAV with Exim:
Open the Exim configuration file in an editor and add the following line before 'primary_hostname' line
Code: [Select]
# vim /etc/exim.conf
av_scanner = clamd:127.0.0.1 3310
5.  Next find the 'check_message' line and add the following lines below it:
Code: [Select]
deny message = This message contains malformed MIME ($demime_reason)
demime = *
condition = ${if >{$demime_errorlevel}{2}{1}{0}}
deny message = This message contains a virus or other harmful content ($malware_name)
demime = *
malware = */defer_ok
deny message = This message contains an attachment of a type which we  do not accept (.$found_extension)
demime = bat:com:pif:prf:scr:vbs
warn message = X-Antivirus-Scanner: Clean mail though you should still use an Antivirus

6.  Save the changes and restart Exim

Code: [Select]
# service exim restart
That's it now we have completed Installing the clamav and Integrated It with Exim.