Catalogue
Installing Clam AntiVirus

Installing Clam AntiVirus

🌐 日本語で読む

Clam Antivirus

Clam Antivirus, commonly abbreviated as ClamAV, is an open-source virus scanner that runs on Unix-like operating systems.

http://www.clamav.net

wiki - Clam_AntiVirus

I personally rented a Sakura VPS, installed some middleware, and was checking that it worked. Before I knew it, the server was hit by a DoS attack and I got a notice saying “We are going to shut down your server.” That scare is what led me to install this.

Installation Steps

Either of the following two methods works fine. Installing via yum is easier, since it comes with a startup script and places everything on the path for you.

  • Via yum
1
# yum install clamav clamav-update
  • Build from source
1
2
3
4
5
6
7
# cd /usr/local/src
# wget http://www.clamav.net/downloads/production/clamav-0.99.tar.gz
# tar zxf clamav-0.99.tar.gz
# cd clamav-0.99
# ./configure --enable-milter
# make
# make install

Updating the Configuration File

/etc/clamd.conf

1
2
3
4
5
// To update the definition file, uncomment "User clam"
# sed -i 's/^User\s\+clam$/#\0/' /etc/clamd.conf

// Apply the updates
# freshclam

Startup Configuration

1
2
3
4
5
// Start
# service clamd start

// Configure automatic startup
# chkconfig clamd on

Verifying Execution

1
2
3
4
5
6
7
8
9
10
11
# clamscan --infected --remove --recursive

----------- SCAN SUMMARY -----------
Known viruses: 4269611
Engine version: 0.99
Scanned directories: 2
Scanned files: 8
Infected files: 0
Data scanned: 0.20 MB
Data read: 0.10 MB (ratio 1.92:1)
Time: 10.934 sec (0 m 10 s)
Option Explain
–infected Show only the virus-infected files
–remove Delete the virus-infected files
–recursive Scan subdirectories recursively

You can check each option with clamscan -h.

However

This only installs a virus scanning tool. Since technology advances day by day and there is no guarantee you won’t be compromised, always keep an eye on security trends.

kenzo0107

kenzo0107