Plesk 12 and ClamAV - Help!

Community support for Plesk, CPanel, WebMin and others with insight from two of the founders of Plesk. Ask for help here! No question is too simple or complicated. :-)
laughingbuddha
Forum Regular
Forum Regular
Posts: 512
Joined: Mon Mar 10, 2008 9:12 pm
Location: Southampton, UK

Plesk 12 and ClamAV - Help!

Unread post by laughingbuddha »

Hi all,

I've got a Plesk 12 box installed and running on Digital Ocean using CentOS 6.5 64bit.

I've installed Qmail Scanner and Spamassassin via Plesk's "Updates and Upgrades" section, and I installed ClamAV using the

Code: Select all

yum install clamd
command in terminal. Unlike the last time I did this, it doesn't want to work out the box. The initial errors of:

Code: Select all

ERROR: Please edit example config file /etc/freshclam.conf
ERROR: Can't open/parse the config file /etc/freshclam.conf
I fixed by commenting Example out in the freshclam.conf and clamd.conf files. But it seems like nothing is configured, and I'm getting lost. I'm not Linux guru.

Last time I did this in Plesk 8.6 it was configured out of the box, but that doesn't seem to be the case now. HELP!
Matt

"Given that God is infinite, and that the universe is also infinite... would you like a toasted teacake?"

about.me/mattauckland
twitter.com/mattauckland
biggles
Forum Regular
Forum Regular
Posts: 806
Joined: Tue Jul 15, 2008 2:38 pm
Location: Sweden
Contact:

Re: Plesk 12 and ClamAV - Help!

Unread post by biggles »

Hm, I usually use the atomic repository for clamav. asl -s -f usually fixes any misconfiguration.
faris
Long Time Forum Regular
Long Time Forum Regular
Posts: 2321
Joined: Thu Dec 09, 2004 11:19 am

Re: Plesk 12 and ClamAV - Help!

Unread post by faris »

If you don't have ASL on this system, I think you need to add some configuration stuff to clamd.conf and freshclam.conf rather than just commenting things out - they don't work out of the box.

I just copied what I had from a box that I knew worked. I'm afraid I don't recall exactly what I added, but it was things like file locations, users and so on.

This also applies even to the clamd version you get when you enable the project gamera repo.

I'm not sure that using the Parallels spamassassin is a good idea (doesn't it conflict with qmail-scanner or something?), and I had no idea they had a qmail-scanner rpm. Did they really come from the parallels repo?
--------------------------------
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>
laughingbuddha
Forum Regular
Forum Regular
Posts: 512
Joined: Mon Mar 10, 2008 9:12 pm
Location: Southampton, UK

Re: Plesk 12 and ClamAV - Help!

Unread post by laughingbuddha »

Yes faris, it's available only on Plesk 12 I believe.

I've kinda worked it out with some help from the Plesk forums (Here: http://forum.sp.parallels.com/threads/c ... ost-768579)

Just incase anyone else has the same issue as me, this is what I did starting with Plesk's Qmail and Spamassassin installed via the control panel. If ye forum gurus spot anything I left out, or a mistake I made, please let me know. Its the only way we learn :)

Next, from terminal I ran yum install clamd followed by yum install qmail-scanner.

At this stage clamd won't work out of the box. When you run the freshclam command for the first time you'll get this error:

Code: Select all

# freshclam
ERROR: Please edit the example config file /etc/freshclam.conf
ERROR: Can't open/parse the config file /etc/freshclam.conf
So you need to edit the /etc/freshclam.conf file and comment out the word Example. Then when you re-run the freshclam command this error will come up:

Code: Select all

# freshclam
ERROR: Can't create temporary directory /var/clamav/clamav-f6df56085fdcc627fea887a8a0c30c1d.tmp
Hint: The database directory must be writable for UID 492 or GID 494

# ERROR: Can't create temporary directory /var/clamav/clamav-f6df56085fdcc627fea88
So to fix this you need to set the permissions for writing to that folder, to the user qscand using this command, replacing UID and GID with the ones displayed in your error message:

Code: Select all

# chown -R UID:GID /var/clamav
# chmod -R 755 /var/clamav
Ok, third time of running the freshclam command is the charm, although you might see these errors during the first database update:

Code: Select all

ClamAV update process started at Tue Nov 25 17:56:12 2014
main.cvd is up to date (version: 55, sigs: 2424225, f-level: 60, builder: neo)
ERROR: Can't open /var/clamav/mirrors.dat for writing
Downloading daily-19680.cdiff [100%]
ERROR: Can't open /var/clamav/mirrors.dat for writing
daily.cld updated (version: 19680, sigs: 1274659, f-level: 63, builder: neo)
bytecode.cvd is up to date (version: 242, sigs: 46, f-level: 63, builder: dgoddard)
ERROR: Can't open /var/clamav/mirrors.dat for writing
Database updated (3698930 signatures) from db.us.clamav.net (IP: 194.8.197.22)
But don't worry, that is only because those files don't exist yet, until freshclam runs for the first time.

Next you need to run the service clamd start command, which will bring up this error:

Code: Select all

# service clamd start
Starting Clam AntiVirus Daemon: ERROR: Please edit the example config file /etc/clamd.conf
ERROR: Can't open/parse the config file /etc/clamd.conf
                                                           [FAILED]
Again to fix this, you need to edit the /etc/clamd.conf file and comment out the word Example. Also locate the line TCPSocket 3310 and uncomment it. That will help you avoid this error:

Code: Select all

# service clamd start
Starting Clam AntiVirus Daemon: ERROR: Please define server type (local and/or TCP).
                                                           [FAILED]
After that, to finish the install I ran the following commands:

Code: Select all

# chkconfig clamd on
# freshclam -d -c 2
# qmail-scanner-reconfigure
Reconfiguring spamassassin settings: Done
Reconfiguring clamav settings: Done
Configuring qmail-scanner: OK
And that, he says fingers crossed, should do it.

Incidentally, I haven't changed anything else in the standard out-of-the-box configuration files. Mostly because I have no-idea what most of it does.
Matt

"Given that God is infinite, and that the universe is also infinite... would you like a toasted teacake?"

about.me/mattauckland
twitter.com/mattauckland
scott
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 8330
Joined: Wed Dec 31, 1969 8:00 pm
Location: earth
Contact:

Re: Plesk 12 and ClamAV - Help!

Unread post by scott »

There is also this: https://github.com/Atomicorp/atomic-scanner

a plesk module we wrote a ways back to let you configure clam & spamassassin. It is AGPL'd and could use the love. It would be a great place to stick in any automatic configuration setup for clam/freshclam
Post Reply