Utilizing Amazon Web Services for Basic Website Hosting

Similar documents
Amazon Web Services EC2 & S3

Online Backup Guide for the Amazon Cloud: How to Setup your Online Backup Service using Vembu StoreGrid Backup Virtual Appliance on the Amazon Cloud

Chapter 9 PUBLIC CLOUD LABORATORY. Sucha Smanchat, PhD. Faculty of Information Technology. King Mongkut s University of Technology North Bangkok

Automated CPanel Backup Script. for home directory backup, remote FTP backup and Amazon S3 backup

FileCruiser Backup & Restoring Guide

ArcGIS 10.3 Server on Amazon Web Services

ServerPronto Cloud User Guide

VX 9000E WiNG Express Manager INSTALLATION GUIDE

Eucalyptus User Console Guide

SOS SO S O n O lin n e lin e Bac Ba kup cku ck p u USER MANUAL

Every Silver Lining Has a Vault in the Cloud

EZblue BusinessServer The All - In - One Server For Your Home And Business

MATLAB Distributed Computing Server Cloud Center User s Guide

DISTRIBUTED DATA COLLECTION FOR REINSURANCE (RI) AND RISK ADJUSTMENT (RA): PROVISIONING. August 27,

Setup Cisco Call Manager on VMware

Installation and Deployment

An Introduction to Cloud Computing Concepts

How to Setup and Connect to an FTP Server Using FileZilla. Part I: Setting up the server

jbase 5 Install on Amazon AWS a Primer

Installing Booked scheduler on CentOS 6.5

SmartFiler Backup Appliance User Guide 2.0

This computer will be on independent from the computer you access it from (and also cost money as long as it s on )

Chapter 28: Expanding Web Studio

Zend Server Amazon AMI Quick Start Guide

How To Set Up Dataprotect

LOCKSS on LINUX. CentOS6 Installation Manual 08/22/2013

VMTurbo Operations Manager 4.5 Installing and Updating Operations Manager

EZblue BusinessServer The All - In - One Server For Your Home And Business

How to Use? SKALICLOUD DEMO

Server & Workstation Installation of Client Profiles for Windows

Uptime Infrastructure Monitor. Installation Guide

Backup & Disaster Recovery Appliance User Guide

Freshservice Discovery Probe User Guide

BaseManager & BACnet Manager VM Server Configuration Guide

Amazon Web Services Primer. William Strickland COP 6938 Fall 2012 University of Central Florida

Using SUSE Studio to Build and Deploy Applications on Amazon EC2. Guide. Solution Guide Cloud Computing.

AWS Account Setup and Services Overview

VMUnify EC2 Gateway Guide

CEFNS Web Hosting a Guide for CS212

QuickStart Guide for Managing Computers. Version 9.2

Aspen Cloud Server Management Console

Opsview in the Cloud. Monitoring with Amazon Web Services. Opsview Technical Overview

Customer Control Panel Manual

OS Installation Guide Red Hat Linux 9.0

VXOA AMI on Amazon Web Services

Hosting Users Guide 2011

Quick Start Guide for VMware and Windows 7

How to Backup XenServer VM with VirtualIQ

System Administration Training Guide. S100 Installation and Site Management

EVault for Data Protection Manager. Course 361 Protecting Linux and UNIX with EVault

Moving Drupal to the Cloud: A step-by-step guide and reference document for hosting a Drupal web site on Amazon Web Services

RingStor User Manual. Version 2.1 Last Update on September 17th, RingStor, Inc. 197 Route 18 South, Ste 3000 East Brunswick, NJ

Required Virtual Interface Maps to... mgmt0. bridge network interface = mgmt0 wan0. bridge network interface = wan0 mgmt1

Amahi Instruction Manual

Using the IPMI interface

DVS-100 Installation Guide

Cloud Computing. Adam Barker

SmartFiler Backup Appliance User Guide 2.1

Server Installation Manual 4.4.1

CLOUD INFRASTRUCTURE VIRTUAL SERVER (SHARED) USER GUIDE

Getting Started with Amazon EC2 Management in Eclipse

EVault Software. Course 361 Protecting Linux and UNIX with EVault

In order to upload a VM you need to have a VM image in one of the following formats:

CTERA Agent for Linux

