Mar 16, 2012

Ruby on Rails/Passenger with Apache2 – setting up sub domains


I’m trying to configure Apache2 and mod_passenger so I can have one site at the root of the server and another totally different rails instance at

My <VirtualHost> context looks like this so far:

<VirtualHost *:80>
    # Name
    DocumentRoot /var/rails/current/public
    <Directory /var/rails/current/public>
            AllowOverride all
            Options -MultiViews
    </Directory>    # Logfile
    ErrorLog /var/log/apache2/
    CustomLog /var/log/apache2/ combined</VirtualHost>

If anyone has any ideas on how I can achieve this, or even a totally different approach to do it, would be appreciated.

Asked by Fergus Barker


If you check the mod_passenger documentation you’ll find the very answer to your question. From what your snippet shows you lack a couple of important directives to even get mod_passenger involved with your page at all. Check this section of the documentation to get a very exhausting overview on how to configure passenger to work.

When you got that and it happens that you can work with subdomains instead, I’d recommend to use two <VirtualHost> instances. Not sure if you can assign two or morePassengerAppRoot directives per context.

Answered by Chris

Related posts:

  1. Host Ruby on Rails Tracks on Apache2
  2. How Do You Set Up SSL on Ubuntu with Apache2 and Ruby on Rails?
  3. Nginx 404 Deploying Ruby on Rails Application with Phusion Passenger
  4. Running Ruby on Rails App on Apache + Passenger == to much memory
  5. Apache alias to Ruby on Rails application

Leave a comment