John Bullard

Cloud Web Hosting: AWS

  1. Intro
  2. Amazon Web Services (AWS)
  3. EC2 Instance
  4. EBS Volume
  5. Configure Server Instance
  6. Conclusion

Introduction

Cloud computing services have become popular web hosting platform. Scalable within minutes, high availability, and very affordable; they are a great platform for launch new websites.  This guide will cover the basics of hosting a website with Amazon Web Services. For more information read, the Cloud Web Hosting: A Comparison.

Amazon Web Services

Amazon Web Services

Amazon Web Services (AWS) was created to allow  you, the developer, to focus completely on your application. It utilizes Amazon’s robust cloud computing infrastructure, eliminating the burden of server deployment,  bandwidth management, network infrastructure, and other expensive data center issues. In essence, it allows you to utilize the same infrastructure that Amazon uses to run its own global network of web sites.

To host our website we will use three AWS offerings:

  • Electric Cloud Compute (EC2)
    • EC2 is a web service that provides resizable, pay as you go, compute capacity on Amazon’s enterprise cloud.
  • Elastic Block Store (EBS)
    • Amazon Elastic Block Store (EBS) provides highly reliable storage volumes that persist independently from the life of an instance.
  • Simple Storage System (S3)
    • Amazon S3 provides a simple  interface that can be used to store and retrieve huge amounts of data  quickly and reliably, for dirt cheap.

For detailed information visit Amazon Web Services Overview.

[Image: EC2 -> EBS -> S3]

Hosting a website with AWS is fairly straightforward. Will we create a EC2 Instance (the web server), attach an EBS volume (persistent storage), and configure the hosting software (Apache/MySQL)! Easy.

Create EC2 Instance

  1. Log into the AWS Management Console
  2. Select a pre-configured Amazon Machine Image (AMI)
    1. We will be using the Fedora  LAMP Web Starter (AMI  ID: ami-25ey004c).
  3. Create Key Pair
  4. Configure Firewall
  5. Launch
    1. Select 1 Small Instance. Note the Availability Zone and Key Pair Name.

Create EBS Volume

EC2 Instances are virtual. Each time an instance is terminated, it is reloaded fresh from an AMI image. This is the same as re-formatting a server every time. Thus, EBS was introduced to provide persistent storage volumes that can be attached to EC2 instances. Think of it as an external hard drive of sorts.

  1. In the AWS Management Console, select Elastic Block Store > Volumes
  2. Create new volume
    1. 1 GB Volume Size
    2. Ensure the availability zone of volume matches the AMI instance (us-east-1a)

  1. Attach EBS onto AMI instance
    1. Mount on device sdf

Configuring the Server

  1. Log in
  2. Download keypair , Putty , PuttyGen
  3. Turn Amazon key into Putty file  with PuttyGen
  4. Configure Putty
  5. Log in
  1. Prepare EBS Volume
  2. mount EBS volume
    • [img]
  3. partition
    • fdisk /dev/sdj
  4. format
    • mkfs ext3 /dev/sdj1
  5. finalize
    • fsck -f -y /dev/sdj1
  1. Apache
  2. Symlink
  3. delete default folder
  4. symlink to www folder
  1. MySQL
  2. edit my.cnf
  3. point datadir to mounted ebs volume

4 Comments

Comments

:

: