Tomcat 6.0.18 で実行している Web アプリに取り組んでおり、リバース プロキシとして Apache 2 を使用しています。これはうまくいきます。また、たとえば、再展開などのためにTomcatをシャットダウンしたときに、Apacheにエラーページを表示させようとしています。ただし、ErrorDocument
httpd.confのディレクティブはローカルファイルに対してまったく機能していないようです。外部 URL と文字列を試してみましたが、どちらの場合も問題なく動作します。ただし、以下は機能しません。
ErrorDocument 403 /Oops.html
ErrorDocument 404 /Oops.html
ErrorDocument 502 /Oops.html
ErrorDocument 503 /Oops.html
Oops.html ファイルは htdocs フォルダーにあります。Tomcat が実行されていないが、httpd が実行されているときにアプリにアクセスしようとしたときの httpd からのログ出力を次に示します。
==> access_log <==
localhost - - [21/Nov/2010:12:23:36 -0800] "GET /home HTTP/1.1" 503 -
==> error_log <==
[Sun Nov 21 12:23:36 2010] [debug] mod_proxy_http.c(54): proxy: HTTP: canonicalising URL //localhost:8080/home
[Sun Nov 21 12:23:36 2010] [debug] proxy_util.c(1412): [client ::1] proxy: http: found worker http://localhost:8080/ for http://localhost:8080/home
[Sun Nov 21 12:23:36 2010] [debug] mod_proxy.c(819): Running scheme http handler (attempt 0)
[Sun Nov 21 12:23:36 2010] [debug] mod_proxy_http.c(1693): proxy: HTTP: serving URL http://localhost:8080/home
[Sun Nov 21 12:23:36 2010] [debug] proxy_util.c(1790): proxy: HTTP: retrying the worker for (localhost)
[Sun Nov 21 12:23:36 2010] [error] proxy: HTTP: disabled connection for (localhost)
[Sun Nov 21 12:23:36 2010] [debug] mod_proxy_http.c(54): proxy: HTTP: canonicalising URL //localhost:8080/Oops.html
[Sun Nov 21 12:23:36 2010] [debug] proxy_util.c(1412): [client ::1] proxy: http: found worker http://localhost:8080/ for http://localhost:8080/Oops.html
[Sun Nov 21 12:23:36 2010] [debug] mod_proxy.c(819): Running scheme http handler (attempt 0)
[Sun Nov 21 12:23:36 2010] [debug] mod_proxy_http.c(1693): proxy: HTTP: serving URL http://localhost:8080/Oops.html
[Sun Nov 21 12:23:36 2010] [debug] proxy_util.c(1790): proxy: HTTP: retrying the worker for (localhost)
[Sun Nov 21 12:23:36 2010] [error] proxy: HTTP: disabled connection for (localhost)
.htaccess ファイルを使用していないことに注意してください。htdocsフォルダ関連の設定に問題があるようです。以下は、htdocs forer に関係する httpd.conf ファイルの一部です。私は Apache を使用するのが初めてなので、これがどれほど関連性があるか、またはもっと投稿する必要があるかどうかはわかりません。
<Directory "/usr/local/apache2/htdocs">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
どんな助けでも大歓迎です!
編集:
Tomcat の実行中に、エラー ログに次の行が表示されます。
[Sun Nov 21 13:30:11 2010] [error] [client ::1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Sun Nov 21 13:30:11 2010] [debug] core.c(3046): [client ::1] r->uri = /Oops.html
[Sun Nov 21 13:30:11 2010] [debug] core.c(3052): [client ::1] redirected from r->uri = /Oops.html
[Sun Nov 21 13:30:11 2010] [debug] core.c(3052): [client ::1] redirected from r->uri = /Oops.html
[Sun Nov 21 13:30:11 2010] [debug] core.c(3052): [client ::1] redirected from r->uri = /Oops.html
[Sun Nov 21 13:30:11 2010] [debug] core.c(3052): [client ::1] redirected from r->uri = /Oops.html
[Sun Nov 21 13:30:11 2010] [debug] core.c(3052): [client ::1] redirected from r->uri = /Oops.html
[Sun Nov 21 13:30:11 2010] [debug] core.c(3052): [client ::1] redirected from r->uri = /Oops.html
[Sun Nov 21 13:30:11 2010] [debug] core.c(3052): [client ::1] redirected from r->uri = /Oops.html
[Sun Nov 21 13:30:11 2010] [debug] core.c(3052): [client ::1] redirected from r->uri = /Oops.html
[Sun Nov 21 13:30:11 2010] [debug] core.c(3052): [client ::1] redirected from r->uri = /Oops.html
[Sun Nov 21 13:30:11 2010] [debug] core.c(3052): [client ::1] redirected from r->uri = /
何かが正しく構成されていませんが、何をどこに持っているかわかりません。これまでの回答に感謝しますが、まだ困惑しています。