ec2 - Amazon Elastic Compute Cloud tips and howtos

Amazon ec2 Introduction & Beginners Guide

This page is part of larger set of tips & howtos on ec2 by flurdy.

Benefits of ec2

Why use ec2? It does not fit everyones requirements. It does fit people whom require Software-as-a-Service or people whom require hosting of servers (me). I think of it as hosting in the cloud, and the end results are often SaaS.

ec2 as colocation hosting is not the cheapest. However it is quite resonable and was cheaper than my previous hosting service provider. It is however exceptionally flexible with its ability to launch instances as required and you pay only for that use. It is quite fun launching 10s if not 100s of servers to test out some load balancing etc. You can do that immidietly at any time and use it for whatever you need. Then you shut them down, knowing you have not committed to pay for those servers the rest of the month or similar which a normal provider would insist. Or worse having bought all that the hardware yourself.

In the end it fits my needs very much, and I hope yours too.

Drawbacks

Some of the drawbacks are:

The risks mentioned further down.

Nothing is local. So you have to only use the API, and accept the risk of instance death .

. The learning threshold is significant to scare non-geeks.

Amazon AWS's DevPay sounds like a good method of generating a revenue for making images etc. But is only for people in the US, so useless.

Beginners guide

Pre requisits

You need to be comfortable with command line Linux. Otherwise let someone else do this for you.

Read up

Find out as much as you can about the Amazon elastic compute cloud.

Register with Amazon Web Services

Tools

You can install the command line tools, but these pages will assume you have installed the preferable elasticfox gui. However the more recent aws console is easy and a good choice.

SSH Key

You should pick your ec2 region, EU or USA. Then via Elasticfox's KeyPairs tab create a SSH key to use with ec2.

Security Groups

The default security group is quite open I tend to create thse 5 groups in addition:

Group Name Protocol From port To port Source SSH tcp 22 22 0.0.0.0/0 Web tcp 80 80 0.0.0.0/0 tcp 443 443 0.0.0.0/0 tcp 8000 8999 0.0.0.0/0 Mail tcp 25 25 0.0.0.0/0 tcp 143 143 0.0.0.0/0 tcp 465 465 0.0.0.0/0 tcp 587 587 0.0.0.0/0 tcp 993 993 0.0.0.0/0 tcp 110 110 0.0.0.0/0 tcp 995 995 0.0.0.0/0 VNC tcp 5500 5510 0.0.0.0/0 tcp 5800 5810 0.0.0.0/0 tcp 5900 5910 0.0.0.0/0 Ping icmp -1 -1 0.0.0.0/0 icmp 8 8 0.0.0.0/0

Experiment

Get a feel for ec2 by experimenting with images.

My Ubuntu server in the cloud howto

Take care of shutting down and terminating all at the end.

Risks

Beware of the risks of using Amazon ec2.

Costs Amazon AWS costs are for the time your running instance(s) are running, traffic to and from internett, S3 storage used, unused IPs and EBS usage. The risks are Not knowing these costs. Accidentally leaving unused instances running 24/7, as instance running are normally the bulk of your costs. Getting slashdotted. If you don't have a good portion of revenue from traffic, e.g. ads etc, such an event will murder your traffic costs. I have a separate page covering expected costs if a similar setup to mine.

Security It is on the net. Be vigilant.

Data loss Dead instances and all their data can not be recoved.

Take backups and use EBS judisciously.

back to flurdy's ec2 docs