Getting ClamAV Daemon working in Ubuntu 20.04

Getting ClamAV Daemon working in Ubuntu 20.04

by Davide Longo -
Number of replies: 1

Dear all,

We managed to upgrade+migrate our moodle website from 3.5 to 3.9 and from Ubuntu 18.04 to 20.04.1.

The initial issues we got along the way, required a lot of tracing back, also considering that the former sysadmin left little or nothing documentation... The problem we are now facing is about configuring the new moodle 3.9 at best and to this regard, I searched the forum and found no other threads regarding moodle running on ubuntu 20.04: are we the only ones or moodle is better relying on other OS?. Our goal right now is to have clamav running as "Unix domain socket", as perfectly described here (thank you Mark Sharp) but to no avail as the system denied the clamd daemon access to the /tmp directory despite all the workarounds were implemented as described by Mark. I don't want to set/try apache in PHP fast-cgi, so I am asking if there's something more I could try to fix the file scanning issue.

**on the old system (18.04 and moodle 3.5) everything works as expected, but we are unable to replicate it on the 20.04.

To recap, here follows what I have tried so far:

1) add the user (clamav) to the apache group (www-data) ---> no change

2) Tried the PrivateTmp=true in the /etc/systemd/system/multi-user.target.wants/apache2.service ---> it works but overrides the security feature.

3) Tried re-enabling the PrivateTmp of the apache2.service and implemented JoinsNamespaceOf=apache2.service in /etc/systemd/system/multi-user.target.wants/clamav-daemon.service ---> issues shows up again.

Each time I  changed the files/configuration, I have restarted clamav/apache.

Please help us out to finalize the operation. At the moment, the only options are running the file scan via CLI or disabling the PrivateTmp for apache2.

Thank you,

Davide

Average of ratings: Useful (1)
In reply to Davide Longo

Re: Getting ClamAV Daemon working in Ubuntu 20.04

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I remember when we were getting this running (on Red Hat, as it happens, but still). It was not me configuring it, so I am afraid that I cannot offer practice help.

So, all I can really do is offer you sympathy, and say you are not alone. The think we had to do was something in the SE Linux config.

And, the good news is that once we got it working, it has kept working ever since.

Good luck.