Bitrix Site Manager. VMBitrix Virtual Machine. Quick Start And Usage Guide

JAMF Software Server Installation Guide for Linux. Version 8.6

JAMF Software Server Installation and Configuration Guide for Linux. Version 9.2

Parallels Plesk Automation

Red Hat Linux 7.2 Installation Guide

Building a Private Cloud Cloud Infrastructure Using Opensource

AJ Matrix V5. Installation Manual

Hyper-V Protection. User guide

DVS-100 Installation Guide

SysPatrol - Server Security Monitor

How To Image A Single Vm For Forensic Analysis On Vmwarehouse.Com

Virtual Appliance Setup Guide

Zerto Virtual Manager Administration Guide

USER CONFERENCE 2011 SAN FRANCISCO APRIL Running MarkLogic in the Cloud DEVELOPER LOUNGE LAB

Centralized Mac Home Directories On Windows Servers: Using Windows To Serve The Mac

SETTING UP A LAMP SERVER REMOTELY

Setting up FileMaker 10 Server

Kollaborate Server Installation Guide!! 1. Kollaborate Server! Installation Guide!

Synthesis Migration Guide

Setting up VMware ESXi for 2X VirtualDesktopServer Manual

Administrator Guide. v 11

The Nuts and Bolts of Autodesk Vault Replication Setup

Web Application Deployment in the Cloud Using Amazon Web Services From Infancy to Maturity

Tips for getting started! with! Virtual Data Center!

Creating a DUO MFA Service in AWS

File Protection using rsync. Setup guide

Enterprise Remote Control 5.6 Manual

HOMEROOM SERVER INSTALLATION & NETWORK CONFIGURATION GUIDE

The Carbonite Appliance HT10 User Guide

Installation Guidelines (MySQL database & Archivists Toolkit client)

ArcGIS for Server in the Amazon Cloud. Michele Lundeen Esri

insync Installation Guide

Introduction to Cloud Computing on Amazon Web Services (AWS) with focus on EC2 and S3. Horst Lueck

efolder BDR for Veeam Cloud Connection Guide

Installing CPV Lab Version 2.17

Transcription:

Utilizing Amazon Web Services for Basic Website Hosting Anthony Suda Network Manager marketing + technology 701.235.5525 888.9.sundog fax: 701.235.8941 2000 44th st s floor 6 fargo, nd 58103 www.sundoginteractive.com

