Installing a Rails Stack on Ubuntu 7.10 (Gutsy Gibbon)

I setup a virtual server for a client to host a Rails application on an Ubuntu 7.10 system. Here I have documented the steps to install all the necessary pieces of software. This is a MySQL5.0/Rails2.0/Mongrel1.1/Apache2.2 setup with Subversion for source code management. I realize that Apache is not the most popular frontend but for this client security and maturity are important. I also realize that their are alternatives to Mongrel, MySQL, and Subversion as well that are well worth considering. So rather than this being THE Rails stack I think of it as A Rails stack suited for a particular customer.

This was on a fresh installation of Ubuntu created by debootstrap. I was logged in as root so for those looking to copy these steps who are not a root user you’ll need to add sudo before most of these commands. The first thing I needed to do was performance any package upgrades available.

  • aptitude update
  • aptitude upgrade

I decided to install the stack from back to front beginning with the database, which was to be MySQL.

  • aptitude install mysql-server
    • During the install I was prompted for a root password which is advisable to set.
    • I encountered another error in which the mysql-server failed to start. This was due to this being a virtual server where the loopback interface had not yet been brought up. A quick ifup lo fixed the problem.

I then wanted to install ruby and rails. I began with the ruby packages I wanted to use.

  • aptitude install ruby rubygems irb rdoc ruby1.8-dev

I also needed to install some other packages which would be needed for the gems I will install.

  • aptitude install make gcc libc6-dev

Then I used the gem command (from the rubygems package) to get the gems I wanted. It’s important to note that these packages could also be install via the Ubuntu package system. However, I find that these packages, as quick-moving as they are, work better as gems. If they were regularly backported I might change my mind and avoid the use of the rubygems package on the server altogether.

  • gem install mongrel_cluster -y
    • When prompted for a version of mongrel I selected mongrel 1.1.4 (ruby).
    • When prompted for a version of fastthread I selected fastthread 1.0.1 (ruby)
  • gem install rails -y
    • In the past I often froze rails to the application but these days I find that having the rails libraries on the system saves a lot of time checking out an app from its repository.

Though the Rails world is excited about git I’m still using subversion to manage my code and so it’s necessary to have it installed (other may use cvs, git, bzr, or hg).

  • aptitude install subversion

Finally, for the front-end webserver I have been using nginx a lot but for this project I recommended apache 2.2 for its maturity. It helps that most people have heard of apache and that it is a robust and mature application. However, nginx may be a preferable alternative for many users.

  • aptitude install apache2

Trackback URL for this post:

http://hightechsorcery.com/trackback/98
Creative Commons License Except where otherwise noted, content on this site is licensed under a Creative Commons by-nc-sa 3.0 License