Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Notes on the deployment of clamav antivirus software

Shulou Source: shulou.com Published: 2022-06-01 03:12:11 10月05日 Update

Environment: Centos 7.2

Software: clamav

Step 1: download Clamav

Wget http://www.clamav.net/downloads/production/clamav-0.99.2.tar.gz

Step 2: create clamav users and groups

Groupadd clamav useradd-g clamav clamav

Step 3: compile and install

Tar xf clamav-0.99.2.tar.gzcd clamav-0.99.2./configure-- prefix=/usr/local/clamav & & make & & make install

Step 4: configure

Mkdir / usr/local/clamav/logs (log storage directory) touch / usr/local/clamav/logs/clamd.logtouch / usr/local/clamav/logs/freshclam.logmkdir / usr/local/clamav/updata (clanav virus library directory) chown-R root.clamav / usr/local/clamav/chown-R clamav.clamav / usr/local/clamav/updata/chown clamav.clamav / usr/local/clamav/logs/clamd.logchown clamav.clamav / usr/local/clamav/logs/freshclam.logcd / usr/ Local/clamav/etccp clamd.conf.sample clamd.confcp freshclam.conf.sample freshclam.confvi clamd.conf#Example commented out this line. LogFile / usr/local/clamav/logs/clamd.log PidFile / usr/local/clamav/updata/clamd.pid DatabaseDirectory / usr/local/clamav/updatavi freshclam.conf#Example commented out this line. DatabaseDirectory / usr/local/clamav/updataUpdateLogFile / usr/local/clamav/logs/freshclam.logPidFile / usr/local/clamav/updata/freshclam.pid

Step 5: upgrade the virus bank

/ usr/local/clamav/bin/freshclam

The process takes a long time, about half an hour. Let's wait. You can turn on screen to do it.

/ usr/local/clamav/bin/clamscan-- remove (kill the current directory and delete infected files)

Step 6: plan tasks

Application of actual production environment

Generally use scheduled tasks to let the server regularly follow the new and regular antivirus every night. Save the antivirus log, my crontab file is as follows

Yum install crontabs-y/sbin/service crond start / / start the service / sbin/service crond stop / / close the service / sbin/service crond restart / / restart the service / sbin/service crond reload / / reload the configuration chkconfig crond on / / boot centos6systemctl enable crond.service / / boot boot centos7crontab-e1 3 * / usr/local/clamav/bin/freshclam 303 * / usr/ Local/clamav/bin/clamscan-- infected-r /-- remove-l / var/log/clamscan.log

Tags: Services directories one line tasks files logs comments environment virus virus library configuration software actual hour server user process new and upgrade application Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi macOS Microsoft Huawei NVidia