[web] Pound でロードバランス
http://www.apsis.ch/pound/index_html
mod_proxy_balancer もいいけど Pound してみたかった。
日本語の検索結果に出てくるのはほとんど古いバージョンで、設定ファイルの記法が少しばかり違ってます。
とことんシンプルなので、英語 man でも不都合はないです。
よくわからないのが ssl を挟んだときの動きかた。
こんな風にしてみるつもりで、ごにょごにょしてみた。
[pound:443]--+--[tomcat:8080] | +--[apache2:80]
設定ファイルはこんなかんじ。抽出してます。
ListenHTTPS Address 0.0.0.0 Port 443 Cert "/var/tmp/cert.pem" ## allow PUT and DELETE also (by default only GET, POST and HEAD)?: xHTTP 0 Service URL ".*/(examples|docs|host-manager|manager|servlet).*" BackEnd Address 127.0.0.1 Port 8080 End End Service BackEnd Address 127.0.0.1 Port 80 End End End
最初は何も問題なさげ。
- https://localhost/ で apache2 のデフォルトの「It Works!」が見れた
- アドレスバーは「https://localhost/」と表示
- https://localhost/manager で Tomcat Manager が見れた
- アドレスバーは「https://localhost/manager/html」と表示
- https://localhost/examples で examples が見れた
- アドレスバーは「https://localhost/examples」と表示
だけど、Tomcat Manager のアプリケーション一覧から examples とかに行けない。
リンクにカーソルを合わせると、ステータスバーには
"https://localhost/examples" を開く
と表示されてるんだけど、リンクを踏むと
http://localhost/examples/
にアクセスしようとしてしまう。
相対リンクのはずなので、https だったらそのままいくと思ったのにぃ ...
試しに相対リンクと絶対リンクを書いた html を apache2 経由で参照したら、ちゃんと見れた。
なんで ?
Tomcat Manager でなんかしてるのかな ?
特に追求する気はないけど、これでひっかからなければいいな。