Friday, November 21, 2008

Tutorial on hosting RoR app on Amazon AWS with EC2, EBS, Ruby Enterprise Edition (REE) and Phusion Passenger (mod_rails)

Background:
We built a tourism portal in RoR for one of our clients. You have a look at it - - www.tripladder.com
After building it, we were requested to host and manage it for them. Initially we went with knownhost which is OK but a production RoR application needs more RAM than what we get on most VPS plans - especially if we have image processing. We did consider AWS but at that time it did not have EBS and the client did not initially expect enough traffic to justify a 'scalr' managed cluster. We were looking for a replacement to a dedicated server. Once EBS was launched, we immediately decided to move the site to AWS. The Cost-benefit analysis is compelling.

The following tutorial starts off after signing up with AWS and configuring your desktop/laptop to be able to connect to AWS and launch instances i.e. we assume that you have completed the 'Getting Started' section of AWS.

We have started with the stock Fedora image and modified it to our requirements. We could have used CentOS but Fedora-8 appeared at the top of the list and we went ahead with it.

The application hosting has the following steps.
  1. Launching an instance.
  2. Installing RoR, gems, plugins...We used rmagick, hence we had to install Imagemagick too.
  3. Installing REE and Phusion (mod_rails)
  4. Installing mysql.
  5. Intalling the application (checkout from subversion).
  6. Creating and attaching a EBS volume. Mysql with data on EBS
  7. Modifying the RoR app to save user upload files to EBS.(http://docs.google.com/Doc?id=dcn2ckbh_20hk4kc4d4)
  8. Installing and configuring a production level ferret server
  9. Configuring Apache to serve the application, caching optimisations for performance.
  10. Configuring permanent public IP (covered) and DNS (we have the domain parked with go daddy but this is not covered in this article)
  11. Configuring smtp (email) support for RoR application.
  12. Once we have the perfect server setup, save it to S3.
  13. Periodic automated backups - Using Amazon snapshots.

The full tutorial is available here:

http://docs.google.com/Doc?id=dcn2ckbh_21gznbbjhr

8 comments:

pbsl said...

you have a nice site. thanks for sharing this enormous resources. keep it up. anyway, various kinds of ebooks are available here

http://feboook.blogspot.com

Giraj sharma said...

nice your blog and very nice dear your blog psoting we like its you can see our also website for online shopping

batterie ordinateur portable batterie-ordinateur-portable.org - AGO Technologie est speialis dans la vente ordinateur portable, Ordinateur, piles et le Chargeur. Nous offre Batterie Ordinateur Portable, Batterie Ordinateur Portable Sony, Batterie Ordinateur Portable Dell, Chargeur Ordinateur Portable Sony, Chargeur Ordinateur Portable Hp et Chargeur Ordinateur Portable IBM.

AMAN SEO EXPERT said...

DreamBox
http://www.dreambox500c.org.uk
We supply digital satellite receiver DreamBox 500c, DreamBox 500s, DreamBox 7020S,Dreambox DM 600 PNR, DreamBox 7025, DreamBox Remote Controls, Relook 200S and so on.DreamBox 500C, DreamBox 500S, DM 7020S, Dreambox DM 600 PNR

DreamBoxWe supply digital satellite receiver DreamBox 500c, DreamBox 500s, DreamBox 7020S,Dreambox DM 600 PNR, DreamBox 7025, DreamBox Remote Controls, Relook 200S and so on.DreamBox 500C, DreamBox 500S, DM 7020S, Dreambox DM 600 PNR

Aman Seo said...

Hi,


nice your blog and very nice dear your blog Ranking is too Good we like its you

can see our also website for online shopping......

Two way radiosRadio by BAND Radio accessory Radio item for Radio cable Radio Antenna laptop Skin laptop accessories Product requirements laptop battery laptop keyboard Two Way Radio Radio Brand Radio buy from radio-factory.com

host said...

Thanks for sharing this post with us. It's really an amazing post. Keep posting the good work in future too. web hosting service india

sowmya said...

As when i made a look into this post, I found this blog quite informative..
Funny blog site

mytruehost said...

Your business wants high uptime, Your enterprise prerequisites need you to have some customization capabilities, Your business is limited to no in-house IT skills or expertise, You do not want the trouble of handing servers, databases or backups. To get rid of all try $1 Web Hosting

Josi Bunder said...

Best web hosting companies. Reviews, rates, statistics of top hosting companies.
Find best hosting company at www.HostingCompaniesz.com