[root@fedora ~]# vi /usr/local/etc/clamd.conf ← clamd設定ファイル編集
# 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 /tmp/clamd.log
LogFile /var/log/clamd.log ← ログを記録する
# Log time with each message.
# Default: no
#LogTime yes
LogTime yes ← ログに日時も記録する
# Path to a local socket file the daemon will listen on.
# Default: disabled (must be specified by a user)
#LocalSocket /tmp/clamd.socket
LocalSocket /tmp/clamd.socket ← ソケット通信設定
# Remove stale socket after unclean shutdown.
# Default: no
#FixStaleSocket yes
FixStaleSocket yes ← clamd強制終了後の再起動不可対処
[root@fedora ~]# vi /usr/local/etc/freshclam.conf ← freshclam設定ファイル編集
# Comment or remove the line below.
#Example ← 行頭に#を追加(コメントアウト)
# Path to the log file (make sure it has proper permissions)
# Default: disabled
#UpdateLogFile /var/log/freshclam.log
UpdateLogFile /var/log/freshclam.log ← ログを記録する
# Uncomment the following line and replace XY with your country
# code. See http://www.iana.org/cctld/cctld-whois.htm for the full list.
#DatabaseMirror db.XY.clamav.net
DatabaseMirror db.jp.clamav.net ← ウィルス定義ファイル入手元を日本に変更
# Send the RELOAD command to clamd.
# Default: no
#NotifyClamd /path/to/clamd.conf
NotifyClamd /usr/local/etc/clamd.conf ← ウィルス定義ファイル更新をclamdに通知する
[root@fedora ~]# touch /var/log/freshclam.log ← 空のログファイルを作成
[root@fedora ~]# chown clamav:clamav /var/log/freshclam.log ← ログファイルの所有者を変更
[root@fedora ~]# freshclam ← ウィルス定義ファイル更新
ClamAV update process started at Thu Aug 23 10:26:00 2007
main.cvd is up to date (version: 44, sigs: 133163, f-level: 20, builder: sven)
・
・
・
daily.cvd updated (version: 4032, sigs: 15068, f-level: 21, builder: ccordes)
Database updated (148231 signatures) from db.jp.clamav.net (IP: 203.212.42.128)
WARNING: Clamd was NOT notified: Can't connect to clamd through /tmp/clamd.socket
connect(): No such file or directory
[root@fedora ~]# vi freshclam ← ウィルス定義ファイル更新スクリプト作成
#!/bin/sh
/usr/local/bin/freshclam --quiet
[root@fedora ~]# chmod 700 freshclam ← ウィルス定義ファイル更新スクリプトに実行権限付加
[root@fedora ~]# mv freshclam /etc/cron.hourly/ ← ウィルス定義ファイル更新スクリプトを1時間毎に自動実行されるディレクトリへ移動
[root@fedora ~]# vi /etc/logrotate.d/clamd ← clamdログローテーション設定ファイル新規作成
/var/log/clamd.log {
sharedscripts
postrotate
/etc/rc.d/init.d/clamd restart > /dev/null || true
endscript
}
[root@fedora ~]# vi /etc/logrotate.d/freshclam ← freshclamログローテーション設定ファイル作成
/var/log/freshclam.log {
missingok
notifempty
create 644 clamav clamav
}
|
|