• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Contribution Clamav on Plesk 12.5 - Centos 6

hardbrasil

Regular Pleskian
Helo fellas,

i installed clamav because maldet was not finding some treats. and Clamav is much more eficient to find them. So i recomend to install it.

here we go my tutorial how to install into Centos 6 + Plesk 12.5

**This tutorial i am not integrating with Postfix or Qmail,
its just for search files on /var/www/vhosts dir against files injections.

# Pre-install (remove any antivirus installed if exist)

# Install
- You gone need Epel repo or Atomic, so add it to yum (google!)

# add the atomic repo
wget -q -O - http://www.atomicorp.com/installers/atomic |sh
or
http://www.centosblog.com/enable-epel-repo-on-centos-5-and-centos-6/

1. Install

yum install clamav clamd

ps: i had installed in two Plesk servers and one of them the files was put in: /var/clamav and other into /var/lib/clamav. I don't know why this happen but be aware.

2. Set it to auto-start

/etc/init.d/clamd on
chkconfig clamd on

3. Edit clamd.conf

vi /etc/clamd.conf

Add comment to # Example

Remove comment for -> LocalSocket /tmp/clamd.socket

ps: i remove almost 80% of the comments, you gone need to ready one by one and liberate whatever your judge useful, some of them are mandatory so, when you try to start Clamav you got an error msg on shell if that specific function or path are not enable (uncommented).


3. Edit freshclam.conf

vi /etc/freshclam.conf

Add comment to # Example

4. Now you can start Clamav

service clamd start

5. Make a search on websites

clamscan -r /var/www/vhosts -l /var/log/clamav.log -i

6. You can look at log after search

tail -50 /var/log/clamav.log

### Configure Daily Scan ###

In this example, we will configure a cronjob to scan the /var/www/vhosts directory every week

1. Create cron file

vim /etc/cron.daily/manual_clamscan

2. Add the following to the file above.

#!/bin/bash
SCAN_DIR="/var/www/vhosts"
LOG_FILE="/var/log/clamav/manual_clamscan.log"
/usr/bin/clamscan -i -r $SCAN_DIR >> $LOG_FILE

3. Give our cron script executable permissions:

chmod +x /etc/cron.daily/manual_clamscan
 
Last edited:
Hi @Gene Steinberg,
i saw many tutorials to integrate with MTA like postfix and qmail,
i did not integrate because this is a production server and i am not an expert, in case of any issue i prefer to not get risk,
second reason, since Plesk 7 until now i never had an issue with virus on emails (mta). 90% of my situations is about a files injection and spam trough it.

here we control our mta by a mailgraph that show us our mail traffic by a grafic,
i hope to helped

i believe there is no issue with with centos 7, maybe few commands change like service restart
 
Your instructions are inconsistent and are missing steps:

So.

Remove comment for:

LocalSocket /tmp/clamd.socket
and other functions and configs,

Doesn't make sense. The only comment I find with the first line is already commented out with an #, but the second line is not there.

And:

vi /etc/freshclam.conf

Add comment to # Example

What comment?

When I try to start, I get:

[root@server ~]# service clamd start

Starting clamd (via systemctl): Job for clamd.service failed because the control process exited with error code. See "systemctl status clamd.service" and "journalctl -xe" for details.

So clearly something is missing.

I stopped there.

Peace,
Gene
 
I substituted your config file.

You haven't answered what to do with the freshclam file.

And I still get

[root@server ~]# service clamd start

Starting clamd (via systemctl): Job for clamd.service failed because the control process exited with error code. See "systemctl status clamd.service" and "journalctl -xe" for details.

[FAILED]

[root@server ~]#

Peace,
Gene
 
I suggest to add to the cron a nice command to give a lower priority to the cron.
 
Back
Top