ec2onrails

What I did to deploy phonehow to my own EC2 instance:

Got setup for EC2 (see proir post).

Installed ec2onrails gem. This has a hard dependency on version 2.4.3 of capistrano. I had to install that version, then uninstall a newer version after ec2onrails complained that the newer version was “activated”.

sudo gem install --version 2.4.3 capistrano
# sudo gem uninstall capistrano # if you have any newer versions.
sudo gem install ec2onrails

Found out the AMIs of the ec2onrails instances:

cap ec2onrails:ami_ids

32-bit server image for EC2 on Rails 0.9.9: ami-c9bc58a0
64-bit server image for EC2 on Rails 0.9.9: ami-cbbc58a2
Created a keypair that I would use to login to the instance:
ec2-add-keypair samphonehow
Saved the private key to ~/.ec2/id_rsa-samphonehow and chmod it 600.
 
Created the instance:
I tried to create a 64-bit instance but it complained: Client.InvalidParameterValue: The requested instance type’s architecture (i386) does not match the architecture in the manifest for ami-cbbc58a2 (x86_64).  I don’t see an option to ec2-run-instances to specify an instance architecture, so I just created an x86 instance for now:
cd .ec2
c2-run-instances ami-cbbc58a2 -k samphonehow

Checked I could login to the instance.

Configured capistrano: Edited deploy.rb and inserted my instance-id, url, scm_username, scm_password, keypair, account_id, access_key_id, secret_access_key (from AWS acct identifers page), pk, cert, ssh_options and buckets.

Did the key workaround:
ap ec2onrails:get_public_key_from_server
  * executing `ec2onrails:get_public_key_from_server'
      Your first key in ssh_options[:keys] is /Users/sam/.ec2/id_rsa-samphonehow, presumably that's 
      your EC2 private key. The public key will be copied from the server
      named 'ec2-75-101-197-239.compute-1.amazonaws.com' and saved locally as /Users/sam/.ec2/id_rsa-samphonehow.pub. Continue? [y/n]

Setup the instance, deployed the app:

cap ec2onrails:setup
cap deploy:cold
 
...lots of output...

And that’s it.  The app was up and running.

You must be logged in to post a comment.