Peter Marklund

Peter Marklund's Home

Tue August 12, 2008
Programming

Installing Ruby on Rails on Ubuntu 8.04 Hardy Heron

I've compiled a set of detailed instructions on how to install Ruby on Rails on Ubuntu 8.04 Hardy Heron. The instructions are available in GitHub and they show you how to turn a clean Ubuntu 8.04 install into a production ready Ruby on Rails stack including MySQL, Nginx with fair proxy balancer, Monit, and Mongrel Cluster. There are a few additions and improvements I'd like to make:

Please help me point what else is missing or how I can improve.

I'm talking to GleSYS about the possibility of offering my production setup as an installable VPS image.

Comments

Robert said over 6 years ago:

What about Passenger/mod_rails? Since it is now available as an Ubuntu package it is more or less trivial to set up, but I think it should be in there!

--------------------------------------------------------------------------------

Peter Marklund said over 6 years ago:

Robert,
I think mod_rails is a great and very promising product, but last time I tried it it had memory leak issues. This may very well be fixed now, but I think the Nginx setup is arguable more proven, i.e. has been around longer. I am quite happy with my Nginx setup so don't think I'll be changing to mod_rails anytime soon. Or are there compelling reasons to switch that I have overlooked?

--------------------------------------------------------------------------------

David Backeus said over 6 years ago:

Nice instructions. You could add a comment on the postfix install that it should use the default "web server configuration" when installing.

Also if you're doing an image for glesys maybe a version of the stack with a slimmed down mysql or postgres config could be useful for running it on slices with only 256MB ram.

Another thing is that de packaged monit is not the latest version and has some drawbacks such as not being able to send mail through smtp and the admin http server not being configurable to be accessed with basic auth as said in the documentation so I usually build that from source. You would have to add a startup script for it manually though.

--------------------------------------------------------------------------------

David Backeus said over 6 years ago:

Just noticed that you're using wget without installing the package first.

Maybe the default Hardy install on glesys has it preinstalled but it would be a good idea to install some essential packages to start with just in case. I would add curl to that list as well.

--------------------------------------------------------------------------------

David said over 6 years ago:

How much RAM do you have on your Glesys VPS for this?

--------------------------------------------------------------------------------

Peter Marklund said over 6 years ago:

David,
I am using a GleSYS Gold VPS with 1GB of ram, however, my memory consumption is at 338 MB currently.

Peter

--------------------------------------------------------------------------------

Adam said over 6 years ago:

You might be interested in Sprinkle, a ruby dsl for system provisioning. It has a great DSL and allows a deployment in a few different ways including with capistrano.

http://github.com/crafterm/sprinkle

It would allows you to express these instructions in a very readable script, and then do the deployment for you with pre and post hooks for each 'package'.

Adam.

--------------------------------------------------------------------------------

Kathleen said over 6 years ago:

Is there a way to get your installation instructions without using Github?
Thank you,
Kathleen
KathysKode@gmail.com

--------------------------------------------------------------------------------

kind said over 6 years ago:

asdsadwD

--------------------------------------------------------------------------------

samotage said over 5 years ago:

Hey Peter,

Thanks for the nice AND workable answer to getting fair to work inside Nginx.

Rock on mate!
Sam

--------------------------------------------------------------------------------

stefanioachim@gmail.com said over 5 years ago:

In nginx/conf/vhosts/my_app.conf the following line :

# Directly serve static content
location ~ ^/(images|...

will cause problems if you have a controller named "images" because it will try to find "/public/images/someaction" instead of the rails route to "/images/someaction" and you'll get a "Not found" page.

--------------------------------------------------------------------------------

free games said over 5 years ago:

Thanks for instructions on how to install Ruby on Rails on Ubuntu 8.04... For me very useful post

--------------------------------------------------------------------------------