Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to host multiple Rails apps on a multiple server using sub-directories. And have encountered some relative path problems.

I have made a symbolic link to the app's public directory and placed it in the /var/www/html directory,

            /test_app (symbolic link to the public folder of test_app) 

and set apache as so

   LoadModule passenger_module /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.12/ext/apache2/
   PassengerRoot /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.12
   PassengerRuby /usr/local/bin/ruby

   <VirtualHost *:80>
      DocumentRoot /var/www/html

      Options Indexes FollowSymLinks -MultiViews

      RailsBaseURI /test_app


The links in the app itself works just fine, all the links acknowledge the test_app/ directory and work, however, when it comes to showing images in the public directory in the view, the relative path goes wrong.

Say I have


it goes looking for it in


rather than


As far as I understand this is an Apache setting problem than something to be done in Rails, if its possible I would prefer to have it contained in the conf file of apache rather than having to alter the code.

share|improve this question

You want RackBaseURI rather than RailsBaseURI for >=3.0

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.