ftp://ftp.pasta.cs.uit.no/pub/Vermicelli/ から、 www6to4-latest.tar.gz (執筆時の最新バージョンは 1.5) を取ってきて、作業フォルダに解凍して compile する。
% cd /usr/local/src % wget ftp://ftp.pasta.cs.uit.no/pub/Vermicelli/www6to4-latest.tar.gz % tar zxfv www6to4-latest.tar.gz % cd www6to4-* % make % sudo mv www6to4 /usr/local/sbin % sudo mv *.conf /etc
次に /etc に copy した設定ファイル www6to4.conf と www6to4_forward.conf を適宜編集する。
/etc/www6to4.conf は特に必要がなければ標準の設定のままにしておいて構わない。 導入後に画像ファイルが表示されないことが頻繁に起るようなら、pattern に関する設定の部分をすべてコメントにする。
# Sample Configuration file for the WWW6to4 IPv4 to IPv6 WWW Proxy # the forwardfile defines domain-specific routing # forwardfile /etc/www6to4_forward.conf # To open the proxy to all, uncomment the following line: #listen-to * # other example usage: #listen-to 124.207.250.245,127.0.0.1,::1 # to explicitly state what is now the default: listen-to 127.0.0.1,::1 listen-port 8000 # default timeout used is short (5 seconds) for URLs that match a given # pattern and 60 seconds for all else. # patterns that cause short timeout when found (anywhere) in requested URL: #pattern .gif #pattern .png #pattern .jpg #pattern size= #pattern sz= #pattern doubleclick # You can multiply the timeout values by a factor. # For example, the line below makes the timeouts 10 and # 120 seconds respectively: #timeout-factor 2
/etc/www6to4_forward.conf は "* ." という部分以外はすべてコメントにする。
# # This feature allows routing of HTTP requests via multiple proxies. # The syntax of each line is # # [proto://]target_domain[:port][/path] forwarding_domain[:port] # proto can be ftp, http, https # target_domain may contain a `*' wildcard # A '.' in the forwarding domain/port means that requests made to the # target domain are not forwarded but are made directly by the proxy # # Lines are checked in turn, and the last match wins. # # There is an implicit line equivalent to the following, which specifies that # anything not finding a match on the list is to go out without forwarding # or gateway protocol; like so: # * . # this is default implicit base config # In the following example configuration, everything is done directly except # for ftp requests and non-ftp requests to norwegian domains. Those are sent # via the Tromso University its www-proxy (listening here at port 5555). # # Note, that www6to4 does not support ftp requests itself, i.e. it can only # forward them to some other proxy that does support them. #.no proxy.uit.no:5555 #ftp://* proxy.uit.no:5555 # The example config below, sends everything through the proxy (at port 5555), # except for SSL connections and `local' connections within uit.no. #* proxy.uit.no:5555 #:443 . #uit.no .
以上で www6to4 の install は完了です。
/etc/squid.conf に以下を追加する。
[line 100 くらい 〜] # OPTIONS WHICH AFFECT THE NEIGHBOR SELECTION ALGORITHM # ----------------------------------------------------------------------------- # TAG: cache_peer … # NOTE: non-ICP neighbors must be specified as 'parent'. # #cache_peer hostname type 3128 3130 cache_peer 127.0.0.1 parent 8000 3130
まず www6to4 (/usr/local/sbin/www6to4) を起動する。 Debian GNU/Linux の場合は、以下のような起動 Script を /etc/rc.d 以下に用意するとよい。
#!/bin/sh
#
DAEMON=/usr/local/sbin/www6to4
if [ ! -x $DAEMON ]
then
exit 0
fi
case $1 in
start)
start-stop-daemon --start --background --verbose --exec $DAEMON
;;
stop)
start-stop-daemon --stop --verbose --exec $DAEMON
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: /etc/init.d/www6to4 {start|stop|restart}"
exit 1
;;
esac
exit 0
www6to4 の起動を確認したら、Squid を起動する。
www6to4 および Squid が問題なく起動したら、試しに www.kame.net に access してみる。 画面にダンシングカメが踊ってる絵がモザイクなしで表示されれば作業完了。