Adam Perfect

General

Passenger / mod_rails and symlinks

Setting up a Rails app (the rather spiffy Retrospectiva) to run using Phusion Passenger today, I came across a fun problem where the app kept throwing 500 errors. The Rails production.log was empty but in Apache's error_log I found this error:

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.

It turns out that Passenger doesn't deal well with the DocumentRoot being a symbolic link, which is exactly what I had set up. Luckily that makes the solution nice and easy: just point the DocumentRoot at the Rails app's public folder, something like:

DocumentRoot    /home/user/webappname/public

... and you should be good to go after restarting Apache.

Written by Adam on

Adam is a Director of User Experience by day and photographer as time allows.

You may also like…