clamav linux ウイルス対策、インストールをしよう

ウイルス対策をするにあたって、勝手にすごくお世話になっているサイトがあります。

clamavのインストールとアップデートはこのサイトからほとんど勉強しました。

リンク自由ということなので、URLだけ。

http://fedorasrv.com/clamav.shtml

で、サイト自体が消えてしまうと非常に困るので、

自分のブログにもclamavのインストール手順をのこしておこう。

# useradd -s /sbin/nologin clamav -m -d /usr/local/share/clamav -k /dev/null (clamav ユーザ追加)

# yum install zlib-devel gmp-devel

# tar -zxvf clamav-0.95.tar.gz

# cd clamav-0.95

# ./configure

で、エラーが出た。

configure: error: in `/root/clamav-0.95′:
configure: error: no acceptable C compiler found in $PATH
See `config.log’ for more details.

Cコンパイラをインストール。

# yum install gcc-c++

で、再度 ./configure

# ./configure

# make

# make install

■clamd.conf の設定

# vi /usr/local/etc/clamd.conf

##
## Example config file for the Clam AV daemon
## Please read the clamd.conf(5) manual before editing this file.
##

# Comment or remove the line below.
#Example

# Uncomment this option to enable logging.
# LogFile must be writable for the user running daemon.
# A full path is required.
# Default: disabled
LogFile /var/log/clamd.log

# By default the log file is locked for writing – the lock protects against
# running clamd multiple times (if want to run another clamd, please
# copy the configuration file, change the LogFile variable, and run
# the daemon with –config-file option).
# This option disables log file locking.
# Default: no
#LogFileUnlock yes

# Maximum size of the log file.
# Value of 0 disables the limit.
# You may use ‘M’ or ‘m’ for megabytes (1M = 1m = 1048576 bytes)
# and ‘K’ or ‘k’ for kilobytes (1K = 1k = 1024 bytes). To specify the size
# in bytes just don’t use modifiers.
# Default: 1M
#LogFileMaxSize 2M

# Log time with each message.
# Default: no
LogTime yes

# Also log clean files. Useful in debugging but drastically increases the
# log size.
# Default: no
#LogClean yes

# Use system logger (can work together with LogFile).
# Default: no
#LogSyslog yes

# Specify the type of syslog messages – please refer to ‘man syslog’
# for facility names.
# Default: LOG_LOCAL6
#LogFacility LOG_MAIL

# Enable verbose logging.
# Default: no
#LogVerbose yes

# This option allows you to save a process identifier of the listening
# daemon (main thread).
# Default: disabled
#PidFile /var/run/clamd.pid

# Optional path to the global temporary directory.
# Default: system specific (usually /tmp or /var/tmp).
#TemporaryDirectory /var/tmp

# Path to the database directory.
# Default: hardcoded (depends on installation options)
#DatabaseDirectory /var/lib/clamav

# The daemon can work in local mode, network mode or both.
# Due to security reasons we recommend the local mode.

# Path to a local socket file the daemon will listen on.
# Default: disabled (must be specified by a user)
LocalSocket /tmp/clamd.socket

# Remove stale socket after unclean shutdown.
# Default: yes
FixStaleSocket yes
# vi /usr/local/etc/freshclam.conf

著者:bouya Imamura