Setting up new Ubuntu 14.04 server with Nginx, Passenger, Postgresql, RVM, Ruby, Rails
Step 0: Setting up the new EC2 instance
NOTE: We can now use an AMI for this. Once you enter the launch wizard make sure that "My AMIs" and "Shared with me" is selected and then search for the term "Rotati". Select the Rotati Staging AMI and continue with the wizard. This AMI will have everything you need to run the staging application (so no need to run though the process below if everything is working on the AMI already!)
- Launch the AWS instance in Singapore region (unless the client specially stated to launch in a different region). For Staging use t2.micro. For Production use t2.micro (and higher).
- Configure the settings as per the wizard. Ensure to enable termination protection. Most other settings can remain unchanged.
- Create a new security group for the server giving it a meaningful name (e.g. the name of the project). Open only the ports that are required which are generally HTTP, HTTPS and SSH.