Installing Ruby on Rails via Passenger on Ubuntu 8.04
Posted: February 19th, 2009 | Author: James | Filed under: Web Development | Tags: apache2, mod_rails, passenger, rails, ruby, ubuntu | 1 Comment »As part of my postings which focus on ‘Things I’ve Had to Do Recently So Am Writing Them Down So I Don’t Forget’ i’m writing up what I had to do to get Ruby on Rails up and running on my Ubuntu 8.04 development machine. As before, I’d expect this to run fine on the latest Ubuntu release (8.10 at time of writing).
Installing Apache
Apache installation is nice and easy under Ubuntu and I’m really only including the instructions for the sake of completeness.
sudo apt-get install apache2
Installing Ruby
Again installing Ruby itself is one of the simple things to get done.
sudo apt-get install ruby-full build-essential
Installing Rails
The best way to install Rails is via Ruby Gems, this allows Gems to be in control of updating Rails (and other Ruby related downloads) and prevents Apt from conflicting with your Gems package.
The latest version of Gems is 1.3.1 which can be installed with the following set of commands.
wget http://rubyforge.org/frs/download.php/45905/rubygems-1.3.1.tgz tar xzvf rubygems-1.3.1.tgz cd rubygems-1.3.1 sudo ruby setup.rb sudo ln -s /usr/bin/gem1.8 /usr/bin/gem sudo gem update --system
With Gems now installed its safe to install Rails.
sudo gem install rails
Installing Passenger
Now that Ruby, Rails and Apache are installed the final step is the installation of Phusion Passenger (or mod_rails as it’s also sometimes referred to). Passenger can be installed through ruby gems which makes it easier to stay up to date with the latest release.
sudo gem install passenger sudo passenger-install-apache2-module
Then add the following lines to your httpd.conf
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.0.6/ext/apache2/mod_passenger.so PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.0.6 PassengerRuby /usr/bin/ruby1.8
You should now be able to set up a rails app and get it running by pointing an Apache VHost at the directory.
I’d also recommend setting Rails to development mode by adding
RailsEnv development
to your vhost’s config so you can see any errors generated by Rails in the case that something has gone wrong.
Zi6 HD Camera
Posted: February 19th, 2009 | Author: James | Filed under: My Life | Tags: hd camera, kodak zi6 | 2 Comments »
@pocopina Working on @muxster from James Constable on Vimeo.
Got myself a Kodak Zi6 recently to play with. Taking it on holiday to Italy next week on my snowboarding trip so will write up my thoughts once i’ve put it through it’s paces.
links for 2009-02-16
Posted: February 17th, 2009 | Author: James | Filed under: Uncategorized | No Comments »-
Interesting interface for reading articles from the New York Times.
Night Time in Oslo
Posted: February 15th, 2009 | Author: James | Filed under: Uncategorized | 1 Comment »The view from our hotel room on our New Years trip to Oslo.
links for 2009-02-09
Posted: February 10th, 2009 | Author: James | Filed under: Uncategorized | No Comments »-
Details of 2 of the open source software projects I am involved in
STVJobs.com Haka Dance in Queen Street Station
Posted: February 9th, 2009 | Author: James | Filed under: Work | Tags: dance, haka, marketing, stvjobs, video | 2 Comments »The actors from the STVJobs.com commercial performed their ‘Haka’ jobs dance today in Queen Street Station at noon. They also did it in Edinburgh in the morning and Aberdeen in the afternoon.
[Update] Check the comments for the dance from another angle.
links for 2009-02-08
Posted: February 9th, 2009 | Author: James | Filed under: Uncategorized | No Comments »Facebook to Kill Twitter? Don’t think so.
Posted: February 7th, 2009 | Author: James | Filed under: The Outside World | Tags: facebook, social networking, twitter | No Comments »Just finished reading an article over on AllFacebook about how the author thinks that Facebook is about to kill Twitter due to the fact the API has been expanded to make it easier to set a users status from an Application. There’s a big difference between Twitter and Facebook in the way that people use them that the author seems to fail to grasp. Facebook is a closed circle app where in order to see a persons updates you need to be there friend. You’re forced into two way communication. With Twitter I can follow people who are of interest to me and others can follow me if I’m tweeting stuff of interest to them. We don’t have to be friends. We don’t have to be bombarded by each others content if we don’t want to. Twitter facilitates one way communication in a way that Facebook doesn’t and probably never will.
And if Facebook thought they were about to kill off would they have offered $500m for it?
The Cost of Hosting Websites on Amazon EC2
Posted: February 7th, 2009 | Author: James | Filed under: Web Development, Work | Tags: amazon ec2, aws, cloud computing, fasthosts, hosting, servers, virtualisation | 3 Comments »As mentioned previously once of the last few things I did in my previous position at ocean70 was to migrate their existing dedicated server over from a 2 year old Fasthosts dedicated box to an Amazon EC2 instance. That was a little over a month ago now so I thought it would be interesting to take a look at the cost for the set up in comparison to the dedicated box used previously.
To put things in perspective the box we were replacing was a 2 and a half year old Fasthosts DS 400 running Fedora 6 clocking in at £69 + vat a month (£81 in total). In the box was a 2.8ghz Pentium 4, 1gb of Ram and a 120gb IDE hard drive. At the time this was enough for our needs – but despite regular backups and an in-house server available for failover there was always the chance that this would go down and we would be in a right mess. Luckily that hadn’t happened and time was right to move our hosting to EC2.
One month has passed on EC2 and i wanted to take a look at how much the server has cost to run for a month. Total charges clocked in at $125.46 (including taxes) which at todays exchange rate equates to £84.77. Not too shabby for a vastly improved infrastructure.
To actually have the AMI running 24/7 for a month (and remember, January is a long month) clocked in at $81.84 (£55.30) while the transfer in of 23gb cost $2.30 (£1.55) and our outgoing transfer of 25gb cost $4.27 (£2.88). To put the bandwidth costs into perspective the instance is home to about 8 or so websites receiving fairly low traffic (max 100 uniques a day each). The only other significant cost being the 120gb EBS block which cost $15.00 (£10.13) for the month.
So thats a £5 a month increase for a system whose hardware will never date. Can be brought back up in 5 minutes should anything go wrong. Has virtually limitless storage facility, and on top of that is a hell of a lot faster than its predecessor. Bargain. Will be interested to see how it averages out over the year, especially as a few more sites are put on it.
