!!!概要 DeleGateで基本的なHTTP Proxyを構成してみます。 !!!設定 !!設定ファイル HTTP Proxyの設定例です。 /usr/local/delegate/conf/proxyhttp.conf --------------------------------------------------------------------- # configuration for Proxy-HTTP # ポート設定 -P8080 # サーバ種別の設定 SERVER=http # 接続元の制限 PERMIT='*:*:127.0.0.1,192.168.0.0/24' # Proxyっぽいヘッダを削除する HTTPCONF='kill-head:Via,HTTP-VIA,DeleGate-Ver' # ログ出力設定(1日ごとに1ファイル) LOGDIR='${DGROOT}/log' LOGFILE='${LOGDIR}/${PORT}/log.[date+%d]' PROTOLOG='${LOGDIR}/${PORT}/${PROTO}.[date+%d]:%X %D' ERRORLOG='${LOGDIR}/${PORT}/errors.[date+%d]' TRACELOG='${LOGDIR}/${PORT}/ptrace.[date+%d]' EXPIRELOG='${LOGDIR}/${PORT}/expire.[date+%d]' # キャッシュファイル自動削除 CRON='0 3 * * * -expire 7' !!キャッシュディレクトリ キャッシュディレクトリを作成しておきます。delegatedのCACHE=doパラメータを使って作ってもよいです。 # mkdir /usr/local/delegate/cache # chown delegate:delegate /usr/local/delegate/cache !!ログファイル自動削除 ログファイルのローテーションは自動で行われますが古いログファイルは「〜.old」という名前で残されるので別途cronで削除します。DeleGateのCRON機能を使ってもよいです。 # crontab -e --------------------------------- 以下のエントリを追記 # purge delegate log 30 3 * * * find /usr/local/delegate/log -type f -name \*.old -mtime +30 -exec rm -f {} \; >/dev/null 2>&1 !!!起動 !!起動スクリプト 起動スクリプトの例です。 #!/bin/sh # rc script for delegate DGROOT=/usr/local/delegate PROG=$DGROOT/bin/delegated CONF=$DGROOT/conf/proxyhttp.conf OWNER=delegate/delegate case "$1" in start) $PROG OWNER=$OWNER DGROOT=$DGROOT +=$CONF ;; stop) $PROG OWNER=$OWNER DGROOT=$DGROOT +=$CONF -Fkill ;; reload|refresh) $PROG OWNER=$OWNER DGROOT=$DGROOT +=$CONF -Fkill-hup ;; restart) $0 stop $0 start ;; *) echo "Usage: $0 [start|stop|reload|restart]" exit 1 ;; esac exit 0 !!!リンク *[DeleGate Home Page|http://www.delegate.org/delegate/] - DeleGate公式サイト *[Resetting Linux ( and DeleGate + Postfix )|http://i-red.info/] - DeleGateドキュメント和訳