RIGHT:EBUG 第xx回会合
RIGHT:2009年11月21日、万代市民会館
RIGHT:川俣吉広、kaw@on.rim.or.jp
*DeleGateとは [#e8b1f8e9]
-アプリケーションレベルゲートウェイ(プロキシ)
--HTTP, FTP, Telnet, NNTP, SMTP, POP, IMAP, LPR, LDAP, ICP, DNS, SSL, Socks ... etc
--プロトコルを変換する機能ももっている
--とにかくなんだか色んな機能がついてる ... かなり kitchen sinkなソフト

-日本製
--産総研の佐藤豊氏が開発 ... http://www.delegate.org/
---since 1994, Current Ver. DeleGate 9.9.5
--日本語の情報サイト(マニュアルの日本語訳あり) ... http://i-red.info/ (鈴木 雄氏)

*Getting Started [#x92d4b90]
**取得 [#c76e2da5]
http://www.delegate.org/delegate/download/から取得。ちなみに
>Copyright (c) 1994-2000 Yutaka Sato <ysato AT etl.go.jp> <y DOT sato AT delegate.org> ~
Copyright (c) 1994-2000 Electrotechnical Laboratory (ETL), AIST, MITI ~
Copyright (c) 2001-2008 National Institute of Advanced Industrial Science and Technology (AIST) ~
AIST-Product-ID: 2000-ETL-198715-01, H14PRO-049, H15PRO-165, H18PRO-443 ~
~
Permission to use this material for evaluation, copy this material for your own use, and distribute the copies via publicly accessible on-line media, without fee, is hereby granted provided that the above copyright notice and this permission notice appear in all copies. AIST makes no representations about the accuracy or suitability of this material for any purpose. it is provided "as is", without any express or implied warranties. (Manual.htmより引用)

>本マテリアルの、評価のための使用 / 自らが使用するための複製 / ・誰もがアクセス可能なオンラインメディアを経由した複製の無料配布は、上記の著作権通知、および、この認可通知を、全ての複製中で、閲覧可能なことを条件として許可します。 AISTは、本マテリアルのあらゆる目的に対する、正確さや、適合性に関する表示をしません。それは、いかなる、明示、または、暗示された保証がともなわないまま、提供されています。(http://i-red.infoより引用)

という使用条件となっている。
**ビルド [#p6b53590]
OSごとのバイナリパッケージを利用するか、または、
 tar xvzf delegateX.Y.Z.tar.gz
 cd delegateX.Y.Z
 CFLAGS='-O6' ADMIN='kaw@on.rim.or.jp' make
 sudo install -o root -g wheel -m 0755 src/delegated /usr/local/sbin
 ↑注)stripしないこと!
**起動 [#rea22e90]
delegatedは、設定ファイルを持たない。指定はすべてコマンドラインから((「パラメータ置換」機能を使用して別ファイルに書いておくこともできる))。

基本形
>delegated -P['''host''':]'''port''' OWNER='''user'''[/'''group'''] DGROOT='''system-dir''' '''parameters''' ['''parameters...''']

なので、通常はシェルラッパーを作成し、そこにパラメータを書いておいてそれを起動。たとえば、dodg.sh↓
 #!/bin/sh
 exec /usr/local/sbin/delegated ONWER=delegate/delegate DGROOT=/var/spool/delegate "$@"
とかやって
 dodg.sh -P8080 SERVER=http
など。~
勿論、実行時は
 /usr/local/sbin/delegated ONWER=delegate/delegate DGROOT=/var/spool/delegate -P8080 SERVER=http
となる。
**停止 [#w3226587]
停止は-Fkill、再起動には-Fkill-hup
 dodg.sh -P8080 -Fkill

起動・停止をまとめて、こんな感じにしてもOK。 ... rc.delegate↓
 #!/bin/sh
 function dg {
     /usr/local/sbin/delegated \
         ONWER=delegate/delegate \
         DGROOT=/var/spool/delegate \
         "$@" ;
 }
 
 case X"$1" in
     Xstart)   dg "$@" ;;
     Xstop)    dg -Fkill "$@" ;;
     Xrestart) dg -Fkill-hup "$@" ;;
 esac
**ロギング・デバッグ [#da1b0f59]
ログは、DGROOT/log/*に作成される。デバックには、
 dodg.sh -v -P...  (フォアグラウンドで実行、ログもstdoutに)
ログファイルは、strftime(3)互換の書式準拠で指定可能。自前でログローテートできる。例;
 LOGDIR='log[date+/aged/%y/%m/%d]' 
*使用例 [#ube910a9]
**基本 [#c27d9118]
普通にHTTPプロキシとして使用。CACHE=yes or CACHE=do でキャッシュ機能が有効になる。
 dodg.sh -P10080 SERVER=http CACHE=do
同様に、FTPプロキシとして使用。
 dodg.sh -P10021 SERVER=ftp
HTTP経由のFTPアクセスではない純粋なFTPプロキシ。FTPクライアントでDeleGate FTPプロキシに接続後、
login: user@desthost
password: xxxxx
で、目的のホストに接続。
 $ ftp 192.168.1.6 10021          
 Connected to 192.168.1.6.
 220- 192.168.1.6 PROXY-FTP server (DeleGate/9.9.5-pre3) ready.
 220-   @ @
 220-  ( - ) { DeleGate/9.9.5-pre3 (August 27, 2009) }
 220- AIST-Product-ID: 2000-ETL-198715-01, H14PRO-049, H15PRO-165, H18PRO-4
 220- Copyright (c) 1994-2000 Yutaka Sato and ETL,AIST,MITI
 220- Copyright (c) 2001-2009 National Institute of Advanced Industrial Scind Technology (AIST)
 220- WWW: http://www.delegate.org/delegate/
 220- --
 220- You can connect to a SERVER by `user' command:
 220-    ftp> user username@SERVER
 220- or by `cd' command (after logged in as an anonymous user):
 220-    ftp> cd //SERVER
 220- Cache is enabled by default and can be disabled by `cd .' (toggle)
 220- This (proxy) service is maintained by 'kaw@on.rim.or.jp'
 220- 
 220-extended FTP [MODE XDC][XDC/BASE64]
 220  
 Name (192.168.1.6:kaw): anonymous@ftp.ring.gr.jp
 331 Password required for anonymous.
 Password:
 230-- PASS for anonymous@ftp.ring.gr.jp.
  220---------- Welcome to Pure-FTPd ----------
  220-You are user number 9 of 50 allowed.
  220-Local time is now 23:56. Server port: 21.
  220-IPv6 connections are also welcome on this server.
  220 You will be disconnected after 15 minutes of inactivity.
  331-
  331-         ##################################################
  331-         #     Welcome to the RingServer FTP service.     #
  331-         ##################################################
  331-
  331-
  331 Any password will work
 230- Any password will work
 230--  @ @  
 230  \( - )/ -- { connected to `ftp.ring.gr.jp' }
 Remote system type is UNIX.
 Using binary mode to transfer files.
 ftp> dir
 150 Accepted data connection
 drwxr-xr-x    7 1001     0            4096 Nov 14 01:39 .
 drwxr-xr-x    7 1001     0            4096 Nov 14 01:39 ..
 -rw-r--r--    1 1001     1000          183 Sep 24  2007 .banner
 -r--r--r--    1 1001     1000     62551793 Nov 14 00:11 00ls_archive
     :
     :
あるいは、
login: user
password: xxxxx
で、DeleGate FTPプロキシにlogin後、
 cd //desthost
で目的のdesthostに接続する。
**応用 [#c27d9118]
-specialist-generalist
#ref(ssh-delegate.png,wrap)
-inetd
-origin-server
-protocol mount
-fci
-sslway
*その他諸々 [#iccc7a25]
**セキュリティ [#v27b266b]
**IPv6対応 [#s3687cef]
*まとめ [#s75de829]

Front page   New Page list Search Recent changes   Help   RSS of recent changes