Website hosting is a broad industry with many players. Most of the hosting companies allow the novice Internet user to set up a simple website in a matter of minutes. However, they leave out the control that a lot of companies and system administrators would like to have when dealing with their own website. Amazon s Web Services allows you to not only have full control over the environment where a website lives - as if it was served from your own server room on a server you purchased - but keeps it all in the cloud where hardware issues are on the shoulders of Amazon, and not the system administrator or the company s IT department. They also allow a number of could-based services that one simply couldn t replicate in their own server room, or could with most increased costs in hardware and software licenses. In this white paper, I intend to describe one of the many ways in which to leverage Amazon s Web Services in order to host basic websites. This will only cover one of Amazon s many services they offer, but by the end of the paper, you will be able to see the potential of linking in more of their services to expand your website s capability and reach. Terminology First, let s start out defining a few terms that will be used throughout this paper. I ll be using abbreviations for Amazon s services, as these abbreviations are used frequently on their own website to reference the services. Amazon Web Services (AWS) product s page (http://aws. amazon.com/products/) lists all the product names and also includes the abbreviations where relevant. For the duration of this paper, there are a few terms I will define. A Simple Website is a website that has all static content and no database requirements. The pages are made once and won t be changing frequently, if at all. This type of website is best hosted using Amazon s Simple Storage Service (S3). We won t get into the how-to s of setting up that type in this paper. A Basic Website is a website that has database requirements and has dynamic content, but isn t so large as to need robust, separate database servers, load balancing or content delivery networks. For this kind of website, we re going to make use of Amazon s Elastic Compute Cloud (EC2). This service is what will be focused on for the remainder of this paper. EC2 makes use of what are termed Instances. You can define an Instance as a regular server. One chooses the operating system to run, size of drives attached, and can also determine how much RAM and processing power it has by choosing between different Instance sizes. There are many options when it comes to Instance sizes, but here are just a few that are currently offered (as of January 2012): Standard Instances Instances of this family are well suited for most applications. Small Instance (Default) 1.7 GB of memory, 1 EC2 Compute Unit (1 virtual core with 1 EC2 Compute Unit), 160 GB of local Instance storage, 32-bit platform Large Instance 7.5 GB of memory, 4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each), 850 GB of local Instance storage, 64-bit platform Extra Large Instance 15 GB of memory, 8 EC2 Compute Units (4 virtual cores with 2 EC2 Compute Units each), 1690 GB of local Instance storage, 64- bit platform Micro Instances Instances of this family provide a small amount of consistent CPU resources and allow you to burst CPU capacity when additional cycles are available. They are well suited for lower throughput applications and websites that consume significant compute cycles periodically. Micro Instance 613 MB of memory, up to 2 ECUs (for short periodic bursts), EBS storage only, 32-bit or 64-bit platform 2

The current list can be found here: http://aws.amazon.com/ec2/#instance For the sake of this paper, we ll be focusing on using the Micro Instance size as it s suitable for a basic website. Amazon Machine Image (AMI) is an image of a working operating system that will work in EC2. The operating systems available are pretty much any you can think of - from Windows to Linux versions (Red Hat Enterprise, SUSE, Ubuntu, etc). Amazon also has their own linux based operating system (OS). Account Setup To start setting up AWS, one first needs an account with Amazon. If you or your company already have made purchases through the Amazon store, you can make use of those credentials to sign up for AWS. If not, you ll need an email address and billing information to proceed with the signup. AWS signup requires the use of a credit card for monthly charges. Credit cards that have been used for Amazon product purchases don t transfer into AWS, so they will need to be re-entered if they are to be used. During the signup process, an automated phone call will be placed and you will need to answer and record the number that s played to you. This is an added security measure that ensures you re a human being, and not some automated bot that likes to fill out forms. Once you ve completed the signup and phone verification, you will be taken to the AWS Console. You will receive an email stating the signup was successful. This process also signs up your email address to receive email updates from AWS about new features and services that are offered. Billing receipts for use will be sent to this email address as well. Tip: When signing up for an account for your company, it might be a good idea to use a generic email account instead of one tied to a person s name. This way, if that person ever leaves, you don t have to worry about changing email addresses or losing email invoices or alerts when their account is disabled or deleted. The AWS Console When you first get to the AWS Console, you ll see a list of many AWS products and most likely will be on the S3 tab. We ll be working in the EC2 tab. Launching an Instance You ll notice on the EC2 tab, there s a nice big button labeled Launch Instance. This will start the process of booting up your Instance. AMI Selection Once you click there, you ll get to select the AMI you plan on using. 3

The Quick Start AMI s are created and maintained by Amazon and give you a great baseline to start. If you re wanting a different OS than what they have listed, search in the Community AMIs for the version you would like. Note: A lot of the Community AMIs have other applications and software installed on them besides just the base operating system. You can also start with a quick or community AMI and then customize the OS with the applications and software you re wanting as a baseline. This creates your own AMI so that when you would like another Instance launched, especially in a different Region, you use that AMI and save yourself the time of customizing. Choosing the Instance Type Next in the launch process is to select the Instance Type. For the Basic Websites I m referring to, a Micro Instance type has plenty of power. Here you can also choose the Availability Zone of the Instance. Within an EC2 Region, there are different zones where the Instance will be placed. Components, like additional volumes within each zone, can be assigned to Instances within their zones, but can t be accessed from other zones. It s similar with Regions, as one Region is completely separate from another and items can t be shared between them. On the next page, you continue to refine the Instance Type. 4

On the page, you may choose a specific kernel for your AMI selection if you re aware of some very specific requirements of your software, but generally both the Kernel and RAM Disk IDs are left at default. It s also a good idea to check the Termination Protection box - this adds an extra step to the process of deleting a server. If one doesn t check this box, it s quite easy to accidentally terminate (delete) the whole server. Similarly, the Shutdown Behavior defaults to Stop and not Terminate. If, for some reason, you re wanting the Instance to be deleted when the OS shuts down, you can change this behavior. For our sake, we re leaving that as Stop. The following page asks for tags to help with sorting and administration. This is basic metadata information and will only be visible to you when logged into the EC2 console. It s best to at least type in a Name value, especially if you re going to have multiple Instances that host different things. Create a Key Pair On this screen, you create a public and private key pair. This key pair allows you to securely connect to your Instance. If you don t create a key pair, you need to know the username and password to connect to the AMI you re launching - assuming this AMI even allows you to connect without a key pair. It s good practice to create a standard key pair. You can reuse it for every Instance you launch if you like. 5

Firewall Setup Sometimes, working with a firewall setup within an operating system can be frustrating. And if one has multiple servers doing similar things, having to set up the firewall rules more than once can be time consuming. AWS resolves this issue by putting the firewall completely outside of the OS. You configure the firewall independent of the OS - so that no matter what AMI you ve chosen or will choose, only what you allow can get to the Instance at all. Amazon Labels These Security Groups. Common security group setups allow SSH, Remote Desktop, and special web services and ports access from only the company s IP address, and then allow access to the web service port (80) for the rest of the world. This is a great security measure so that even if a person has the login information for the server, they have to be inside your network in order to access it. Review The final screen, in launching an Instance, is the Review screen that allows you to see everything you ve just chosen on one page and gives options to click back to change it if you need to. The last button to hit is Launch. Note that it can take a minute or so for the Instance to launch and boot up to the point where you can remote into it. 6

Elastic IPs With traditional hosting, when you have a hosting location or dedicated server, the public IP address is bound to that server. If, for some reason, you need to move your website and applications to another server, you have to update your domain name s DNS records to point to the new server s public IP address. EC2 gets around this issue with Elastic IP addresses. These are pubic IP addresses that are bound within EC2 Regions and can be dynamically assigned to any Instances you have running in that Region. Let s look at a brief example. Say you have your website running on a Windows Instance. Your company decides to create a new website hosted on a Linux server for increased security and performance. You start up a new Linux Instance and work on development. In the past, when you were done with development and testing, you needed to change your domain name s DNS record entry (at least) to point to a new public IP address. Changes to DNS entries take time to replicate out to the world - anywhere from 1 to 24 hours, and sometimes even longer. So in our example, we would have to wait up to a day or more to make sure everyone is seeing our new website. But with EC2 s Elastic IP system, we ve had the DNS A record pointing to an Elastic IP. Now that we re ready to launch, all you have to do is disassociate the IP from the old Windows server and associate it with the new Linux server. The new website is up and available to the entire world in less than a minute (barring any browser caching issues they may have). Allocating and Assigning an Elastic IP By going to the Elastic IP section of the EC2 console, you are presented with the Allocate New Address button. Once you ve allocated an address, you can select it and an Associate Address button will appear. By clicking on that, you can associate the IP address to your running Instance. 7

Logging In and Configuring the OS Now that your Instance is humming, we can log into it and start tweaking. When you click on your running Instance to select it and then click the Instance Actions button, you ll be given the list of available actions for that Instance. The first one is Connect. When choosing this, a screen will pop up with the instructions on how to connect to your Instance - SSH if you chose a Linux AMI, Remote Desktop if you chose Windows. It will also show you how to use your key pair to securely log into the Instance. Installing and Updating Software Now one should focus on getting the Instance updated and all needed servers installed like Apache, MySQL, PHP, etc. A handy application for managing a Linux server like this is called Webmin (http://webmin.com/) which runs on its own webserver application and can manage the entire system. Using Webmin makes it easy to manage the server without having to enter in multiple command lines and edit config files. It s also easy to set up notifications for system updates so when a patch or security update is released for your operating system, you will receive an email stating the system can be updated. This is an important step in keeping the Instance running smoothly and securely. Creating the Website s System User Account One way to increase security on the system is to not use the root login (for a Linux system) for doing everything. And sometimes you want to give FTP access to people who shouldn t have full access to all the system files. So creating a user account where the website files will be stored is a good step to take. When creating the website s system user account, the server creates a folder for that user s files, usually under the /home/ directory. If you have set up an FTP server and configured it properly, when this user logs in, they will only have access to their own folder. 8

Storing the Website Files and Database on a Separate Drive Now we have our basic requirements installed on the Instance: Apache, MySQL, PHP. Before we go further, let s add a little bit of flexibility and security to our setup. Let me start with an example. Say you re doing a routine update of the server s OS. You re installing updates and everything is going fine when, all of a sudden, an update fails or something else happens that compromises the OS so your website doesn t work properly or doesn t show up at all. Well, you have a few options. You can manually copy out the files and rebuild the Instance from the AMI - but that takes more time than what we d like, especially the copying of files. What if we could unplug our site files and database from this broken OS and plug it into a different OS that s ready to accept it? If the Instance and servers have been set up to look to the site s user folder under /home/ for all of their files (Apache and MySQL), then plugging in the drive and mapping it to that folder will make the site come back up much faster. Here s a diagram to help explain this concept better: So here s the process for creating a new drive that we can use to store the site files and database. Create a new Elastic Block Store Volume In the AWS EC2 console, under the Elastic Block Store section and under Volumes, there is a Create Volume button. When clicking this, it gives you the options for creating this new volume: Once you have specified the size needed - which should be large enough to hold your website files and DB, and allow for some growth - you choose the Availabilty Zone. This AZ needs to match the same zone as the Instance, otherwise you will not be able to attach it to that Instance. Remember that zones are exclusive from one another when it comes to volumes. But note, there is also a snapshot option in this window. When first creating the volume, leave it as No Snapshot to create a blank volume. But if you have your new recovered OS in a different zone than the EBS volume that stores your site files and database, you can make a snapshot of that volume and then create a new volume in the new OS s zone using that snapshot. This will generate a copy of that volume and its files in the new zone. 9

Attaching the EBS Volume Now that the Volume is created, you can select it and then click the Attach Volume button. In the Instances drop down, you will see the available Instances in that zone to attach the volume to and also their running state. Next it asks what to call the device so the OS can connect to it. Once you ve selected the Instance above, it automatically fills in the first device path it believes to be valid, usually /dev/sdf for Linux Instances. If you know you want to attach it to a different device path, here s where you can change it. Now that your device is attached, you can go into the OS and partition, format and mount the volume to the website s user directory, for example /home/website/. This means that any files stored in the /home/website/ folder are located on this volume. Note, any files that were already in the /home/website/ folder will be removed once you attach this volume to that path. Setting up Apache and MySQL to use the New Volume Now it s time to set up the servers to locate their files on the new volume. First, let s tackle MySQL. Stop the MySQL server first. That way we can move its files around. By default, MySQL stores its database files in /var/ lib/mysql. So we move that entire directory to the /home/website/ directory on our new volume. (Note: One could also just store the website s database folder on this volume too instead of the whole mysql folder). Once the folder is moved, an alias needs to be created that references this new location, so the command: ln -s /home/website/mysql /var/lib will create this alias and will prevent us from having to reconfigure MySQL to accept the new path. Now we can start up MySQL again and check to make sure it s running properly. Next is Apache. First make a folder in the /home/website/ volume where your website files will be stored (Note: make sure it s owned by the website system user or else that user account won t be able to modify those files). All that s needed here is to create a new virtual host for your website and make the Document Root that new folder you created, for example / home/website/public_html/. That s it for Apache. You might need to tweak the PHP settings to allow PHP scripts to run under this new path. If PHP safe mode is enabled, the paths that it allows to run PHP scripts might be /var/www or something similar. If that s so, you ll need to modify the php.ini file to include your /home/website/public_html/ path as well, or exclusively. Install your CMS or Upload Your Website The Instance is now all ready to accept the install of your CMS or to begin hosting your website as you have created it. The files and database will be stored on the separate EBS volume which can be backed up and remounted to other Instances as needed without having to worry about the operating system or having to allow system users access to other system folders on the server. 10

Conclusion This way of setting up hosting for a basic website allows you greater control over the environment in which your website is hosted as well as potential for greater disaster recovery options and scalability within AWS. Using automated snapshots for backups, load balancers for distributing traffic, and setting up a content delivery network are all very easily done within AWS. That s not even mentioning the higher-end capabilities they offer. Now there are many ways to set up a basic website using AWS, but this is one way I ve found that works pretty well and is quite easy to get working. I hope this helps you in creating a solution for your company s website and gives you the confidence to explore more of what AWS has to offer. 11