Configure clamav
Clamav is the antivirus system we 'll use
Change clamav user/group to qscand and keep all of the other default settings (Group - Owner)
dpkg-reconfigure clamav-freshclam
Choose daemon + your location + default answers
chown -R qscand:clamav /var/log/clamav /var/lib/clamav /var/run/clamav
chown qscand:qscand /etc/clamav/freshclam.conf
chmod 600 /etc/clamav/freshclam.conf
ln -s /var/log/clamav /var/log/qmail/clamav
sed -i 's/DatabaseOwner clamav/DatabaseOwner qscand/' /etc/clamav/freshclam.conf
sed -i 's/clamav adm/qscand qscand/' /etc/logrotate.d/clamav-freshclam
sed -i 's/clamav adm/qscand qscand/' /etc/logrotate.d/clamav-daemon
Restart the services
/etc/init.d/clamav-freshclam restart
If you experience some issues at this step (for instance if you have not followed the instruction about the ownership change), check the followings :
1° Check /etc/clamav/freshclam.conf to verify the DatabaseOwner option :
2° Check /etc/clamav/clamd.conf to verify the LocalSocketGroup and User options :
User qscand
3° Check both /etc/logrotate.d/clamav-freshclam and /etc/logrotate.d/clamav-daemon :
If you have adapted those two files, run this
chown qscand:clamav /var/log/clamav/freshclam.log
4° If you have changed something above, restart the services
/etc/init.d/clamav-freshclam restart
Users comments
root@srvmail:/var/lib/clamav# /etc/init.d/clamav-daemon restart
Stopping ClamAV daemon: clamd.
Starting ClamAV daemon: clamd LibClamAV Warning: **************************************************
LibClamAV Warning: *** The virus database is older than 7 days! ***
LibClamAV Warning: *** Please update it as soon as possible. ***
LibClamAV Warning: **************************************************
@Coreux :
Just launch following commands: