Install ClamAV on CentOs / Directadmin system

Login to your server as user ‘root’ and first of all, make sure that your server is up-to-date by executing the following command:

# yum update

Change the current working directory to DirectAdmin’s custombild directory

# cd /usr/local/directadmin/custombuild

and compile ClamAV by executing the following commands:

./build update
./build set clamav yes
./build clamav

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:

# freshclam -v

And start ClamAV:

# /etc/init.d/clamd start

Done. The installation of ClamAV is really that easy.

Now, we will integrate ClamAV with Exim.

Using your favorite text editor, edit Exim’s configuration file and add the following line before the “primary_hostname =” line

# nano /etc/exim.conf
av_scanner = clamd: 3310

Next, find the ‘check_message:‘ line and add the following lines below it:

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

Save the changes and restart Exim

# service exim restart

Now you have ClamAV installed and integrated with Exim on your CentOS 6 DirectAdmin VPS.

Hebt u meer vragen? Een aanvraag indienen


Mogelijk gemaakt door Zendesk