Passenger reading .htaccess from outside rails documentroot -


i have rail3 application running on apache2+phusion_passenger. working pretty smoothly till couple of days when started getting following error:

[mon may 13 11:43:16 2013] [error] [client 54.228.16.0] request exceeded limit of 10 internal redirects due probable configuration error. use 'limitinternalrecursion' increase limit if necessary. use 'loglevel debug' 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 r->uri = /blog/index.php [mon may 13 11:43:16 2013] [debug] core.c(3069): [client 54.228.16.0] redirected r->uri = /blog/index.php [mon may 13 11:43:16 2013] [debug] core.c(3069): [client 54.228.16.0] redirected r->uri = /blog/index.php [mon may 13 11:43:16 2013] [debug] core.c(3069): [client 54.228.16.0] redirected r->uri = /blog/index.php [mon may 13 11:43:16 2013] [debug] core.c(3069): [client 54.228.16.0] redirected r->uri = /blog/index.php [mon may 13 11:43:16 2013] [debug] core.c(3069): [client 54.228.16.0] redirected r->uri = /blog/index.php [mon may 13 11:43:16 2013] [debug] core.c(3069): [client 54.228.16.0] redirected r->uri = /blog/index.php [mon may 13 11:43:16 2013] [debug] core.c(3069): [client 54.228.16.0] redirected r->uri = /blog/index.php [mon may 13 11:43:16 2013] [debug] core.c(3069): [client 54.228.16.0] redirected r->uri = /blog/index.php [mon may 13 11:43:16 2013] [debug] core.c(3069): [client 54.228.16.0] redirected r->uri = /index.php 

here how apache vhost configuration looks like:

<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         options -multiviews     </directory>  </virtualhost> 

after head scratching, found there .htaccess lying inside /home/sysadmin causing problem. removed file , started working again.

now here question. why apache/passenger reading .htaccess file that's not inside documentroot. there other vhosts on system pointing diretories /home/sysadmin/specific_dir none /home/sysadmin/.

another thing don't same error on local machine if place same .htaccess file @ similar location.

first of all, post. prompted me try renaming .htaccess in home directory , problem faced resolved.

i have put rewrite condition in .htaccess file in home directory follows.

rewritecond %{http_host} !subdomain.example.com 

the issue faced explained "context" in http://httpd.apache.org/docs/2.2/mod/directive-dict.html#context


Comments

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -