Having completed our little multi-server application and deployed the pieces on various PaaS platforms (OpenShift, CloudFoundry and Heroku) we decided it would be educational and character-building to try to deploy some of these pieces onto virtual machines on Amazon's EC2 cloud. We figured that by doing it directly ourselves, we would gain a greater appreciation of the value the PaaS platforms like OpenShift are bringing us. We probably spent over a week doing this, and I won't deny that it was sometimes incredibly frustrating. Nevertheless, I think it was a very useful thing to do and it led me to a surprising conclusion. There were some days of pure frustration during this effort where nothing I tried worked, and every attempt I made to get around a problem led to a new problem. Here are some examples. I never did manage to install rails successfully on one of Amazon's own base AMIs. I cannot remember now what the problems were I ran into, but with my very limited unix skills it was tough and I gave up. I found a site with clear instructions on how to do this for an ubuntu release that seemed to closely match one that I found on an Amazon AMI. [There are plenty of Amazon AMIs available that already have the full Rails stack on them, and if I had picked one of those, I would probably have had a much easier time, but that would have been cheating - I wanted to learn what it takes to build up "from scratch".] Even following these instructions proved painful, because they did not entirely work. I'm not sure if that is because of subtle differences between my starting image and theirs, or because the instructions were wrong, or perhaps because the instruction glossed over details that someone more experienced than me might have been able to overcome quickly. Nevertheless after a day or two of struggling I was able to build a Rails stack on top of a base Ubuntu AMI, and then build a script that would reproduce the result whenever I wanted. One thing I learned is that this is not a very quick process - it takes an hour or two for the full script to run, so you wouldn't want to build from scratch every time you wanted to launch an instance - you would have to freeze your instance as a new AMI, or pick one that someone else had built. The software I ended up installing included RVM (manages Ruby installs), Ruby 1.9.3 (The base image had an old Ruby level on it), NGinx (an alternative to Apache), Passenger (links NGinx to Ruby), Git, and a few smaller things that were necessary for one reason or another. I also had to download my code, configure the we server and start it.
Sadly, it turned out that this was the beginning of my troubles not the end. More on that later as well as my surprising conclusion