HOWTO CLAMAV CENTOS 4.2 *64 BIT*
Thanks to original howto writer getUP and decafranky for extra information.
--------------
Tested on CentOS 4.2. *64 BIT*
1.
#cd /root
#mkdir clam
#cd clam
wget
http://dag.wieers.com/packages/clamav-0.87-1.2.el4.rf.x86_64.rpm
wget
http://dag.wieers.com/packages/clamav-db-0.87-1.2.el4.rf.x86_64.rpm
wget
http://dag.wieers.com/packages/clamav-devel-0.87-1.2.el4.rf.x86_64.rpm
wget
http://dag.wieers.com/packages/clamd-0.87-1.2.el4.rf.x86_64.rpm
#rpm -Uvh *
nano /etc/crontab
add below line to the end of the file:
53 * * * * root /usr/bin/freshclam
ctrl+x
y
#service clamd start
2. nano /etc/exim.conf
a) find : ctrl+w
# primary_hostname =
right below comments
add below line after this:
av_scanner = clamd:127.0.0.1 3310
b) find : ctrl+w
# ACL that is used after the DATA command
check_message:
accept
replace with:
Code:
check_message:
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 = *
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
accept
3. nano /etc/group
find :
mail:x:12:mail
replace with :
mail:x:12:mail,clamav
4. nano /etc/clamd.conf
find :
#LocalSocket /var/run/clamav/clamd.sock
and make sure it looks like this:
# Path to a local socket file the daemon will listen on.
# Default: disabled
#LocalSocket /var/run/clamav/clamd.sock
# Remove stale socket after unclean shutdown.
# Default: disabled
FixStaleSocket
# TCP port address.
# Default: disabled
TCPSocket 3310
# TCP address.
# By default we bind to INADDR_ANY, probably not wise.
# Enable the following to provide some degree of protection
# from the outside world.
# Default: disabled
TCPAddr 127.0.0.1
5.
:: OPTIONAL IF NEEDED ::
my exim version is already 4.54-1 because of newly installed server.
If your exim version is below that version upgrade your exim like this:
wget
http://files.directadmin.com/services/da_exim-4.54-1.src.rpm
rpm -ivh da_exim-4.54-1.src.rpm
cd /usr/src/redhat/SOURCES
vi ./da_exim-Makefile
bovenaan toevoegen: WITH_OLD_DEMIME = yes
cd /usr/src/redhat/SPECS
rpmbuild -bb exim.spec
cd /usr/src/redhat/RPMS/i386
rpm --force -i da_exim-4.51-1.i386.rpm
6.
#service exim restart
#service clamd restart
7. check your mail and clamav logs
#tail -f /var/log/exim/reject.log
#tail -f /var/log/clamav/clamd.log
8. OPTIONAL
You can verify and test your installation using the tests on:
http://www.gfi.com/emailsecuritytest/