Tired of slow shared hosting? Now you can move your Drupal or WordPress web site to Amazon’s EC2 cloud services, and you can even get free hosting for a year! That’s because Amazon has a deal going on to attract new users – they call it their free tier deal. Check it out, sign up.
Amazon’s EC2 service lets you create virtual servers of your own in their cloud. They have since added EBS (Elastic Block Store) and it is the addition of EBS that makes them very attractive for hosting your typical WordPress or Drupal web site, because it gives you persistent storage. The free deal is for running a single micro instance. A micro instance provides nominal computing power all of the time, with the ability to jump up to 2 EC2 Compute Units on demand, and 613 MB of memory. A normal small instance gives 1 EC2 Compute Unit all the time, along with 1.73 GB of memory. A small instance is not free, runs about $80 a month for most after it is all said and done. But the micro instance is great for most sites. I am running four low-traffic WordPress sites and 2 decent traffic Drupal sites on one micro instance, and I get fast page loads — I am very pleased. All told I only see about 1000 page views a day, but on shared hosting all I had was trouble and slow loading pages. And free for a year with low rates after that? Who can complain? Well, there is a downside. You have to configure and manage your server. It is not like with shared hosting where they have everything mostly set up for you.
But managing your own server is not that hard if you are interested in it at all. Setting up a mail server was the hardest part for me. And I detail all the steps below, for your reference, and as I future reference for myself. To save time, I refer you to other guides I used for parts of it.
So you signed up at http://aws.amazon.com/free/ – once you get your emails back from Amazon saying you are good to go, then it is time to log in to the AWS Management Console. Go here: http://aws.amazon.com/console/ and click on the button on the right side to sign in (choose the EC2 popdown next to the button).
First set up a security group. This is like a firewall setup. You’ll want to add SSH for port 20, for SSH access to the server. And you’ll want http access on port 80, and possible https access on port 443. Refer to the section “Setting up a security group” on this guide for more information.
Next, choose Key Pairs from the side bar menu and create a new key pair. This is used for authentication when SSH’ing into your server. More secure than password based authentication. For more info, see “Setting up your AWS account and tools” section in this guide. Save your key pem somewhere where you will not be likely to delete it on your computer.
Note, if setting up a micro instance, the guide I refer to above has information you should not follow about setting up persistent storage, because that article was written before EBS became available.
Now it is time to pick an AMI – Amazon Machine Image. This is like your virtual servers set up – what version or distribution of Linux you want to use, all ready to go. An Amazon Machine Image (AMI) is an encrypted machine image that contains all information necessary to boot instances of your operating system and software. For example, an AMI might contain all the software to act as a web server (e.g., Linux, Apache, and your web site). I went with Ubuntu Lucid LTS. Ubuntu is popular, well supported, and I like that they make long term support versions catering to web server use. From Amazon’s Help Guide:
To use Amazon EC2, you launch one or more instances of an AMI. An instance might be one web server within a web server cluster or one Hadoop node.
When launching AMIs, you can select an Amazon-provided AMI, a public AMI that another Amazon EC2 user provided, or an AMI that you create.
An Amazon EC2 instance can be launched from an AMI backed by either Amazon S3 or by Amazon EBS. Instances launched from AMIs backed by Amazon S3 use the local instance store as the root device (e.g., / or C:). An instance launched from an AMI backed by Amazon EBS uses an Amazon EBS volume as its root device.
I used ami-3e02f257. Make sure you pick an EBS (Elastic Block Store) version of an ami – micro instances require it.
More to come…