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.