トップ «前の日記(2007-01-25 (Thu)) 最新 次の日記(2007-01-31 (Wed))» 編集

ふたつの川うるおう日記


2007-01-30 (Tue)

_ [Seasar][Server] app01サーバ移設

明日app01サーバが移設されます。機能は既に他に退避済みなので見た目で判る制限は特にありません。

| Bookmark:

_ [Server][Admin] mod_rewriteを使ったメンテナンス表示

最近メンテナンス表示するのにmod_rewriteでやるようになりました。mod_rewriteでやるとどんなWEBアプリだろうと気にせず接続元絞ったりなどしてメンテナンス表示出来ます。

IP xxx.xxx.xxx.xxxからの接続は通常表示して、他の接続元はすべてメンテナンスページに飛ばす方法はこんな感じ。メンテナンスするアプリの例はApache 2.2のmod_proxy_ajpでTomcatと連携しているWEBアプリ。実質mod_rewriteの部分だけ見ればOK。

<IfModule proxy_ajp_module>
    ProxyRequests Off
    ProxyPass /context ajp://app02.example.org:8009/context
    ProxyPassReverse /context ajp://app02.example.org:8009/context
    ## for under maintenance
    RewriteEngine On
    RewriteCond %{REMOTE_ADDR} !^xxx\.xxx\.xxx\.xxx$
    RewriteRule ^/context/(.*) http://www.example.org/maintenance/ [L,R,NE]
</IfModule>

メンテが終わったらRewrite*の部分をコメントアウトして再起動すればOK。

| Bookmark:
[]

| Return to page top | Vicuna CMS - WordPress Theme - Vicuna Ninja Style for tDiary |