The Artima Developer Community
Sponsored Link

Web Buzz Forum
Quick Guide for Passenger on Natty Narwhal

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Matthias Georgi

Posts: 54
Nickname: georgi
Registered: Apr, 2007

Matthias Georgi is a Ruby on Rails freelancer.
Quick Guide for Passenger on Natty Narwhal Posted: Jun 20, 2011 12:23 AM
Reply to this message Reply

This post originated from an RSS feed registered with Web Buzz by Matthias Georgi.
Original Post: Quick Guide for Passenger on Natty Narwhal
Feed Title: Matthias Georgi
Feed URL: http://feeds.feedburner.com/matthias-georgi?format=xml
Feed Description: Webdev, Gamedev and Interaction Design.
Latest Web Buzz Posts
Latest Web Buzz Posts by Matthias Georgi
Latest Posts From Matthias Georgi

Advertisement

This is a short guide for installing Phusion Passenger and Ruby Enterprise Editition on Ubuntu Natty Narwhal. Depending on your machine this will take 30-60 minutes on a fresh Ubuntu install.

Installing build tools and libraries

First we need to install the compiler toolchain (make, gcc and libc) and necessary libraries.

$ apt-get install build-essential zlib1g-dev libssl-dev libreadline5-dev libmysqlcient-dev

Ruby Enterprise Edition

We are going to download and compile Ruby Enterprise Edition. The installer asks for the target directory. I would recommend to install into /opt/ruby unless you want to host different versions on this machine.

$ wget http://rubyenterpriseedition.googlecode.com/files/ruby-enterprise-1.8.7-2011.03.tar.gz
$ tar xzf ruby-enterprise-1.8.7-2011.03.tar.gz
$ cd ruby-enterprise-1.8.7-2011.03
$ ./installer

Now we include the path to the ruby binaries in /etc/environment. It should look like this:

PATH="/opt/ruby/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"

After relogin you should be able to type ruby -v and get a response like this:

ruby 1.8.7 (2011-02-18 patchlevel 334) [x86_64-linux], MBARI 0x6770, Ruby Enterprise Edition 2011.03

Apache and Passenger

We need to install Apache and necessary development libraries to compile Phusion Passenger.

$ apt-get install libcurl4-openssl-dev apache2-mpm-prefork apache2-prefork-dev libapr1-dev libaprutil1-dev
$ passenger-install-apache2-module

Apache configuration

The compilation of the Passenger Apache module finished with an instruction for your httpd.conf. Depending on you passenger version, you will get something like this, which you add to your /etc/apache2/httpd.conf:

LoadModule passenger_module /opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.7/ext/apache2/mod_passenger.so
PassengerRoot /opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.7
PassengerRuby /opt/ruby/bin/ruby

Additionally you probably want to enable mod_rewrite, which is needed for Rails:

$ a2enmod rewrite
$ apache2ctl restart

If you browse to your url, you should see the standard apache “It works” page.

MySQL

The Ruby Enterprise Installer already compiled Ruby’s mysql client library, now we need the server and client.

$ apt-get install mysql-server mysql-client

Virtual host config

Adding a virtual host for your rails application is easy. Assuming that your application resides in /var/www/myapp create a file named /etc/apache2/sites-available/myapp and fill in :

<VirtualHost *:80>
    ServerName myserver.com
    DocumentRoot /var/www/myapp/public
</VirtualHost>

Now we disable the default site and add our new virtual host:

$ a2dissite default
$ a2ensite myapp

After restarting Apache your Rails application should run on Apache:

$ /etc/init.d/apache2 restart

Read: Quick Guide for Passenger on Natty Narwhal

Topic: LG Optimus Slider With Verizon Bands Hits FCC Previous Topic   Next Topic Topic: Is Verizon Prepping A Mysterious Honeycomb Tablet; Motorola Xoom 2 Or HTC Puccini?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use