Skip to content

Instantly share code, notes, and snippets.

@iorionda
Last active August 29, 2015 14:01
Show Gist options
  • Select an option

  • Save iorionda/e0404d62d9f5299f19ef to your computer and use it in GitHub Desktop.

Select an option

Save iorionda/e0404d62d9f5299f19ef to your computer and use it in GitHub Desktop.
Clamav-for-Mac

Mac OS X 上で clamd を動かす

ClamAV のパッケージをHomebewを使ってインストールする。

% brew install clamav

ClamAV のプロセスを実行する前に、ウイルス定義のデータベースが必要になる、 freashclam.conffreshclam.conf.sample からコピーして作成し、 ウィルス定義ファイル入手先を日本に設定する。

DatabaseMirror db.jp.clamav.net

freshclam を実行する。

% freshclam -v

すると、 ClamAV のウイルス定義データベースがダウンロードされる。 また、出力は以下のようになる。

Current working dir is /usr/local/Cellar/clamav/0.98.3/share/clamav
Max retries == 3
ClamAV update process started at Wed May 14 14:05:32 2014
Using IPv6 aware code
Querying current.cvd.clamav.net
TTL: 962
Software version from DNS: 0.98.3
main.cvd version from DNS: 55
main.cvd is up to date (version: 55, sigs: 2424225, f-level: 60, builder: neo)
daily.cvd version from DNS: 18979
daily.cld is up to date (version: 18979, sigs: 950655, f-level: 63, builder: neo)
bytecode.cvd version from DNS: 236
bytecode.cvd is up to date (version: 236, sigs: 43, f-level: 63, builder: dgoddard)

次に clamd.conf を作成する。 これも、先ほどと同様に clamd.conf.sample からコピーして作成すれば良い。 今回はローカルでのみ動作させるのを目的としているので、ファイルに以下の内容を追記する。

# /usr/local/etc/clamd.conf
TCPAddr 127.0.0.1
TCPSocket 9321

次に、ソケットディレクトリを用意する。

% mkdir /usr/local/var/run/clamav

ここまで設定すれば動作させることができる。

% clamd

これで clamd のプロセスが起動される。

@hirogata
Copy link
Copy Markdown

freshclam.conf.sample からコピーして作成し、 ウィルス定義ファイル入手先を日本に設定する。

brew でインストールすると、sampleをコピーした後、Example という行をコメントアウトか削除する必要があるようでした

##
## Example config file for freshclam
## Please read the freshclam.conf(5) manual before editing this file.
##


# Comment or remove the line below.
Example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment