.. index:: squidclamav_5.11 squidclamav 5.11 ================ .. contents:: Contents =========== 実行環境 =========== | :ref:`sl_6.4` | :ref:`ubuntsu_server_12.04` =========== 最終検証日 =========== 2014/07/29 =========== 依存関係 =========== * :doc:`../../library/openssl/index` * :doc:`../../library/curl/index` * :doc:`../../middle/squid/index` * :doc:`../../middle/clamav/index` =========== コンパイル =========== .. note:: 基本的には管理者ユーザ(rootなど)で実施していることを前提としています .. code-block:: bash #------------------------------------------------------------ # squidclamav-5.11 #------------------------------------------------------------ BASE=/opt/brew export CPPFLAGS="-I${BASE}/include" export LDFLAGS="-Wl,-L${BASE}/lib,-R${BASE}/lib" # ソースダウンロード先 comp_dir=/usr/local/src # パッケージ名 pack_name=squidclamav # バージョン version=-5.11 # ソースのファイル形式 ext=.tar.gz # 解凍コマンド tar_cmd="tar zxf" # インストール先ディレクトリ ins_dir=/opt/${pack_name}/${version##-} # ダウンロード元パッケージ dl_uri="http://downloads.sourceforge.net/project/squidclamav/squidclamav/5.11/squidclamav-5.11.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fsquidclamav%2Ffiles%2Fsquidclamav%2F5.11%2F&ts=1406521682&use_mirror=citylan" # コンパイル時の並列数 proc_num=`cat /proc/cpuinfo | grep processor | wc -l` cd ${comp_dir} rm -rf ${pack_name}${version} test -f ${pack_name}${version}${ext} \ || wget ${dl_uri} -O ${pack_name}${version}${ext} ${tar_cmd} ${pack_name}${version}${ext} cd ${pack_name}${version} ./configure \ --prefix=${ins_dir} \ && nice -n 15 make -j${proc_num}\ && make install ================ Pathの設定 ================ .. code-block:: bash for type in $(ls -1 ${ins_dir}) do for src in $(find ${ins_dir}/${type} -xtype f) do parent=`dirname ${src#*/${type}/}` filename=`basename ${src}` mkdir -p /opt/brew/$type/$parent echo "ln -fs ${src} ${BASE}/${type}/${parent}/${filename}" ln -fs ${src} ${BASE}/${type}/${parent}/${filename} done done grep -q ${BASE}/bin ~/.bashrc \ || echo "export PATH=${BASE}/bin:${BASE}/sbin:"'${PATH}' >> ~/.bashrc \ ; source ~/.bashrc ======================== 主なconfigureオプション ======================== ``--prefix=[DIR]`` インストール先ディレクトリの指定 =============== 設定ファイル =============== squidclamav.conf --------------------- {PREFIX}/etc/ の配下に作成されています。 .. code-block:: bash # ファイルの格納場所がわからない場合、下記コマンドを実行します # -f オプションの説明のところに記載があります squid --help squid.conf ------------ squidの設定ファイルに下記を追記します。 あらかじめ設定が重複している場合は既存を上書きしてください。 .. code-block:: diff # diff -u squid.conf.before squid.conf --- squid.conf.before 2014-07-29 22:43:23.577986093 +0900 +++ squid.conf 2014-07-29 22:31:15.665984787 +0900 @@ -27,6 +27,16 @@ # キャッシュしない cache deny all +# ウィルススキャンの設定 +url_rewrite_program /opt/squidclamav/5.11/bin/squidclamav +url_rewrite_children 15 +acl purge method PURGE +http_access deny to_localhost +http_access allow localhost +http_access allow purge localhost +http_access deny purge +url_rewrite_access deny localhost + # # アクセスを許可するサイト # acl whitelist_regex url_regex "/path/to/whitelist_regex" # http_access allow whitelist_regex ============== 動作確認 ============== テストウィルスの仕込まれたファイルをダウンロードしてみて、拒否されるかを確認します。 http://www.eicar.org/download/eicar_com.zip