Steps to Install Clam AntiVirus Version 0.101.0
ClamAV is a free, cross-platform and open-source antivirus software toolkit able to detect many types of malicious software, including viruses.
Steps to install ClamAV in RHEL-7.5
To install clamAV first we need to install EPEL Repository:
After that we need to install ClamAV and its related tools.
After completion of above steps, we need to configure installed ClamAV. This can be done via editing /etc/clamd.d/scan.conf. In this file we have to remove Example lines. So that ClamAV can use this file's configurations. We can easily do it via running following command -
Another thing we need to do in this file is to define our TCP server type. Open this file using -
here this we need to uncomment line with #LocalSocket /var/run/clamd.scan/clamd.sock. Just remove # symbol from the beginning of the line.
Now we need to configure FreshClam so that it can update ClamAV db automatically. For doing that follow below steps -
First create a backup of original FreshClam Configuration file -
In this freshclam.conf file, Here also we need to remove Example line from the file. Run following command to delete all Example lines-
Test freshclam via running-
After running above command you should see an output similar to this -
We will create a service of freshclam so that freshclam will run in the daemon mode and periodically check for updates throughout the day. To do that we will create a service file for freshclam -
And add below content -
Now save and quit. Also reload the systemd daemon to refresh the changes -
Next start and enable the freshclam service -
Now freshclam setup is complete and our ClamAV db is upto date. We can continue setting up ClamAV. Now we will copy ClamAV service file to system service folder.
Since we have changed the name, we need to change it at the file that uses this service as well -
Remove @ symbol from .include /lib/systemd/system/clamd@.service line and save the file.
We will edit Clamd service file now -
Add following lines at the end of clamd.service file.
And also remove %i symbol from various locations (ex: Description and ExecStart options). Note that at the end of the editing the service file should look something like this -
Now finally start the ClamAV service.
If it works fine, then enable this service and test the status of ClamAV service -
Now in MOSIP we require ClamAV to be available on Port 3310. To expose ClamAV service on Port 3310, edit scan.conf
and Uncomment #TCPSocket 3310 by removing #. After that restart the clamd@scan service -
Since we are exposing ClamAV on 3310 port, we need to allow incoming traffic through this port. In RHEL 7 run below command to add firewall rule -
Reference link: link
Last updated