08 October 2006

Installing Rails, Apache 2.2, and Mongrel on Ubuntu Dapper 64-bit

I am setting up a system at SliceHost, on one of their Ubuntu Dapper slices. First, I'm not as familiar with Ubuntu as I am Fedora, but this is one reason I chose Ubuntu (to get more experience). Anyway, I found several other blog posts and such on the web about this, but none worked perfectly. I glommed mine together by using them though. Here they are:

And, here's what I did. First, uncomment the universe lines in /etc/apt/sources.list. Then...

# apt-get update# apt-get dist-upgrade
# apt-get install ruby ruby1.8-dev ri rdoc
# ln -s /usr/bin/irb1.8 /usr/local/bin/irb# wget http://rubyforge.org/frs/download.php/11289/rubygems-0.9.0.tgz
# tar xvzf rubygems-0.9.0.tgz
# cd rubygems-0.9.0
# ruby setup.rb
# cd ..
# rm -rf rubygems*
# gem install rails --include-dependencies
# dpkg --purge apache apache2 (this removes Apache if it exists, which it didn't)
# apt-get install build-essential zlib1g-dev
# wget http://apache.rmplc.co.uk/httpd/httpd-2.2.2.tar.gz
# tar xzvf httpd-2.2.2.tar.gz
# cd httpd-2.2.2
# ./configure --prefix=/usr/local/apache2 --enable-mods-shared=all --enable-deflate --enable-proxy --enable-proxy-balancer --enable-proxy-http
# make
# make install
# cd ..
# rm -rf httpd*
# apt-get install postfix (Then, use the "Internet Site" default setting, and picked "WeighPals.com" as the name)
# apt-get install mysql-server mysql-common mysql-client libmysqlclient15-dev libmysqlclient15off
# apt-get install libmysql-ruby1.8
# gem install daemons gem_plugin mongrel mongrel_cluster --include-dependencies

technorati tags:, , ,


Marston said...

Thanks for the writeup. I'll be getting a VPS over at slicehost soon with Ubuntu too and have a few questions:

1.) Which slice do you have? 256? 512?

2.) With everything setup and running, what is the resource usage like for everything together idle and (if you've done it) under load?

I had first intended to use the exact same setup, but I'm recently swayed much in favor of using Nginx instead of apache. I've heard how little RAM it uses (I've heard some say like 5MB under heavy load), especially under load.


gtcaz said...

Hi. I had to do this before installing the mongrel gem:

sudo apt-get install ruby1.8-dev

Otherwise I got the error:
extconf.rb:1:in `require': no such file to load -- mkmf (LoadError)
from extconf.rb:1

Rami B. said...

Thanks for the info. The current version of apache is now 2.2.4

TR1 said...

The source for apache2 has been changed.
That step should read:
wget http://apache.rmplc.co.uk/httpd/httpd-2.2.4.tar.gz

*notice that the version has been updated