Nicolas Alpi

Hi, Salut

Pragmatic web application developer, I enjoy my freelance way of life in my home office every day. I mainly use Ruby based frameworks (Rails / Sinatra / Rack) as my main development arsenal and jQuery is my day to day friend for every piece of client side. Aside from development freedom, I really enjoy the business side of behind freelance, and will soon to release my own personal application. In my free time, I enjoy cooking, runnning and sharing a coffee or a beer with people, so if you're around Bristol, let's be in touch.


how to install Passenger for Ruby on Rails on an Apache2 / Linux box

I was preparing the future of this blog, and for that I need to have a sandbox ready for the development and the production.

I decided to give a test to Passenger (aka modRails) for the apache2 Ruby on Rails integration. It’s amazing how simple it is to have a Rails application working now …

What’s Passenger ?

Passenger is a server side module, which enables to have a rails application working without any configuration. People use to say that, with Passenger, you’ll be able to deploy Rails application like PHP application.

Also, and because it made the creation of virtual host very easy, Passenger is looking as the solution for more Rails shared host providers.**

How to install Passenger (on an Ubuntu Server Box) :**

I assume that you have your Rails and Apache2 installed.

First we need to install the apache2-dev libs

Then we are going to install the gem for passenger and passenger apache himself.

For me the version of passenger was 2.0.3, I just follow what the installer said :

copy in /etc/apache2/apache2.conf

__LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.0.3/ext/apache2/mod_passenger.so PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.0.3 PassengerRuby /usr/bin/ruby1.8

__Be sure that the rewrite mode is enabled :

Create a vhost file in /etc/apaches/sites-available/myRailsApp.com

and put inside something like

ServerName myRailsApp.com DocumentRoot /path/to/myRailsApp/public/

And restart now apache (sudo /etc/init.d/apache2 restart), and you should have a passenger box working.

**And now ?

**Now you just have to upload the new files to have your application working with Passenger.

I’ll use it for my sandbox, and have some test on the performance before using it on my future web application.

The next step will be to have capistrano 2 working with this configuration. It should be easy, we’ll see that this week ;)


Comments

blog comments powered by Disqus