Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've got Apache (-v):

Server version: Apache/2.0.63
Server built:   Nov 29 2009 15:23:34
Cpanel::Easy::Apache v3.2.0 rev4899

I want to start new Sinatra application on passenger. I've just installed passenger gem. So now I need to set up apache configuration.

In httpd.conf there are many settings of others applications on server. So I just can't reinstall apache with passenger-install-apache2-module. I need to set up exist Apache with passenger. What have I do now?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Step one: run passenger-install-apache2-module as root. This will install the passenger module, which is required.

Step two: The passenger-install-apache2-module script will tell you what to add to httpd.conf. Add it. It should not affect any other applications you are running.

Step three: For each Ruby on Rails or Sinatra app, configure it in Apache. I do this for Sinatra apps:

<VirtualHost *:80>
  ServerName hman.flame.org
  DocumentRoot /www/hman/current/public
  ExpiresDefault "access plus 10 years"
</VirtualHost>

I then have config.ru in /www/hman/current which is detected by Passenger automatically.

For Rails apps:

<VirtualHost *:80>
  ServerName art.waywardgypsy.com
  DocumentRoot /www/waywardgypsy-art/current/public
  ExpiresDefault "access plus 10 years"
</VirtualHost>

I then use Capistrano to deploy the Rails application to /www/waywardgypsy-art.

In both cases, the .../current/public directory has files which are static in nature such as images, CSS, etc. These are served directly from Apache. Passenger looks into the virtual host's config and checks for Sinatra or Rails, and if it finds the appropriate config file, it will treat it as the appropriate application framework.

Passenger will not affect virtual hosts which do not have a Sinatra config file (config.ru) or Rails (config/boot.rb).

share|improve this answer

Your Answer

 
discard

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.