ClamAV installation Configuration

Source: Internet
Author: User
Installation and configuration of clamav antivirus software:

Install the ClamAV AntiVirus software and scan and kill the software on the Guizhou node to check whether the virus exists.

The zlib library should be included when ClamAV is compiled for compression and decompression functions.

1. System Environment: centos6.4

Software: zlib-1.2.7.tar.gz clamav-0.97.6.tar.gz

Software:

Http://nchc.dl.sourceforge.net/project/libpng/zlib/1.2.7/zlib-1.2.7.tar.gz

Http://nchc.dl.sourceforge.net/project/clamav/clamav/0.97.6/clamav-0.97.6.tar.gz

 

2. Installation

[[Email protected] # wgethttp: // nchc.dl.sourceforge.net/project/libpng/zlib/1.2.7/zlib-1.2.7.tar.gz

[[Email protected] # wget

Http://nchc.dl.sourceforge.net/project/clamav/clamav/0.97.6/clamav-0.97.6.tar.gz

 

2.1 zlib Installation

[[Email protected] Test] # tar xfzlib-1.2.7.tar.gz

[[E-mail protected] Test] # cd zlib-1.2.7

[[Email protected] zlib-1.2.7] #./configure

[[Email protected] zlib-1.2.7] # Make & make install

[[Email protected] zlib-1.2.7] # CD ..

2.2 Add a user

Add a user group ClamAV and a group member ClamAV (Note: you must add a user before installing clamav-0.97.6.tar.gz)

[[Email protected] Test] # groupadd ClamAV

[[Email protected] Test] # useradd-G ClamAV-S/bin/false-c "Clam Antivirus" ClamAV

2.3 install ClamAV

[[Email protected] Test] # tar xfclamav-0.97.6.tar.gz

[[E-mail protected] Test] # cd clamav-0.97.6

[[Email protected] clamav-0.97.6] #./configure -- prefix =/opt/ClamAV -- disable-ClamAV

[[Email protected] clamav-0.97.6] # Make & make install

3. Configure 3.1 to create a directory.

Mkdir/opt/ClamAV/logs (log storage directory)

Mkdir/opt/ClamAV/updata (clanav virus database directory)

3.2 Create a file:

Add two logs files in the/var/log directory: clamd. log and freshclam. log. Change the owner to the newly added ClamAV user and set the corresponding file read/write permissions.

Touch/opt/ClamAV/logs/freshclam. Log

Touch/opt/ClamAV/logs/clamd. Log

3.3 configure the/etc/clam. conf file

[[Email protected] clamav-0.97.6] # cd/opt/ClamAV

[[Email protected] ClamAV] # Vim ETC/clam. conf

# Example comment out this line. 8th rows

Logfile/opt/ClamAV/logs/clamd. Log

Pidfile/opt/ClamAV/updata/clamd. PID

Databasedirectory/opt/ClamAV/updata

3.4 configure the freshclam. conf file

[[Email protected] ClamAV] # vimetc/freshclam. conf

# Example comment out this line

Databasedirectory/opt/ClamAV/updata

Updatelogfile/opt/ClamAV/logs/freshclam. Log

Pidfile/opt/ClamAV/updata/freshclam. PID

3.5 file authorization

[[Email protected] ClamAV] # chown ClamAV: ClamAV/opt/ClamAV-R

 

4. Run the 4.1 upgrade

[[Email protected] ClamAV] #/opt/ClamAV/bin/freshclam

# Upgrade the virus Database

4.2 Anti-Virus

[[Email protected] ClamAV] #/opt/ClamAV/bin/clamscan -- kill files in the current directory

[[Email protected] ClamAV] #/opt/ClamAV/bin/clamscan-r -- kill all files and directories in the current directory

[[Email protected] ClamAV] #/opt/ClamAV/bin/clamscan/home/Leng -- kill the Dir directory

[[Email protected] ClamAV] #/opt/ClamAV/bin/clamscan-r/home/Leng -- kill all files and directories in the Dir directory

4.3 view help

[[Email protected] ClamAV] #/opt/ClamAV/bin/clamscan -- Help

 

5. Automatic update

Run/opt/ClamAV/bin/freshclam-D in the background

 

Scheduled tasks:

[[Email protected] ClamAV] # crontab-e

1 3 ***/usr/local/ClamAV/bin/freshclam -- quiet

20 3 ***/usr/local/ClamAV/bin/clamscan-r/home -- remove-L/var/log/clamscan. Log


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.