EC2OnRails setup

There are two machines:

Controller: Where you are running the capistrano commands

Server: The EC2 instance where the app will be running (potentially multiple)

  1. Controller: sudo gem install ec2onrails
  2. Controller: suso gem install capistrano
  3. Controller:   svn checkout https://rsportzcvs.svn.cvsdude.com/Swooshdot/trunk
  4. Start Server instance(s) using ec2onrails AMI
  5. Controller: Edit config/deploy.rb
    1. Set scm_username/password
    2. set role :web,app,db,memcache to Server(s) public DNS name
    3. point ssh_options[:keys] to your ssh private key
  6. Controller: cap ec2onrails:get_public_key_from_server
    • If this doesn’t work, you probably don’t have the right private key
  7. Controller: cap ec2onrails:setup
  8. Controller: cap ec2onrails:db:set_root_password
  9. Controller: cap deploy:cold
  10. Existing production: cd /mnt/app/shared  rsync  -azv avatars  index files  logos  photos widgets pictures root@newinstance:/mnt/app/shared

 Note you only need to do steps 1, 2 and 6 once on your staging server (if all your instances share the same key), then repeat the following for each new instance

For a simple server test, do the following:

$ RAILS_ENV=development ruby script/server webrick