Phusion Passenger with a prefix

The Mongrel Web server can run with a URL prefix, using the –prefix
option.
This is useful for running an app in a “subdirectory”—say BankDirectr at
http://banks.info/directr and BankRobbr at http://banks.info/robbr .

In development you want that same prefix; this way your stylesheets, images, and
other static assets show correctly at the right URL. For this we had originally modified script/server to
always pass –prefix to Mongrel.

Phusion Passenger conflicts with mod_rewrite and mod_alias. Those modules
may be installed and loaded together with mod_passenger, and they will work
fine outside virtual hosts that contain a Rails application, but we recommend
you not to use their features inside virtual hosts that contain a Rails
application.

Fine. It works just fine for me using mod_alias, but that’s only in my
development environment and not in production. Here’s another solution:

cd /var/www/robbr/public
ln -s . robbr

Now any asset that references /robbr , such as /robbr/stylesheets/layout.css
, will follow the symlink to public .

Mike Burns

Sharpen your programming skills by completing coding exercises
that are reviewed by other developers at
Upcase
today.