Setting up ClamAV AntiVirus for Moodle file uploads Updated on August 16, 2021 by InMotion Hosting Contributor 1 Minutes, 57 Seconds to Read When administrating a Moodle site, it is important to set your Moodle to scan file uploads for viruses before they are accepted to the server. Moodle 2.3 has the Antivirus capability to accomplish this. Moodle uses ClamAV to scan uploaded files. This can be set up in the Site administration section. Lets set up ClamAV in Moodle. Important! In order to use this feature, ClamAV will need to be installed on the server. If you are using a shared server at Inmotion, ClamAV is not installed. ClamAV can be installed on VPS and Dedicated servers. Please click here to learn how to install ClamAV. Setting up ClamAV for file uploads Log into the Moodle Dashboard Navigate to Site administration > Security > Anti-Virus in the Site administrator settings. On the Anti-Viruspage, select the appropriate fields to enable ClamAV virus scans. Below is a detail of what each setting is for. The clam AV path and the Quarantine directory will be specific to your server configuration. If you do not know this information, please contact support or your hosting company to find the directory and path. Anti-Virus settings Use ClamAV on Upload Enabling this will have ClamAV scan the file before its uploaded to the server. clam AV path The path to ClamAV can vary on a server; however, the usual path is: /usr/bin/clamscan or /usr/bin/clamdscan. Quarantine directory When ClamAV needs to quarantine a file, this directory will be used to store them. Leaving this blank will have the uploaded file deleted. On clam AV failure If ClamAV fails, the file will either be deleted or moved to the quarantine folder. Selecting Treat files as OK will not delete them. Treat as Virus will delete the file. Once finished click Save changes. If the the ClamAV path or the directory is incorrect or if there is a configuration problem, Moodle will notify you. Wrong Paths Correct Paths Now when trying to upload a file that contains hack scripts or viruses Moodle will not allow the file to be saved to the server. Congratulations, your file uploads in Moodle will now be scanned for viruses prior to them being uploaded to the server. This concludes the article for Setting up ClamAV AntiVirus for Moodle file uploads. For more information about Moodle security, please visit Moodle site security and server settings. Share this Article InMotion Hosting Contributor Content Writer InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals! More Articles by InMotion Hosting Related Articles How to install Moodle using Fantastico Installing Moodle with Softaculous How to Add Content Security Policy in Moodle With the Local CSP Plugin Inserting an image slider in Moodle Changing the Moodle admin password through PhpMyAdmin Fix “uploaded file may exceed the post_max_size directive in php.ini” How to Add the Quiz Module in Moodle Adding the File Resource Module to Moodle Courses Integrate Jitsi with Moodle Courses How to Install a Plugin in Moodle