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.
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.
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:
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:
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 :