DansGuardian のインストール(Ubuntu 上)
【概要】WebフィルタリングソフトウェアDansGuardianは開発停止し非推奨となり、Ubuntu 24.04 LTSでは通常インストールできない。後継のe2guardianなどが代替として推奨される。以下はDansGuardianの過去のインストール手順に関する情報である。
DansGuardian は、Web ページなどのフィルタリング機能をもったソフトウェアである。Ubuntu 24.04 LTS などの新しい環境では、標準リポジトリに含まれていないため、通常の方法ではインストールできない。DansGuardian からフォークされた後継プロジェクトである e2guardian は現在も活発に開発が続けられており、Ubuntu 24.04 LTS の標準リポジトリ(universe)に含まれているため、Web フィルタリング機能としては e2guardian などの代替ソフトウェアを検討できる。
前準備
Ubuntu のシステム更新
Ubuntu で OS のシステム更新を行うには、次のコマンドを実行する。
# パッケージリストの情報を更新
sudo apt update
# インストール済みのパッケージを包括的に更新 (依存関係も考慮)
sudo apt full-upgrade
# 変更をシステム全体に確実に反映させるために再起動
sudo shutdown -r now
DansGuardian のインストールと設定(Ubuntu 上)
以下の手順は、非推奨ソフトウェアである DansGuardian をインストールし、ClamAV と連携させるための設定ファイル変更を行うものである。ただし、Ubuntu 24.04 LTS では apt install dansguardian
が標準リポジトリにパッケージが存在しないため、通常失敗する点に留意が必要である。
# ウイルススキャン連携用の ClamAV をインストールする
sudo apt -y install clamav-daemon clamav-freshclam
# ウイルス定義ファイルを更新する
sudo freshclam
# DansGuardian をインストールする(Ubuntu 24.04 LTS では通常インストールできない)
sudo apt -y install dansguardian
# DansGuardian の設定ファイル dansguardian.conf を編集する
# オリジナルを一時ファイルにコピーする
cp /etc/dansguardian/dansguardian.conf /tmp/dansguardian.conf.$$
# 一時ファイルを sed コマンドで編集し、必要な設定を有効化/変更する
# - UNCONFIGURED フラグを有効にする
# - contentscanner を ClamAV (clamdscan) に設定する
# - daemonuser を clamav ユーザーに設定する
# 注意: これらの設定値やファイルパスは古いバージョンのものであり、
# 現在の ClamAV や Ubuntu 環境では異なる可能性がある
cat /tmp/dansguardian.conf | \
sed 's/#UNCONFIGURED/UNCONFIGURED/' | \
sed 's/#contentscanner = .*/contentscanner=\'\/etc\/dansguardian\/contentscanners\/clamdscan.conf\'/' | \
sed 's/#daemonuser = .*/daemonuser=\'clamav\'/' \
> /tmp/dansguardian.conf.NEW.$$
# 編集済みの設定ファイルを所定の位置に戻す
sudo cp /tmp/dansguardian.conf.NEW.$$ /etc/dansguardian/dansguardian.conf
# DansGuardian サービスを有効化し、開始する
# インストールおよび設定が成功した場合に実行可能であるが、
# Ubuntu 24.04 LTS 環境ではサービスが存在しない可能性が高い
# sudo systemctl enable dansguardian
# sudo systemctl start dansguardian