2

apache2+phusion_passenger で rail3 アプリケーションを実行しています。数日前に突然次のエラーが発生し始めるまで、すべてがほぼスムーズに機能していました。

[Mon May 13 11:43:16 2013] [error] [client 54.228.16.0] 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.
[Mon May 13 11:43:16 2013] [debug] core.c(3063): [client 54.228.16.0] r->uri = /blog/index.php
[Mon May 13 11:43:16 2013] [debug] core.c(3069): [client 54.228.16.0] redirected from r->uri = /blog/index.php
[Mon May 13 11:43:16 2013] [debug] core.c(3069): [client 54.228.16.0] redirected from r->uri = /blog/index.php
[Mon May 13 11:43:16 2013] [debug] core.c(3069): [client 54.228.16.0] redirected from r->uri = /blog/index.php
[Mon May 13 11:43:16 2013] [debug] core.c(3069): [client 54.228.16.0] redirected from r->uri = /blog/index.php
[Mon May 13 11:43:16 2013] [debug] core.c(3069): [client 54.228.16.0] redirected from r->uri = /blog/index.php
[Mon May 13 11:43:16 2013] [debug] core.c(3069): [client 54.228.16.0] redirected from r->uri = /blog/index.php
[Mon May 13 11:43:16 2013] [debug] core.c(3069): [client 54.228.16.0] redirected from r->uri = /blog/index.php
[Mon May 13 11:43:16 2013] [debug] core.c(3069): [client 54.228.16.0] redirected from r->uri = /blog/index.php
[Mon May 13 11:43:16 2013] [debug] core.c(3069): [client 54.228.16.0] redirected from r->uri = /blog/index.php
[Mon May 13 11:43:16 2013] [debug] core.c(3069): [client 54.228.16.0] redirected from r->uri = /index.php

私のApache vhost構成は次のようになります。

<VirtualHost *:80>
    ServerAdmin "webmaster@xyz.com"
    ServerName analytics.xyz.com
    ServerAlias www.analytics.xyz.com
    MIMEMagicFile /dev/null
    CustomLog logs/analytics_access.log  "%t %>s %b %D %h \"%r\" %u \"%{Referer}i\" \"%{User-Agent}i\""
    ErrorLog logs/analytics_error.log
    LogLevel debug

    DocumentRoot "/home/sysadmin/analytics/public"
    <Directory "/home/sysadmin/analytics/public">
        AllowOverride All
        Options -MultiViews
    </Directory>

</VirtualHost>

頭をひっかいた後、この問題を引き起こして.htaccessいる内部に横たわっていることがわかりました. /home/sysadminこのファイルを削除すると、すべてが再び機能し始めました。

ここに私の質問があります。ドキュメントルート内にない .htaccess ファイルを apache/passenger が読み取るのはなぜですか。システムには他の仮想ホストがあり、すべてディレクトリ /home/sysadmin/specific_dir を指していますが、/home/sysadmin/ を指している仮想ホストはありません。

もう 1 つの問題は、同じ .htaccess ファイルを同様の場所に配置しても、ローカル マシンで同じエラーが発生しないことです。

4

1 に答える 1

1

初めまして、投稿ありがとうございます。これにより、ホームディレクトリの .htaccess の名前を変更するように促され、直面した問題は解決されました。

ホームディレクトリの .htaccess ファイルに以下のように書き換え条件を入れました。

RewriteCond %{HTTP_HOST} !subdomain.example.com

あなたが直面した問題は、 http://httpd.apache.org/docs/2.2/mod/directive-dict.html#Contextのように「コンテキスト」で説明できます

于 2013-08-02T23:15:51.527 に答える