Install ClamAV

Main >> cPanel >> Manage Plugins >> clamavconnector – Check ‘Install and Keep Updated’ box and the press ‘Save’ button at the bottom of the page.

Update Database

freshclam

Scan /Home Dir and output results to text file name .logs.txt

clamscan -ir /home > logs.txt

If you get -bash: clamscan: command not found

Run:

/scripts/restartsrv_clamd

If you get Unable to locate clamd

Follow the steps as given below:

# Red Hat Enterprise Linux 5 / i386:
rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
# Red Hat Enterprise Linux 5 / x86_64:
rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS//rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm

Then install it through yum:

yum install clamd

And finally restart clamd service:

/scripts/restartsrv_clamd

Situation : clamAV installed from WHM, but not working on the command line.

FIX:
If you have have already installed ClamAV through WHM, check to make sure that your executables are here
#ls -lah /usr/local/cpanel/3rdparty/bin/*clam*
If they are, make sure that there are no current ClamAV files in /usr/local/bin:
# ls -l /usr/local/bin/*clam*
If both of those check out, you can create symlinks in /usr/local/bin to make scanning your server easier.
ln -s /usr/local/cpanel/3rdparty/bin/freshclam /usr/local/bin/freshclam
ln -s /usr/local/cpanel/3rdparty/bin/clamscan /usr/local/bin/clamscan
ln -s /usr/local/cpanel/3rdparty/bin/clamd /usr/local/bin/clamd
ln -s /usr/local/cpanel/3rdparty/bin/clamav-config /usr/local/bin/clamav-config
Double check your work with this command:
# ls -l /usr/local/bin/*clam*
Then you can scan your server’s public_html folders with this command
clamscan -ir /home/*/public_html > /usr/local/src/scan.txt [The scan results will get saved to the “scan.txt” file]

View Results

cat /usr/local/src/scan.txt

Author: Christopher Smith

I managed websites.

Leave a Reply

Your email address will not be published. Required fields are marked *