Linuxで使えるDelegateは"http://www.delegate.org/anonftp/DeleGate/"にあります。
いろいろなバージョンのDelegateがありますが、Delegateのトップページのthe latest stable version…最新の安定したバージョンをダウンロードすることをおすすめします。
まず、ダウンロードしてきたdelegate*.*.*.tar.gzを解凍します。
delegate*.*.*.tar.gzは/home/user/にあるとします。
$ tar xvzf delegate*.*.*.tar.gz
とします。解凍はあっという間です。delegate*.*.*というディレクトリが作成されます。
次に、delegate*.*.*ディレクトリに移動してmakeします。
makeには標準ではインストールされない gcc や gcc-c++ が必要なので、わたしのような初心者は注意して下さい。
$ cd delegate*.*.*
$ make
とするとmakeが始まります。
すぐmakeは停止します。ここでDelegateの管理者のEメールアドレスを入力します。個人で使うなら出鱈目でも構いません(*^_^*)
で、確認が入りますので "y"と入力”Enter"でmakeが再開されます。PCのスペックにもよりますがコーヒー一杯くらい飲めます(^-^)/
makeが終わったら/home/user/delegate*.*.*/src/ディレクトリにdelegated(Delegate本体)が作成されています。
ここで、スーパーユーザーつまりrootになってください。
$ su -
とし、パスワード入力します。
スーパーユーザーになったら、delegatedを/usr/local/etc/にコピーします。
# cp /home/user/delegate*.*.*/src/delegated /usr/local/etc/delegated
で、…コピペは申し訳ないので、
Setter's Homeの"http://i-red.info/docs/JF/delegate-mini-howto-config.html"を参考に
/etc/cron.daily/ディレクトリにdel_delegate_old_log
/home/delegate/ディレクトリ
/usr/local/etc/ディレクトリにdelegated.sh及びdelehttp.confを作成して下さい。
この時、わたしのような初心者はdel_delegate_old_logとdelegated.shに実行権限を与えるのを忘れないで下さい。
# chmod 700 /etc/cron.daily/del_delegate_old_log
# chmod 700 /usr/local/etc/delegsted.sh
とします。
RedHat上のこのDelegateは次のような設定になっています。
1.Delegateが使うディレクトリ/home/delegate/を作る。必要であれば/home/delegate/ディレクトリにキャッシュディレクトリを作成する。
2./usr/local/etc/ディレクトリにdelegatedをコピーする
3./usr/local/etc/ディレクトリに基本設定ファイル(delegated.sh)・ 設定ファイル(delehttp.conf)を作成する。
このDelegateの起動にはスクリプトを使います。
iptablesの設定でも同じような方法を使いましたが/root/bin/ディレクトリにスクリプトを作ります。
# mkdir /root/bin
# vi bin/proxy start
とし、proxy_startというスクリプトを作ります。
==< proxy_start >=======================================================この下の行から
#!/bin/sh
#http proxy
/usr/local/etc/delegated.sh -P192.168.2.1:8080 +=/usr/local/etc/delehttp.conf
#End
======================================================================この上の行まで
このスクリプトに、実行権限を与えます。
# chmod 700 bin/proxy_start
同じ要領でproxy_stopとproxy_restartの2つのスクリプトを作ります。
==< proxy_stop >========================================================この下の行から
#!/bin/sh
#http proxy
/usr/local/etc/delegated.sh -P192.168.2.1:8080 -Fkill
#End
=======================================================================この上の行まで
==< proxy_restart >======================================================この下の行から
#!/bin/sh
#http proxy
/usr/local/etc/delegated.sh -P192.168.2.1:8080 -Fkill-hup
#End
=======================================================================この上の行まで
こうしておけば、Delegateの起動・停止・再起動が楽になります。
# proxy_start
で、Delegate起動
# proxy_stop
で、Delegate停止
# proxy_restart
で、Delegate再起動となります。
ブート時にDelegateを起動するには、/etc/rc.d/ディレクトリのrc.localファイルの記述を変更します。
# vi /etc/rc.d/rc.local
とすると、初期設定では以下の通りになっています。
--< rc.local >------------------------------------------
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
------------------------------------------------------
コメントアウトされているところを直訳すると…
このスクリプトは他のすべてのinitスクリプトの*後に*実行されるでしょう。
full Sys Vスタイルの??init stuffを使いたくなければ、
この中に自分の初期化材料を置くことができます。
要は、inetdやxinetd経由でブート時に起動したくないデーモンはここに記述してくださいって事でしょう…
で、記述を加えて以下の通りにします。
--< rc.local >---------------------------------------------------------
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
#http proxy
/usr/local/etc/delegated.sh -P192.168.2.1:8080 +=/usr/local/etc/delehttp.conf
---------------------------------------------------------------------
これで、あなたのDelegateはRedHatのブート時に起動します。