<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Cardinal Path » Blog</title>
	
	<link>http://www.cardinalpath.com</link>
	<description>Version 1.5</description>
	<lastBuildDate>Wed, 30 May 2012 21:30:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/seo-and-usability" /><feedburner:info uri="seo-and-usability" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Google+ Local, the New Google Places</title>
		<link>http://feedproxy.google.com/~r/seo-and-usability/~3/sSRK7HRXVRk/</link>
		<comments>http://www.cardinalpath.com/google-plus-local-new-google-places/#comments</comments>
		<pubDate>Wed, 30 May 2012 21:18:30 +0000</pubDate>
		<dc:creator>Jackson Lo</dc:creator>
				<category><![CDATA[Search Engine Optimization]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[google places]]></category>
		<category><![CDATA[google+ local]]></category>
		<category><![CDATA[local search]]></category>
		<category><![CDATA[local seo]]></category>

		<guid isPermaLink="false">http://www.cardinalpath.com/?p=5638</guid>
		<description><![CDATA[Just a few weeks ago, David Mihm published an article that spoke widely about the Plus-Places merge, and now that plane has landed. Today, Google announced that Google Places is now Google+ Local. Google+ Local presents a number of opportunities for local businesses to &#8230; <a href="http://www.cardinalpath.com/google-plus-local-new-google-places/"></a>]]></description>
			<content:encoded><![CDATA[<p>Just a few weeks ago, David Mihm published an article that spoke widely about the <a href="http://www.davidmihm.com/blog/google/plus-places-merge/" target="_blank">Plus-Places merge</a>, and now that plane has landed. Today, Google <a href="http://googleblog.blogspot.ca/2012/05/localnow-with-dash-of-zagat-and.html" target="_blank">announced that Google Places is now Google+ Local</a>. Google+ Local presents a number of opportunities for local businesses to engage socially with their customers online. The biggest changes that I see in the switchover are the visual presentations on business pages, new review system and indexed Google+ Local pages. Let&#8217;s touch on each of those points here.</p>
<h2>What&#8217;s Changed?</h2>
<p><a href="https://plus.google.com/102761022316829734971/posts" target="_blank">Greg Sterling</a> did an excellent post that detail out the major visual changes from the <span style="text-decoration: underline;"><a href="http://searchengineland.com/google-places-is-over-company-makes-google-the-center-of-gravity-for-local-search-122770" target="_blank">Places to Google+ Local move</a></span>. But to illustrate, I will use one from my city, Ottawa, Canada (yay, we didn’t get left in the dark for once).</p>
<p>Here, we see that suggested search in Google+ Local is different from the natural Google web search. I’ve confirmed that these suggested searches are not in relation to businesses ranked on the first page of Google under local results, they appear to be randomized and matching only titles with phrase match. For example, if your business does not have “photographers” with an “s” you will not be suggested.</p>
<p><img class="alignnone size-medium wp-image-5639" title="googlelocal_photographers" src="http://www.cardinalpath.com/cpwp/wp-content/uploads/googlelocal_photographers-550x322.png" alt="Google+ Local - photographers search" width="550" height="322" /></p>
<p>The search under Google+ Local also presents two criteria; keyword and location.  At default, it appears as though Google is using the location you specified under your Google+ Account. Without including a location, it will use your city for the search.</p>
<p><img class="alignnone size-full wp-image-5642" title="googlelocal_photographers2" src="http://www.cardinalpath.com/cpwp/wp-content/uploads/googlelocal_photographers2.png" alt="Google+ Local - photographer result" width="988" height="762" /></p>
<p>Clicking through one of the results, I arrive at <a href="http://www.ryanparentphoto.com/" target="_blank">Parent Photography</a>, where they appear to be a very reputable business to get wedding photographs from. On their <a href="https://plus.google.com/u/0/106362469326977625854/about" target="_blank">Google+ Local page</a>, we can see that the visuals are just popping! The page mirrors your <a href="http://www.google.com/+/business/" target="_blank">Google+ Business Pages</a>, which I suspect will merge with the Local pages as we see <a href="https://plus.google.com/u/0/106709488161587628987/about" target="_blank">here</a> (one of the piloted businesses to use Google+ Local first).</p>
<p>The one thing I noticed appearing on Google+ Local pages that was taken off of Google Places along with the &#8220;additional information&#8221; was the Hours of Operations. Hmm&#8230; makes sense for the to include it. Good job Google <img src='http://www.cardinalpath.com/cpwp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><img class="alignnone size-full wp-image-5643" title="googlelocal_photographers3" src="http://www.cardinalpath.com/cpwp/wp-content/uploads/googlelocal_photographers3.png" alt="Google+ Local - photographers page" width="972" height="877" /></p>
<h2>New Rating System</h2>
<p>“All scores in Google+ Local are <strong>determined by user reviews</strong>.”</p>
<p>The new rating system for users is based on a 0-3 point scale (<a href="http://support.google.com/plus/bin/answer.py?hl=en&amp;answer=1723748&amp;topic=2489960&amp;ctx=topic" target="_blank">source</a>). The ratings are then averaged and multiplied by 10 to get an average score out of 30, where 0 being the poorest and 30 extraordinary. The rating system is based off of Zagat, which was acquired by Google in September 2011.</p>
<p><em>“Zagat believes that the shared experiences of large numbers of passionate consumers is inherently more accurate than the opinions of a few critics. Zagat’s editorial team curates user feedback worldwide into concise and unbiased reviews that help people make quick, smart decisions. In addition, consumers rate distinct criteria of an establishment (for example, restaurants are rated for food, decor, and service) on a scale</em><em> </em><em>of zero to three, which is then averaged, multiplied by 10 and presented on Zagat’s signature 30-point scale.” <a href="http://support.google.com/plus/bin/answer.py?hl=en&amp;answer=2624986&amp;topic=2624954&amp;ctx=topic" target="_blank">Read the </a></em><em><a href="http://support.google.com/plus/bin/answer.py?hl=en&amp;answer=2624986&amp;topic=2624954&amp;ctx=topic" target="_blank">Source</a></em></p>
<p>Also, looking through 100-1,000 reviews can be tedious and may not answer the question you have in your mind. The sorting feature under the reviews is a useful gadget, which allows you to read reviews by Most Helpful, Latest, Highest Score and Lowest Score.</p>
<p>Another thing I like about the new rating system is how the criteria are broken out into multiple components. For example, restaurants are scored in three areas; food, decor and service. Other businesses will have different options for the review. The benefit of this is it brings in more perspective than a single rate (i.e. what does 2.5/5 stars mean? was the food bad or was it just the service?).</p>
<p>But&#8230; the big question will be&#8230; will Ratings have any influence on rankings? Please leave your thoughts below.</p>
<h2>Closing Thoughts</h2>
<p>Google+ Local is an opportunity pool for local businesses to think outside the box and to engage more with their customers online. The layer of social + local will only benefit those who share their passion for great customer service.</p>
<p>But, I think the message is quite clear; <strong>Get on Google+!</strong> Over and over, I see these messages popping up on blog posts:</p>
<ul>
<li>If You&#8217;re Not On Google+, You&#8217;re Not A Suggestion.</li>
<li>If you&#8217;re not on Google+, you can&#8217;t appear in the box.</li>
<li>If you&#8217;re not on Google+ yet, you&#8217;re missing out.</li>
</ul>
<p>Getting on Google+ does not simply mean to create a basic Google+ account and a business page. Instead, focus on developing an approach, think outside the box and start engaging with your customers. Whether you want your brand on social or not, people are talking about you. So jump on board!</p>
<p>I created a <a href="http://www.cardinalpath.com/your-local-search-checklist-for-2012/">checklist of items</a> to watch out for a while back, and I strongly believe they all still apply. The Google+ Local page is another piece to focus on. From an SEO standpoint, optimizing and linking to your Google+ Local page is something to consider as these pages will get crawled and indexed by Google.</p>
<p>Given this is a new roll-out, I would love to hear your feedback on the comments I made above. Please share your thoughts in the comments below.</p>
<img src="http://feeds.feedburner.com/~r/seo-and-usability/~4/sSRK7HRXVRk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.cardinalpath.com/google-plus-local-new-google-places/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.cardinalpath.com/google-plus-local-new-google-places/</feedburner:origLink></item>
		<item>
		<title>Spam is Spam: Keeping The Reports Away</title>
		<link>http://feedproxy.google.com/~r/seo-and-usability/~3/CLpPfnxkfgk/</link>
		<comments>http://www.cardinalpath.com/spam-is-spam-keeping-the-reports-away/#comments</comments>
		<pubDate>Fri, 25 May 2012 23:00:36 +0000</pubDate>
		<dc:creator>Kent Clark</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.cardinalpath.com/?p=5615</guid>
		<description><![CDATA[We all hate it. Even those who send it hate spam. And when most of us receive it we do exactly what we should: report it. The problem is, what I,, as a sender, consider to be spam is not the same as &#8230; <a href="http://www.cardinalpath.com/spam-is-spam-keeping-the-reports-away/"></a>]]></description>
			<content:encoded><![CDATA[<p>We all hate it. Even those who send it hate spam. And when most of us receive it we do exactly what we should: report it. The problem is, what I,, as a sender, consider to be spam is not the same as what you, as a receiver, consider to be spam. Case in point, Map My Ride.</p>
<p>I love Map My Ride. It&#8217;s an Android, iPhone, and Blackberry app which uses your phones GPS to map bike rides, giving you wonderful stats like speed, distance, calories burned, energy outputted, and graphs climbs and elevation. All in all, its an incredibly useful app.</p>
<p>Recently they updated their site and app, increasing user friendliness and enhancing features. In the process I also suddenly noticed something in my email:</p>
<p><img class="aligncenter size-full wp-image-5617" title="1" src="http://www.cardinalpath.com/cpwp/wp-content/uploads/1.jpg" alt="" width="300" height="303" /></p>
<p>Something struck me wrong about this. Why are they advertising to me? Did I click something at some point in the registration process? Did I &#8220;not opt out&#8221; while creating my account?</p>
<p>Going through the registration process again it seems that the latter.</p>
<p><img class="aligncenter size-full wp-image-5618" title="3" src="http://www.cardinalpath.com/cpwp/wp-content/uploads/3.jpg" alt="" width="335" height="318" /></p>
<p><img class="aligncenter size-full wp-image-5619" title="4" src="http://www.cardinalpath.com/cpwp/wp-content/uploads/4.jpg" alt="" width="407" height="114" /></p>
<p>Yep, looks like a hidden opt out. A common, if questionable, tactic. I know I am always trying to uncheck this stuff, and when I &#8220;miss one&#8221; and start getting email, I consider that spam.  And in this case it&#8217;s not even classic &#8220;soft marketing&#8221;, they&#8217;re specifically trying to sell me products. They provide a one click unsubscribe, so its probably not a big deal, but at the same time you have to wonder whether you should consider this underhanded. Is it enough to bring the ire of the spam button? They better hope not.</p>
<p>&nbsp;</p>
<img src="http://feeds.feedburner.com/~r/seo-and-usability/~4/CLpPfnxkfgk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.cardinalpath.com/spam-is-spam-keeping-the-reports-away/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.cardinalpath.com/spam-is-spam-keeping-the-reports-away/</feedburner:origLink></item>
		<item>
		<title>Auto scaling your website with Amazon Web Services (AWS) – Part 2</title>
		<link>http://feedproxy.google.com/~r/seo-and-usability/~3/1kxO_PYdidI/</link>
		<comments>http://www.cardinalpath.com/autoscaling-your-website-with-amazon-web-services-part-2/#comments</comments>
		<pubDate>Fri, 25 May 2012 12:00:56 +0000</pubDate>
		<dc:creator>Geoffrey Hoffman</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[ami]]></category>
		<category><![CDATA[autoscale]]></category>
		<category><![CDATA[aws tools]]></category>
		<category><![CDATA[cloud hosting]]></category>
		<category><![CDATA[cloudwatch]]></category>
		<category><![CDATA[ec2]]></category>
		<category><![CDATA[load balancing]]></category>
		<category><![CDATA[scalability]]></category>

		<guid isPermaLink="false">http://www.cardinalpath.com/?p=4628</guid>
		<description><![CDATA[In the first half of this article, we set up an EC2 instance on Amazon AWS, deployed our LAMP-based micro-site on it, tested it, and created an AMI image of the web application. If you’re following along and have an EC2/AMI &#8230; <a href="http://www.cardinalpath.com/autoscaling-your-website-with-amazon-web-services-part-2/"></a>]]></description>
			<content:encoded><![CDATA[<p>In <a title="AutoScaling Part 1: How to setup and use EC2 instances on Amazon AWS" href="http://www.cardinalpath.com/autoscaling-your-website-with-amazon-web-services-part-1/" target="_blank">the first half of this article</a>, we set up an EC2 instance on Amazon AWS, deployed our LAMP-based micro-site on it, tested it, and created an AMI image of the web application. If you’re following along and have an EC2/AMI ready, continue below to configure auto-scaling, otherwise review <a href="http://www.cardinalpath.com/autoscaling-your-website-with-amazon-web-services-part-1/" target="_blank">Part 1</a>.</p>
<h2>Part 2: Setting Up Auto Scaling</h2>
<p>Within the overall umbrella of Amazon Web Services are dozens of individual technologies that you can use together to provision, launch, monitor and manage scalable web applications. Setting up intelligent auto scaling (AS) on AWS requires several of them, including:</p>
<ul>
<li><strong>Amazon Machine Image (AMIs)</strong> &#8211; snapshot templates defining a launchable EC2 server instance</li>
<li><strong>Elastic Load Balancer (ELB)</strong> &#8211; a virtual load balancer platform with configurable events</li>
<li><strong>CloudWatch (CW)</strong> &#8211; tools to monitor and check your EC2 instances</li>
<li><strong>Command line tools</strong> &#8211; simple Java programs that call out to the AWS API using your credentials. Unfortunately, Amazon hasn’t added all of the autoscaling configurations to the online AWS Console yet, so until further notice, you’ll have to use a few command-line scripts to finish out the autoscaling configuration. Download the <a title="Download the Auto Scaling Command Line Tools from Amazon Web Services" href="http://aws.amazon.com/developertools/2535" target="_blank">Auto Scaling command line tool</a> from the AWS developer portal and run them on the command line to configure your autoscaling setup.</li>
</ul>
<h3>Why Auto Scaling?</h3>
<p>Online marketers spend hours, days, weeks and even months, planning marketing campaigns, both online and offline, to drive traffic to websites, and IT provisioning is difficult even when you know in advance when the traffic is coming. But what if you don’t know when a huge traffic spike will hit your server? The better a social or viral marketing campaign is, the more likely it could result in irregular traffic patterns or server load spikes at unexpected times. The flexibility of AWS autoscaling frees you from having to accurately predict and provision servers in advance of huge traffic spikes.</p>
<h3>How it works</h3>
<p>In general, Auto scaling with Amazon Web Services works like this:</p>
<ul>
<li>You define an AMI instance and create an Auto Scaling Group to launch instances into.</li>
<li>You use CloudWatch to monitor your server(s) instance(s), and when certain configurable events happen, you can launch more instances based on the AMI template you define.</li>
<li>EC2 instances launch behind the Elastic Load Balancer (ELB) you define.</li>
<li>The ELB will send traffic in a round-robin pattern between all the instances assigned to it, and you can control in real time how many instances you want to launch to cover sporadic bursts of high-volume traffic, and keep at least one or two running during traffic lulls. If any of your EC2 instances fails to respond, the ELB will detect it and launch a replacement. When web traffic dies down, you can terminate instances automatically, too.</li>
<li>CloudWatch lets you configure alarms that trigger auto scaling policies to launch additional EC2 instances into your auto scaling group when network traffic, server load, or other measurable statistic, gets too high—say, 80% usage. The number of servers you add is based on whatever your policy states—1, 3, 10 more servers—it’s up to you. Each server is a duplicate instance of the AMI you define in your auto scaling config. You can even use Amazon Simple Notification Service (SNS) to send yourself an email or text message when an auto scaling event occurs.</li>
<li>Your ELB automatically spreads out the incoming visitors between all the servers in your Autoscaling Group. You can set a minimum and maximum number of instances in your group, offering you peace of mind that your site will not crash due to the influx of visitors, and also to limit the impact on your billing statement. You are also able to tell AWS to decrease the number of instances when network traffic drops below, say 20% usage for a measurable amount of time, to scale back the number of servers in your web server farm.</li>
</ul>
<h3>How many servers will I need?</h3>
<p>That’s the toughest question to answer—a lot of variable factors are involved. It depends on the volume of traffic you receive, the type of EC2 instances you use, and the complexity of your application. For our simple PHP application, we estimated that a single t1.micro instance, Amazon’s smallest and least expensive EC2 option, should easily handle between 50 to 75 simultaneous users. We determined this based on the available amount of RAM available in a t1.micro instance, and comparing that to the average amount of memory taken by a typical PHP request on our application. We then did some actual load-testing and benchmarking with the command-line tool, <a title="Download siege to load test your web application servers" href="http://www.joedog.org/siege-home/" target="_blank">siege</a>. We’ll get into the details of that later. Ultimately we decided that we wanted no fewer than 2 servers and no more than 100, or support for up to 7,500 simultaneous users, based on using t1.micro’s in our autoscaling configuration.</p>
<h3>What to monitor</h3>
<p>AWS CloudWatch lets you monitor several different EC2 server performance metrics in real time, including&#8230;</p>
<ul>
<li>CPU Utilization (%)</li>
<li>Memory Utilization (%)</li>
<li>Network Out Utilization (MB)</li>
<li>Memory Used (MB)</li>
<li>Memory Available (MB)</li>
<li>Swap Utilization (%)</li>
<li>Swap Used (MB)</li>
<li>Disk Space Utilization (%)</li>
<li>Disk Space Used (GB)</li>
<li>Disk Space Available (GB)</li>
</ul>
<p>&#8230;and many more. It’s up to you what to monitor, but the metrics most useful for knowing when you should scale up and add another server or scale down by terminating a server are probably CPU utilization, memory utilization or network utilization.</p>
<p>It should also be noted that Amazon provides plenty of basic monitoring metrics for free. Basic monitoring has a 5 minute refresh interval. If monitoring every 5 minutes isn’t fast enough for your application, you can also look at the detailed monitoring option, which costs only fifty cents per metric per month. Detailed monitoring fires events at 1-minute intervals. Here’s a <a title="Amazon CloudWatch Metrics" href="http://docs.amazonwebservices.com/AmazonCloudWatch/latest/DeveloperGuide/CW_Support_For_AWS.html#ec2-metricscollected" target="_blank">list of the EC2 metrics</a> you can monitor using CloudWatch. If you don’t find a metric that will suit your application, you can even submit (via the Amazon AWS API) a custom metric from your app that CloudWatch should monitor.</p>
<h2>How to configure auto scaling</h2>
<p>Before we get started, let’s look at the two prerequisites you need to have in place before creating an auto scaling configuration.</p>
<p><strong>Prerequisite 1: Choose an AMI to use.</strong> If you haven’t created an AMI from one of your running EC2 instances, <a href="http://www.cardinalpath.com/autoscaling-your-website-with-amazon-web-services-part-1/#ami" target="_blank">go back to Part 1 and create an AMI now</a>, or click over to your AMIs page on the AWS Console to retrieve the AMI ID to be used as a template, and write it down. You’ll need an AMI ID in Step 1.</p>
<p><strong>Prerequisite 2: Fire up an ELB.</strong> The ELB name that is displayed on the AWS Console will also be passed to the command we run in Step 2. We used the AWS Console to create an ELB, and simply accepted the defaults on each of the Elastic Load Balancer setup screens. Once your ELB is up, you will most likely create a CNAME record at your DNS provider pointing your landing page or vanity domain to the DNS name given in the AWS Console. Visit the <a title="Elastic Load Balancing at Amazon AWS" href="http://aws.amazon.com/elasticloadbalancing/" target="_blank">Elastic Load Balancing at Amazon AWS</a> page for additional information.</p>
<p>Okay, here we go! As we mentioned above, not all of the functions needed to implement autoscale are implemented in the AWS Management Console yet. So, roll up your sleeves and fire up Terminal (Mac) or CMD (Windows). We’ll be using a few different command line tools to finish our autos caling configuration.</p>
<p><strong id="launch-config">Step 1: Create a launch config.</strong> The first command to setting up autoscale is <em>as-create-launch-config</em>. Using this command, you tell AWS:</p>
<ul>
<li>a unique name for the configuration,</li>
<li>which AMI ID you want to use as your template for creating more EC2 instances,</li>
<li>the EC2 instance type (the size and power of the server) to launch using your AMI,</li>
<li>your access key,</li>
<li>and a security group to deploy the instances into.</li>
</ul>
<p>The API replies with: “OK-Created launch config.”</p>
<pre class="brush: bash; title: ; notranslate">
$PROMPT&gt; as-create-launch-config {your_launch_config_name} --image-id {your_ami_id} --instance-type t1.micro --key {your_access_key} --group {your_group_name}
Return message: OK-Created launch config</pre>
<p><strong id="auto-scaling-group">Step 2: Create an auto scaling group.</strong>  Use the <em>as-create-auto-scaling-group</em> command to define the properties for your group of servers. Auto scaling groups are the core component of an auto-scaling configuration. This command takes the <em>launch_config_name</em> you defined from the step before as a parameter, the name of the ELB you want to use, and most importantly, lets you define the minimum and maximum number of servers you want to have in your cluster. In the example below, we define a group with a minimum of 2 servers and a maximum of 10.</p>
<pre class="brush: bash; title: ; notranslate">
$PROMPT&gt; as-create-auto-scaling-group {your_scaling_group_name} --launch-configuration {your_launch_config_name} --availability-zones us-east-1d --min-size 2 --max-size 10 --load-balancers {your_load_blancer_name} --health-check-type ELB --grace-period 300
Return message: OK-Created AutoScalingGroup</pre>
<p>The grace period is the number of seconds that AWS will wait after an autoscaling event occurs before possibly triggering another autoscaling event. This is an important consideration that prevents AWS from adding too many servers too quickly. AWS responds with “OK-Created AutoScalingGroup.”</p>
<p><strong id="scaling-policy">Step 3: Create auto scaling policies.</strong> Once we have our EC2 AMI, an AS launch config, and an AS group defined to deploy our  instances into, we’re ready to define the auto scaling policies that will actually cause more (or fewer) EC2 instances to be launched and attached behind the ELB.</p>
<p>The command used to change the number of servers in the group is the <em>as-put-scaling-policy</em> command. With auto scaling, you use EC2 monitoring within CloudWatch to trigger a certain policy, but before we can do that, we need to define the actual policies that will be triggered. You can use this command to manually trigger scaling events as well, for testing before your traffic burst arrives, and in doing so, you can not only see the effect of scaling up and down, but you can watch AWS work its magic by refreshing your Instances view—new server instances appear in the AWS Management Console as your traffic increases beyond the thresholds you set.</p>
<p>The <em>as-put-scaling-policy</em> command takes the auto scaling group name we defined in step 1, a name for the policy, such a “scale-up” or “scale-down,” the type of scaling change the policy defines, and a cooldown period. Again, the cooldown period is used to prevent AWS from executing multiple policies within a very short time.</p>
<pre class="brush: bash; title: ; notranslate">
$PROMPT&gt; as-put-scaling-policy --auto-scaling-group {your_scaling_group_name} --name scale-up --adjustment 1 --type ChangeInCapacity --cooldown 300
Return message: arn:aws:autoscaling:us-east-1:751374139099:scalingPolicy:e31ae79c-4210-42ad-8d86-60210aaf7a20:autoScalingGroupName/sg-breezes-gma:policyName/scale-up</pre>
<p>Above you can see the basic upscale policy we defined, named “scale-up,” a ChangeInCapacity policy to add 1 server and wait 3 minutes before another policy can be triggered. Below is the reverse operation, or a “scale-down” policy to remove 1 server from our group.</p>
<pre class="brush: bash; title: ; notranslate">
$PROMPT&gt; as-put-scaling-policy --auto-scaling-group {your_scaling_group_name} --name scale-dn &quot;--adjustment=-1&quot; --type ChangeInCapacity --cooldown 300
Return message: arn:aws:autoscaling:us-east-1:751374139099:scalingPolicy:07a0f71c-d214-4497-973f-c4cdcb15851f:autoScalingGroupName/sg-breezes-gma:policyName/scale-dn
</pre>
<p>In both cases, AWS replies with a return message including the unique auto-generated name of our two new auto scaling policies. We’ll use those unique policy identifiers to connect to our CloudWatch events in the final step.</p>
<p><strong>Step 4: Link a CloudWatch event to an auto scaling policy.</strong> At the moment we have everything we need for an <em>intelligent</em> autoscaling configuration <em>except one thing—the intelligence!</em> The smarts come from choosing a CloudWatch event, such as 80% CPU utilization of an EC2 instance in our group, and wiring up that condition to automatically trigger the scale-up policy we defined. We’re also going to want to do the same in reverse for scaling back down at 20% CPU utilization.</p>
<p>The command to do this comes from the CloudWatch command line tools, and is called <em id="metric-alarm">mon-put-metric-alarm</em>. This command takes several parameters:</p>
<ul>
<li>a name for the alarm that you choose</li>
<li> a description for what the alarm is monitoring,</li>
<li>the namespace for the alarm (in this case, AWS/EC2)</li>
<li>the name of the [namespace] metric that you want to monitor</li>
<li>the statistic type of the monitoring metric, such as Average or Percent,</li>
<li>a period or time interval,</li>
<li>a threshold for the statistic you choose,</li>
<li>a comparison operator, such as greater than or lesser than</li>
<li>a dimension, which is the ID of an EC2 instance to monitor</li>
<li>and the number of evaluation periods during which the metric you choose has to consistently return over or under the average or percent unit you define</li>
</ul>
<p>As you can see, there’s a lot to this command, but once we look at every parameter, you can see that without each of them, you wouldn’t have the ability to control auto scaling changes with enough granularity. The name and description are shown back to you later when using the <em>mon-describe-alarms</em> command. The statistics you’re watching, and the thresholds and time intervals, are important to test for your particular application. For example, we chose to monitor average CPU utilization for a period of 60 seconds, and an evaluation period of 3 intervals (or 3 minutes), for an event of 80% or greater level. Here’s the command to achieve this.</p>
<pre class="brush: bash; title: ; notranslate">
$PROMPT&gt; mon-put-metric-alarm --alarm-name sample-scale-up --alarm-description &quot;Scale up at 80% load&quot; --metric-name CPUUtilization --namespace AWS/EC2 --statistic Average  --period 60 --threshold 80 --comparison-operator GreaterThanThreshold --dimensions InstanceId=i-37b12752 --evaluation-periods 3  --unit Percent --alarm-actions arn:aws:autoscaling:us-east-1:751374139099:scalingPolicy:78d05062-0eda-436c-864e-d93776461eba:autoScalingGroupName/sg-sample-group:policyName/scale-up
OK-Created Alarm</pre>
<p>In English, the above command says, “If the average CPU utilization of instance i-37b12752 is measured at 80% or greater 3 times over 3 minutes, then trigger our scale-up policy.”</p>
<p>Here is the reverse <em>mon-put-metric-alarm</em> command we used to terminate one of the servers if the CPU utilization drops below an average of 20% over 3 minutes.</p>
<pre class="brush: bash; title: ; notranslate">
$PROMPT&gt; mon-put-metric-alarm --alarm-name sample-scale-dn --alarm-description &quot;Scale down at 20% load&quot; --metric-name CPUUtilization --namespace AWS/EC2 --statistic Average --period 60 --threshold 20 --comparison-operator LessThanThreshold --dimensions InstanceId=i-37b12752 --evaluation-periods 3 --unit Percent --alarm-actions arn:aws:autoscaling:us-east-1:751374139099:scalingPolicy:78d05062-0eda-436c-864e-d93776461eba:autoScalingGroupName/sg-sample-group:policyName/scale-dn</pre>
<p>For more information and examples, refer to the <a href="http://docs.amazonwebservices.com/AutoScaling/latest/DeveloperGuide/US_BasicSetup.html" target="_blank">Auto Scaling</a> section on the Amazon developer documentation.</p>
<h3>Testing with siege</h3>
<p>As mentioned above, we used the command line tool <em>siege</em> to work through the configuration setup and to verify whether our policies were working as we wanted. Using siege on a different server or EC2 instance, you can easily simulate tons of website traffic for a short period of time. Siege does this by creating dozens or even hundreds of concurrent HTTP requests to your URL for the duration you specify. This gives you a chance to see what will happen to your auto scaling policies when real users flood your web server with traffic and CloudWatch alarms start triggering.</p>
<p>Siege can be installed with the package manager on your system. We simply ran</p>
<pre class="brush: bash; title: ; notranslate">
sudo apt-get install siege</pre>
<p>on our Ubuntu/Debian system, and that was it. TechRepublic.com has a great <a title="Tech Republic article on siege" href="http://www.techrepublic.com/article/test-your-web-server-lay-siege-to-it/5171727" target="_blank">article on installing from source and using siege</a>.</p>
<p>Siege is simple to use—just give it the number of concurrent connections you want to create (-c), the length of time (-t) to run the test, and your URL, as shown:</p>
<pre class="brush: bash; title: ; notranslate">
siege -c25 -t10M  www.example.com</pre>
<p>One thing to note here is that CloudWatch basic monitoring refreshes every 5 minutes, and our auto scaling policies above require a metric to be met for 3 consecutive minutes, so we had to run siege tests for at least 6 to 10 minutes to ensure that our policies had enough time to trigger at least twice. While siege was running, we refreshed the CloudWatch tab in AWS Management Console to verify that more servers were indeed getting launched.</p>
<h4>Time-lapse showing the effect of Siege testing on auto scale</h4>
<p><img class="size-full wp-image-5572" title="AWS Auto Scaling Animation" src="http://www.cardinalpath.com/cpwp/wp-content/uploads/AutoScaleAnimation.gif" alt="AWS Auto Scaling Animation" width="600" height="300" /></p>
<ol>
<li>Two instances running prior to launching Siege</li>
<li>Siege test starts; new instances automatically launched as the scale-up policy is triggered</li>
<li>Additional instances launched to handle continued Siege test</li>
<li>No more instances needed, load is handled and stable</li>
<li>Siege test is completed</li>
<li>Shutting down an instance as bottom threshold is met</li>
<li>Two instances now terminated after scale-down policy, returns system to initial state</li>
</ol>
<h3>Making changes</h3>
<p>It should have come as no surprise that we would need to make changes to our landing page and micro-site at the last minute, right before our client’s scheduled appearance on a national TV show. To make changes to the landing page, we need to upload some new files to our EC2 instance. No big deal, right?</p>
<p>Under a normal web hosting scenario, this is no problem, but when you have an AMI defined to be the source template for an auto scaling configuration, and the entire micro-site content is baked into the AMI, it&#8217;s an issue because the moment one of our events is triggered and CloudWatch triggers our auto scaling policy to launch a new instance, it&#8217;s going to be copied from our now-stale AMI with the outdated content.</p>
<p>It’d be nice to simply create a new AMI with the changes and re-run the <em>as-create-launch-config</em> script where we define the AMI to use, however trying that gives the following error:</p>
<pre class="brush: bash; title: ; notranslate">
configuration already exists with the name sample-launch-config-name</pre>
<p>So that won’t work. Next, we thought maybe could just delete the auto scaling group, using the <em id="delete-auto-scaling-group">as-delete-auto-scaling-group</em> command, and AWS asks, “Are you sure you want to delete this AutoScalingGroup?” When we replied “Y,” we got this error:</p>
<pre class="brush: bash; title: ; notranslate">
as-delete-auto-scaling-group:  Malformed input-You cannot delete an AutoScalingGroup while there are instances still in the group.</pre>
<p>Well that&#8217;s good to know—you cannot inadvertently delete an auto scaling group while instances are running inside it. What instances <em>are</em> running inside it? You can use the <em id="describe-auto-scaling-instances">as-describe-auto-scaling-instances</em> command for that. This command is nearly identical to <em>ec2-describe-instances</em>, but instead of showing all your instances, it lists the ones running inside each autoscaling group you have configured.</p>
<p>In order to actually terminate the instances, though, we have to change the minimum number of instances allowed. Remember, when we ran the <em>as-put-scaling-policy</em> earlier, we defined minimum instances as two. If we terminate the instances in the group, AWS will just launch more to replace them to meet the minimum. So, next, we had to change the minimum number of servers in our auto scaling group to zero. This is most easily done with the <em id="update-auto-scaling-group">as-update-auto-scaling-group</em> command, as shown:</p>
<pre class="brush: bash; title: ; notranslate">
$PROMPT&gt; as-update-auto-scaling-group sample-sg-name --min-size 0
OK-Updated AutoScalingGroup</pre>
<p>Once we did that, we could terminate our instances using the <em id="terminate-instance">as-terminate-instance-in-auto-scaling-group</em> command. Finally, we could run <em>as-delete-auto-scaling-group</em> followed by <em id="delete-launch-config">as-delete-launch-config</em>.</p>
<p>Granted, this manual work to build up and tear down an auto scaling configuration is kind of a pain point, but in our case we didn&#8217;t have time to use a proper deployment script, as is normally the case for cloud deployments. On the other hand, it did force us to learn all the command line tools to reverse, undo, tear down and delete an auto scaling configuration and document them here.</p>
<h3>Auto scaling command summary</h3>
<p>To build up an auto scaling group</p>
<ol>
<li><a class="scroll_blog" title="Amazon AWS as-create-launch-config" href="#launch-config">as-create-launch-config</a></li>
<li><a class="scroll_blog" title="Amazon AWS as-create-auto-scaling-group" href="#auto-scaling-group">as-create-auto-scaling-group</a></li>
<li><a class="scroll_blog" title="Amazon AWS as-put-scaling-policy" href="#scaling-policy">as-put-scaling-policy</a> (for scaling up)</li>
<li><a class="scroll_blog" title="Amazon AWS as-put-scaling-policy" href="#scaling-policy">as-put-scaling-policy</a> (for scaling down)</li>
<li><a title="Amazon AWS as-execute-policy" href="http://docs.amazonwebservices.com/AutoScaling/latest/DeveloperGuide/scaling_plan.html#policy_running">as-execute-policy</a> (for testing the policies)</li>
<li><a class="scroll_blog" title="Amazon AWS as-update-auto-scaling-group" href="#update-auto-scaling-group">as-update-auto-scaling-group</a> (for changing policies)</li>
<li><a class="scroll_blog" title="Amazon AWS mon-put-metric-alarm" href="#metric-alarm">mon-put-metric-alarm</a> (for triggering policies)</li>
</ol>
<p>To tear down an auto scaling group</p>
<ol>
<li><a class="scroll_blog" title="Amazon AWS as-update-auto-scaling-group" href="#update-auto-scaling-group">as-update-auto-scaling-group</a> (to set a minimum of 0 instances)</li>
<li><a class="scroll_blog" title="Amazon AWS as-describe-auto-scaling-instances" href="#describe-auto-scaling-instances">as-describe-auto-scaling-instances</a> (to see the instance IDs)</li>
<li><a class="scroll_blog" title="Amazon AWS as-terminate-instance-in-auto-scaling-group" href="#terminate-instance">as-terminate-instance-in-auto-scaling-group</a> (terminate each ID)</li>
<li><a class="scroll_blog" title="Amazon AWS as-delete-auto-scaling-group" href="#delete-auto-scaling-group">as-delete-auto-scaling-group</a></li>
<li><a class="scroll_blog" title="Amazon AWS as-delete-launch-config" href="#delete-launch-config">as-delete-launch-config</a></li>
</ol>
<h4>Reference documentation</h4>
<ul>
<li><a title="AWS Developer Documentation" href="http://aws.amazon.com/documentation/">AWS Developer Documentation</a></li>
<li><a title="Getting Started with the Command Line Tools" href="http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/SettingUp_CommandLine.html?r=2389">Getting Started with the Command Line Tools</a></li>
<li><a title="Get Started with Auto Scaling" href="http://docs.amazonwebservices.com/AutoScaling/latest/GettingStartedGuide/Welcome.html?r=8402">Get Started with Auto Scaling</a></li>
<li><a title="Auto Scaling Developer Guide" href="http://docs.amazonwebservices.com/AutoScaling/latest/DeveloperGuide/Welcome.html?r=128">Auto Scaling Developer Guide</a></li>
<li><a title="Set Up the Command Line Interface" href="http://docs.amazonwebservices.com/AmazonCloudWatch/latest/GettingStartedGuide/SetupCLI.html">Set Up the Command Line Interface</a></li>
<li></li>
</ul>
<img src="http://feeds.feedburner.com/~r/seo-and-usability/~4/1kxO_PYdidI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.cardinalpath.com/autoscaling-your-website-with-amazon-web-services-part-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.cardinalpath.com/autoscaling-your-website-with-amazon-web-services-part-2/</feedburner:origLink></item>
		<item>
		<title>Top 10 Lame Excuses for Not Doing Conversion Testing</title>
		<link>http://feedproxy.google.com/~r/seo-and-usability/~3/-fJICRP8Omg/</link>
		<comments>http://www.cardinalpath.com/top-10-lame-excuses-for-not-doing-conversion-testing/#comments</comments>
		<pubDate>Thu, 24 May 2012 14:45:14 +0000</pubDate>
		<dc:creator>Michael Straker</dc:creator>
				<category><![CDATA[User Experience]]></category>
		<category><![CDATA[A/B testing]]></category>
		<category><![CDATA[conversion testing]]></category>
		<category><![CDATA[mulitvariate testing]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[user experience]]></category>
		<category><![CDATA[ux]]></category>

		<guid isPermaLink="false">http://www.cardinalpath.com/?p=5590</guid>
		<description><![CDATA[Last week we examined some popular excuses for not doing usability testing. This week, we’ll take a look at conversion testing (aka A/B and Multivariate Testing). &#160; &#160; 1. “I don’t have the budget to purchase testing software.” Visual Website &#8230; <a href="http://www.cardinalpath.com/top-10-lame-excuses-for-not-doing-conversion-testing/"></a>]]></description>
			<content:encoded><![CDATA[<p>Last week we examined some popular excuses for not doing <em>usability</em> testing. This week, we’ll take a look at <em>conversion</em> testing (aka A/B and Multivariate Testing).<br />
&nbsp;<br />
&nbsp;</p>
<h4>1.  “I don’t have the budget to purchase testing software.”</h4>
<p><a href="http://visualwebsiteoptimizer.com/" target="_blank">Visual Website Optimizer</a> starts at $49 per month. Google Website Optimizer (GWO) is free. Budget is no excuse.<br />
&nbsp;</p>
<h4>2.  “I don’t have the technical expertise to set up a test.” </h4>
<p>Though it’s true that technical implementations can get complex, that doesn’t <em>have</em> to be the case. Setting up a simple A/B test on a tool like GWO is easy and can take only minutes. So take the initial plunge with a simple A/B test. For example, test some revised headlines.<br />
&nbsp;</p>
<h4>3.  “I don’t know how to run a statistical analysis on the results.” </h4>
<p>There’s no need, as basic statistical analyses are built into all the major testing tools. Sure, you can run more sophisticated analyses on the results and learn more from the data, but you can leave that for later tests.<br />
&nbsp;</p>
<h4>4.  “I fear that running tests could lower my conversion rate.” </h4>
<p>Yes, it’s possible that a poor-performing variation could temporarily lower conversion rates. But all testing platforms allow you monitor your tests on an ongoing basis, and to either stop the test or disable poor-performing variations. Also, you can reduce risk by specifying that only a certain percentage of your traffic will take part in the test. The greater risk lies in NOT running tests.<br />
&nbsp;</p>
<h4>5.  “There’s no guarantee I’ll get a positive result.” </h4>
<p>True. But the flipside of that argument is that if you do nothing, it’s guaranteed you won’t get results. Stick with testing, and you’re bound to get positive results soon enough.<br />
&nbsp;</p>
<h4>6.  “I don’t have a UX designer to come up with the alternate variations.” </h4>
<p>Then either hire one on contract, or (as mentioned above) test on simple things like text. (Headlines, subheads, bullet points, calls to action, etc.)<br />
&nbsp;</p>
<h4>7.  “I don’t need to test, I know what works best for my customers.” </h4>
<p>Nobody gets it right every time. I’ve seen lots of test where <em>everyone’s</em> prediction was wrong and the winner is a total surprise. So never assume that your page is perfect; you might be surprised at the changes that lead to better performance.<br />
&nbsp;</p>
<h4>8.  “I prefer the simplicity of sequential testing.” </h4>
<p>Sequential testing (i.e. running one version for a while, then running a revised version and seeing if it performs better) doesn’t have the accuracy of true “Split A/B” testing. (You’ll never know whether external factors may have influenced the results.) The whole point of testing is to base decisions on data rather than hunches; data must be reliable.<br />
&nbsp;</p>
<h4>9.  “My Website doesn’t get enough traffic.” </h4>
<p>For very low traffic websites, this might actually be a valid excuse. However, testing just one variation against the original does not take all that much traffic, especially if the two versions are dramatically different. It’s not uncommon to achieve statistically significant results with a total of fewer than 1,000 visitors to the page.<br />
&nbsp;</p>
<h4>10.  “It’s too early for us.” </h4>
<p>If you have a live website with significant traffic, then it’s time to start testing. The sooner the better. New businesses can actually benefit the most from conversion testing, as they’re likely to have a less complete understanding of their customers and what makes them tick.<br />
&nbsp;</p>
<img src="http://feeds.feedburner.com/~r/seo-and-usability/~4/-fJICRP8Omg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.cardinalpath.com/top-10-lame-excuses-for-not-doing-conversion-testing/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.cardinalpath.com/top-10-lame-excuses-for-not-doing-conversion-testing/</feedburner:origLink></item>
		<item>
		<title>Autoscaling your website with Amazon Web Services – Part 1</title>
		<link>http://feedproxy.google.com/~r/seo-and-usability/~3/Gdi5Di95D-Y/</link>
		<comments>http://www.cardinalpath.com/autoscaling-your-website-with-amazon-web-services-part-1/#comments</comments>
		<pubDate>Mon, 21 May 2012 16:00:53 +0000</pubDate>
		<dc:creator>Geoffrey Hoffman</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[autoscale]]></category>
		<category><![CDATA[cloud hosting]]></category>
		<category><![CDATA[load balancer]]></category>
		<category><![CDATA[scalability]]></category>

		<guid isPermaLink="false">http://www.cardinalpath.com/?p=4753</guid>
		<description><![CDATA[You&#8217;re being featured on national TV and must be certain that your web site will handle a sudden surge in traffic. You&#8217;ve heard about instant scalability in the cloud, but haven&#8217;t made the leap to autoscale cloud deployment yet. What &#8230; <a href="http://www.cardinalpath.com/autoscaling-your-website-with-amazon-web-services-part-1/"></a>]]></description>
			<content:encoded><![CDATA[<p>You&#8217;re being featured on national TV and must be certain that your web site will handle a sudden surge in traffic. You&#8217;ve heard about instant scalability in the cloud, but haven&#8217;t made the leap to autoscale cloud deployment yet. What are you waiting for?</p>
<p><a title="Top 25 Cloud Hosting Providers - List of Cloud Hosting Companies - Feb 2012" href="http://www.clouddir.com/awards/" target="_blank">Dozens</a>, if not <a title="Autoscaling Cloud Hosting - Elastic Computing" href="https://www.google.com/search?ix=sea&amp;sourceid=chrome&amp;ie=UTF-8&amp;q=autoscaling+cloud+hosting" target="_blank">hundreds</a>, of ISPs have spawned special business units dedicated to cloud hosting, and many of them support scalability features that claim to automatically increase your server&#8217;s capacity, whenever it is needed. Sounds great, right? That&#8217;s exactly what you need!</p>
<p><strong>Be sure to read the fine print!</strong> Some of the most popular cloud-based web site hosting providers include <a title="VPS.NET Cloud Hosting, Geo Hosting, Cloud Servers and Content Delivery Network" href="http://www.vps.net" target="_blank">VPS.net</a>, <a title="Cloud Computing, Cloud Hosting &amp;amp; Online Storage by Rackspace" href="http://www.rackspacecloud.com" target="_blank">RackspaceCloud.com</a> and <a title="FireHost Secure Cloud Hosting" href="http://www.firehost.com" target="_blank">FireHost.com</a>  — <em>although many lists of the <a title="Top Cloud Hosting Companies" href="https://www.google.com/search?aq=f&amp;ix=sea&amp;sourceid=chrome&amp;ie=UTF-8&amp;q=top+cloud+hosting+companies" target="_blank">top cloud hosting providers</a> don&#8217;t even mention <a title="Amazon Web Services (AWS)" href="http://aws.amazon.com/" target="_blank">Amazon Web Services</a>! Why? </em>Cloud hosting features and options at various cloud hosts are quite different from each other, and not all cloud-based auto-scale works as you might expect it to work. Do your homework before switching from your current ISP—it can <em>really</em> pay off.</p>
<p>Case in point: We&#8217;ve recently learned that some ISPs which <em>claim to offer</em> auto-scaling server solutions actually don&#8217;t auto-scale anything at all! Instead, they&#8217;ll monitor your server, and when it reaches a peak load of, say 80% CPU utilization, they&#8217;ll actually shut off your site! Surprised? It&#8217;s true. Of course they&#8217;ll spin up a new larger instance of your app server a few seconds later to handle the load, which is how they can legally put wording such as ‘&#8230;automatically scale resources&#8230;’ on their sign up pages, but what about those critical moments of down time, right when you need it most?</p>
<p>Still other cloud hosts will automatically scale up your web server during a traffic spike, which is great, but they don&#8217;t notify you, and they also don&#8217;t automatically scale it back down when the traffic dissipates, leaving you with a bigger-than-expected bill at the end of the month and hours of wasted time on a support ticket thread to sort out billing confusion. Again, read the fine print, check for reviews online, and chat or email their sales team with every question you can think of before selecting any hosting provider.</p>
<h3>Auto-Scaling Requires Preparation</h3>
<p>In preparation for a recent television airing, we helped one of our clients deploy a microsite on a load-balanced, auto-scaling cluster of web servers using Amazon Web Services. AWS offers a true auto-scale solution that is capable of delivering your site flawlessly with zero downtime, yes, that&#8217;s 100% uptime, and fast response times—even during short periods of huge traffic bursts. Better yet, they provide these tools at incredibly affordable rates that <a title="Amazon Lowers EC2 Pricing... Again!" href="http://aws.typepad.com/aws/2012/03/dropping-prices-again-ec2-rds-emr-and-elasticache.html" target="_blank">keep getting lower</a> all the time.</p>
<p>Sounds great, right? Using our guide below, you&#8217;ll be autoscaling in no time.</p>
<h2>Part 1: Creating your EC2 Instance Template</h2>
<p>In this first section, we&#8217;re going to create an EC2 instance to run our web application, upload our content to it, and create an AMI, or Amazon Machine Image. From this template, we can clone additional web servers to build our autoscale cluster.</p>
<h3>Create an Amazon.com account</h3>
<p>It may seem obvious, but the first step in using Amazon Web Services is to create an account on Amazon.com. If you&#8217;ve bought a book or own a Kindle,  you most likely already have one, and if so, you&#8217;re half done with this step. Your Amazon.com account links you to all of AWS. Just click over to Amazon, login, and redirect your browser to <a title="Login to Amazon Web Services" href="http://aws.amazon.com" target="_blank">aws.amazon.com</a>, accept the prompts, enter your credit card and so on. Note that you pay nothing until you actually start utilizing services. Furthermore, you don&#8217;t need to worry about accidentally spinning up some expensive server: with Amazon&#8217;s Free Tier usage plan, the first 750 hours of compute time, per month, every month, are 100% free.</p>
<h3>Obtain x.509 credentials and API key</h3>
<p>To use the AWS command line tools, first you&#8217;ll need to obtain your AWS ID keys, the necessary security credentials needed to connect and manage the services in your account from the command line. Visit the <a title="Amazon AWS Security Credentials" href="https://aws-portal.amazon.com/gp/aws/securityCredentials" target="_blank">Amazon AWS Security Credentials</a> for more in depth information.</p>
<p>Generate your access keys:</p>
<ol>
<li><strong>Login</strong> to your <a title="Login to your AWS Management Console" href="http://aws.amazon.com" target="_blank">AWS Management Console</a></li>
<li>Hover over “My Account/Console” link on the top right of your screen and select the “Security Credentials” option</li>
<li>Scroll down and select the “X.509 certificates” tab</li>
<li>Click on the “Create a new Certificate” link.<img class="alignnone size-full wp-image-5329" title="x509_certificate" src="http://www.cardinalpath.com/cpwp/wp-content/uploads/x509_certificate.png" alt="x509 Certificate Created window" width="485" height="557" /></li>
<li>
<aside class="client_info backing">What is PEM?PEM (Privacy Enhanced Mail) is a protocol originally developed to secure email. Although rarely deployed for its indented purpose, it’s encoding mechanism for generating certificates is used for quite a few web services including Amazon EC2, PayPal Web Payments Pro and SSH Key Pairs.You can learn more about <a title="Privacy Enhanced Mail" href="http://en.wikipedia.org/wiki/Privacy-enhanced_Electronic_Mail">PEM</a> and it&#8217;s <a title="MIME Base64 within the Privacy-enhanced mail protocol" href="http://en.wikipedia.org/wiki/Base64#Privacy-enhanced_mail">Base64 origin</a>. </aside>
<p>Amazon will generate two files:</p>
<ul>
<li>A PEM encoded RSA private key named something like pk-xxxxxxx.pem &#8211; <strong>you must download this Private Key before navigating away from the page</strong></li>
<li>A PEM encoded X.509 certificate named something like cert-xxxxxxx.pem</li>
</ul>
</li>
<li>Download both PEM encoded files</li>
<li>Download the <a title="Amazon EC2 API Tools" href="http://aws.amazon.com/developertools/351">Amazon EC2 API Tools</a></li>
<li>Create a &#8220;.aws&#8221; folder in your home directory</li>
<li>Copy the certificate and RSA private key into your ~/.aws directory</li>
<li>Unzip the Amazon EC2 Command-Line Tools, look in the new directory and move both the bin and lib directory into your ~/.aws directory. This directory should now have the following:
<ul>
<li>The cert-xxxxxxx.pem file</li>
<li>The pk-xxxxxxx.pem file</li>
<li>The bin directory</li>
<li>The lib directory</li>
</ul>
</li>
</ol>
<h3>Install the tools</h3>
<p>Most of the following tasks can be performed using the <a title="AWS Management Console" href="http://aws.amazon.com/console/" target="_blank">AWS Management Console</a>, Amazon&#8217;s online, web-based interface to create, configure and deploy server instances on the Elastic Compute Cloud (EC2). Only a few steps require the command line tools. Download each of the tools, extract their contents, and create the following folder structure by copying each tools into these corresponding folders:</p>
<ul>
<li><a title="Amazon EC2 API Tools" href="http://aws.amazon.com/developertools/351" target="_blank">Amazon EC2 API Tools</a> → ~/.aws/ec2/*</li>
<li><a title="Auto Scaling Command Line Tool" href="http://aws.amazon.com/developertools/2535" target="_blank">Auto Scaling Command Line Tool</a> → ~/.aws/as/*</li>
<li><a title="CloudWatch Command Line Tool" href="http://aws.amazon.com/developertools/2534" target="_blank">CloudWatch Command Line Tool</a> → ~/.aws/cw/*</li>
<li><a title="Amazon AWS AMI Tools" href="http://aws.amazon.com/developertools/368" target="_blank">AMI Tools</a> → ~/.aws/ami/* &#8212; <em>not covered in this article, but may want to download for future use</em></li>
</ul>
<h3>Setup paths for Amazon EC2 Command-Line Tools</h3>
<p>Edit your .bash_profile to setup the corresponding paths</p>
<pre class="brush: bash; title: ; notranslate">
export EC2_HOME=~/.aws/ec2
export EC2_PRIVATE_KEY=`ls ~/.aws/pk-*.pem`
export EC2_CERT=`ls ~/.aws/cert-*.pem`
export AWS_AUTO_SCALING_HOME=~/.aws/as
export AWS_CLOUDWATCH_HOME=~/.aws/cw
export AWS_AMITOOLS_HOME=~/.aws/ami
export AWS_CREDENTIAL_FILE=~/.aws/credentialsfilepath.txt
export PATH=$PATH:$EC2_HOME/bin:$AWS_AUTO_SCALING_HOME/bin:$AWS_CLOUDWATCH_HOME/bin:$AWS_AMITOOLS_HOME/bin</pre>
<h3>Launching EC2 Instances</h3>
<p>If you have some knowledge of Linux system administration, you won&#8217;t believe how quick it is to set up your Web site on EC2. Thousands of Amazon Machine Images (AMIs) are available, in practically every flavor of OS you can imagine. Nearly all of them come with a variety of pre-installed software besides the OS, including many with Apache, PHP and MySQL. For a more detailed, step-by-step guide to this process, follow this <a title="Official Guide to using Amazon EC2." href="http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/using.html" target="_blank">Official Guide to using Amazon EC2</a>. In a nutshell, here&#8217;s the process.</p>
<p>From the AWS Management Console:</p>
<ol>
<li><strong>Login</strong> to your <a title="Login to your AWS Management Console" href="http://aws.amazon.com" target="_blank">AWS Management Console</a></li>
<li>Click the <strong>EC2</strong> tab<br />
<img class="alignnone size-full wp-image-4713" title="EC2 at AWS" src="http://www.cardinalpath.com/cpwp/wp-content/uploads/Screen-shot-2012-03-08-at-9.16.49-PM.jpg" alt="EC2 menu tab selection" width="457" height="135" /></li>
<li>Click the Launch Instance button<br />
<img class="alignnone size-full wp-image-4716" title="Launch an EC2 instance with Amazon AWS" src="http://www.cardinalpath.com/cpwp/wp-content/uploads/Screen-shot-2012-03-08-at-9.17.35-PM.jpg" alt="Launch an EC2 instance popup" width="279" height="181" /></li>
<li>If this is your first time, choose the <strong>Classic Wizard</strong> and click <strong>Continue</strong>. This option will let you see and set every option, about 7 steps.<br />
<img class="alignnone size-full wp-image-4715" title="AWS EC2 Classic Wizard" src="http://www.cardinalpath.com/cpwp/wp-content/uploads/Screen-shot-2012-03-08-at-9.26.11-PM.jpg" alt="EC2 Classic Wizard selection" width="283" height="98" /></li>
<li><strong>Choose your distro.</strong> Under the Quick Start tab, you can instantly see the option for RedHat, SUSE and Ubuntu. If you&#8217;re comfortable configuring Apache, PHP and MySQL by hand, these are stock OSes with no fluff. For an even faster setup time, if you&#8217;re going to be running WordPress, Magento or another popular framework, search for it under Community AMIs—chances are someone has already preconfigured it with a LAMP stack ready to go. We chose the <a title="Bitnami WordPress Cloud Image" href="http://bitnami.org/stack/wordpress#cloudImage" target="_blank">Bitnami WordPress stack</a>.<br />
<img class="alignnone size-medium wp-image-4717" title="Launching an AWS Bitnami LAMP WordPress Stack" src="http://www.cardinalpath.com/cpwp/wp-content/uploads/Screen-shot-2012-03-08-at-9.37.33-PM-550x240.jpg" alt="AWS Bitnami LAMP WordPress Stack selection" width="550" height="240" /><br />
We also chose an ebs-backed, 32-bit AMI so we can use it with Amazon&#8217;s t1.micro instance, the least expensive instance type. You can always restart this small instance as a larger instance size later. Click <strong>Select</strong> on the row that has the AMI you want to launch.</li>
<li> Launch <strong>1</strong> instance of a <strong>t1.micro</strong>. Don&#8217;t worry about which <strong>Availability Zone</strong> for now, just pick one and use the same one you choose here in later steps. Click <strong>Continue</strong>.<br />
<img class="alignnone size-full wp-image-4718" title="Launch 1 instance of type t1.micro" src="http://www.cardinalpath.com/cpwp/wp-content/uploads/Screen-shot-2012-03-08-at-9.48.00-PM.jpg" alt="Launch an instance of AWS t1.micro" width="530" height="176" /></li>
<li>You can leave all the defaults on the <strong>Advanced Instance Options</strong> screen. Just click <strong>Continue</strong>.</li>
<li>On the next screen, <strong>Keys</strong>, you&#8217;re asked if you want to tag the server instance with any key value pairs. These are not security keys, and no keys are required. These <em>keys are just tags</em> to help sort and identify your servers quickly when you have lots of them running. If this were a web server only or a database server only, for example, you could add a key named <em>type</em> with a value of <em>webserver</em> or <em>database</em> respectively. Click <strong>Continue</strong>.</li>
<li>On the next screen, I&#8217;d recommend that you <strong>create a new key-pair and download it</strong> to your ~/.aws/* folder, unless you have already created and downloaded another one, which will be listed and preselected under existing key pairs. <em>If you&#8217;re going to be hosting multiple clients in your AWS account, create and use a unique key pair for each client.</em> This key may just a text file with a .pem extension, but it&#8217;s very important! <strong>Don&#8217;t lose it!</strong>You will likely need to update your file permissions, otherwise you&#8217;ll receive a &#8220;Permissions 0644 are too open&#8221; when you try to ssh.
<pre class="brush: bash; title: ; notranslate">
$PROMPT&gt; chmod 0600 clientname-key.pem</pre>
<p>After downloading the key, click <strong>Continue</strong>.<br />
<img class="alignnone size-medium wp-image-4719" title="Create a new Key Pair for connecting to your EC2 instance" src="http://www.cardinalpath.com/cpwp/wp-content/uploads/Screen-shot-2012-03-08-at-10.03.56-PM-550x190.jpg" alt="Create a new Security Key Pair" width="550" height="190" /></li>
<li>On the <strong>Configure Firewall</strong> screen, you have to configure a <strong id="security_group">Security Group</strong>. This is your firewall. You&#8217;ll want to be sure to open the port for HTTP (80) and SSH (22).<br />
<img class="alignnone size-full wp-image-4720" title="Creating a Security Group for your AWS EC2 instances" src="http://www.cardinalpath.com/cpwp/wp-content/uploads/Screen-shot-2012-03-08-at-10.07.28-PM.jpg" alt="Create a Security Group" width="394" height="284" /><br />
You don&#8217;t need any other ports open unless you plan to use other services. Common services are listed, and the default port numbers are automatically opened. The Source field default of 0.0.0.0/o means to allow all IPs and subnets on the entire Internet access to these ports. If you&#8217;re really careful with security, the SSH port is a good one to close down. To do this, enter your firewall IP address followed by “/0”. This way, the only way you can access the server instance via shell is from your office or home computer. No other computer on the net will be able to SSH into your server.<br />
<img class="alignnone size-full wp-image-4721" title="SSH and HTTP are the most common ports to open in your AWS Security Group" src="http://www.cardinalpath.com/cpwp/wp-content/uploads/Screen-shot-2012-03-08-at-10.08.18-PM.jpg" alt="TCP port highlighting" width="298" height="119" /></li>
<li>The final screen just shows you a summary. <strong>Click Launch</strong> and your server will be online in about one minute!</li>
</ol>
<p>Now that you have an idea of all the configuration options for an EC2 instance from using the online management console, it&#8217;s worth noting that you can perform the exact same procedure as show above from the command line by using the ec2-launch-instances command:</p>
<pre class="brush: bash; title: ; notranslate">
$PROMPT&gt; ec2-run-instances ami-2f2afb46 -k clientname-key</pre>
<p>There are a plethora of additional command line tools that allow you to create key pairs, search for AMIs and perform all the other steps of the process described visually above.</p>
<h3>Connecting to your instance</h3>
<p>Your EC2 instance is starting. When will it be up and running so you can connect to it?</p>
<ol>
<li>Click the <strong>Instances</strong> link in the left column<br />
<img title="AWS EC2 Instances" src="http://www.cardinalpath.com/cpwp/wp-content/uploads/Screen-shot-2012-03-08-at-9.17.05-PM.jpg" alt="EC2 Instances menu selection" width="161" height="124" /></li>
<li>Click the <strong>Refresh</strong> button in the upper right corner of the instance list periodically until your instance Status says <strong>Running</strong>.</li>
<li><strong>Check the checkbox</strong> in the left hand column of the instances list, and then <strong>expand the lower pane</strong> showing your <em>1 EC2 Instance selected</em> details by dragging the horizontal divider upwards.</li>
<li>In the instance details panel, you&#8217;ll see a line like this:<br />
<strong><img class="alignleft left" src="https://d1ge0kk1l5kms0.cloudfront.net/images/G/01/webservices/console/ec2/instance-sm.gif" alt="EC2 Instance sample" width="18" height="20" /> EC2 Instance: i-2afd6f5c ec2-10-20-30-40.compute-1.amazonaws.com</strong></li>
<li>The first blob, <em>i-2afd6f5c</em>, is this specific Instance&#8217;s unique ID. The next blob, <em>ec2-10-20-30-40.compute-1.amazonaws.com</em>, shows you the instance&#8217;s public DNS name. Note also that the four numbers are the instance&#8217;s public IP address.</li>
<li>Launch a terminal and issue the following command:</li>
</ol>
<pre class="brush: bash; title: ; notranslate">
$PROMPT&gt; ssh -i ~/.aws/clientname-key.pem username@ec2-10-20-30-40.compute-1.amazonaws.com</pre>
<p>Note that <em>username</em> is most often “root” but other distros or AMIs may require a different username. Check with the creator of the AMI for community AMIs. <em>If you see a message about an RSA key fingerprint, just type “Yes” at the prompt and press enter. This is a one-time message.</em></p>
<p>You should now be connected, and viewing your server instance&#8217;s welcome message with a command line prompt.</p>
<h3>Setup Elastic IP</h3>
<p>At this point you can now navigate to your instance&#8217;s URL, something like <strong>ec2-10-20-30-40.compute-1.amazonaws.com</strong> and you&#8217;ll see the initial welcome screen of your EC2 instance. While you can continue to use Amazon&#8217;s auto-generated DNS name of your server moving forward, we usually upgrade to a static (reassignable) IP to make things simpler for VirtualHost definition and SSH access. Elastic IP addresses are static IP addresses designed for dynamic cloud computing. An Elastic IP address is associated with your account, not a particular instance, and you control that address until you choose to explicitly release it.</p>
<ol>
<li>Click the <strong>Elastic IPs</strong> link in the left column under Network &amp; Security <img class="alignnone size-full wp-image-5330" title="Elastic IP" src="http://www.cardinalpath.com/cpwp/wp-content/uploads/Elastic-IP.jpg" alt="Elastic IP menu selection" width="170" height="144" /></li>
<li>Click the <strong>Allocate New Address</strong> button to assign a static IP address to your account <em>(Note: an Elastic IP address is associated with an account and billed accordingly until the address is released)</em> <img class="alignnone size-full wp-image-5331" title="Allocate New Address" src="http://www.cardinalpath.com/cpwp/wp-content/uploads/Allocate-New-Address.jpg" alt="Allocate New Address popup" width="305" height="184" /></li>
<li>After checking the box of the Elastic IP you want associated, select the <strong>Associate Address</strong> button which will allow you to associate that Elastic IP Address to a running instance <img class="alignnone size-full wp-image-5332" title="Associate Address" src="http://www.cardinalpath.com/cpwp/wp-content/uploads/Associate-Address.jpg" alt="Associate Address with IP example" width="632" height="112" /></li>
</ol>
<p>If you&#8217;ve gotten this far, you should now be able to point your local hosts file to the IP address of your EC2 instance, launch a browser and check to see that your site is working as expected.</p>
<h3>Upload your content</h3>
<p>Congratulations! You&#8217;re now connected to your cloud instance at Amazon AWS. What next? If you created a server instance based on a default image of Red Hat or Ubuntu, the next step is to install and configure your LAMP stack. If you&#8217;re not root, sudo su and you should be good to go with apt-get, dpkg or yum as you&#8217;re used to. Your EC2 instance is indistinguishable from a dedicated server.</p>
<p>As you install software, test it and determine it to be working as expected, we recommend that you save your server image to an AMI, also called a snapshot, from the management console, after each step.</p>
<p>An AMI is an Amazon Machine Image, which is basically a copy of your entire server at the moment in time you request the snapshot to be created. Having this snapshot available at any time in the future will save you from having to reconfigure things over again, should your instance unexpectedly terminate (this has never happened to me, but it&#8217;s a good practice anyhow).</p>
<p>For our server instance, we used a Bitnami WordPress stack, so we can skip some software installation steps here—our Bitnami AMI comes with Apache, PHP, MySQL, phpMyAdmin and WordPress already installed and configured. Examples like this are one of the many time-saving features that make Amazon AWS great.</p>
<h3 id="ami">Create your own AMI (Amazon Machine Image)</h3>
<p>Once you have your site or landing page running and tested from an EC2 instance, you then save a snapshot of the entire cloud server to your own private AMI.</p>
<p><img class="alignnone size-full wp-image-4736" title="How to create a Private AMI with the AWS Management Console" src="http://www.cardinalpath.com/cpwp/wp-content/uploads/Screen-shot-2012-03-09-at-12.03.41-AM.jpg" alt="Create Image (EBS AMI)" width="353" height="197" /></p>
<p>Amazon&#8217;s giant library of <em>community AMIs</em> consist of user-contributed server templates created this same way by users just like you. Creating a <em>private AMI</em> periodically while you experiment with AWS is not only useful as a backup strategy, these AMIs also serve as future server templates, available only to you, from which to spawn additional server instances. When developing your server, be sure to name AMIs with a number at the end, e.g. LAMP-01, LAMP-02, etc. You can always go back later and delete previous AMIs. Good naming conventions become even more critical when building an auto-scaling cluster, as we&#8217;ll discuss a little later.</p>
<p>Your server will go down for a minute while the AMI snapshot is created, but sit tight, it comes back up automatically. Once your AMI snapshot is ready, you can use it to spawn one, two, three, ten, fifty, or even more instances in record time.</p>
<h3>Create Database, MySQL User and Password</h3>
<p>Here&#8217;s an example command line session that shows how to run MySQL and create your database, then create the username and password with a GRANT statement.</p>
<pre class="brush: bash; title: ; notranslate">
$PROMPT&gt; mysql -u root -p
mysql&gt; create database sitedb;
mysql&gt; GRANT SELECT, INSERT, UPDATE, DELETE ON sitedb.* TO
'siteuser'@'localhost' IDENTIFIED BY 'siteuserpassword';
mysql&gt; exit</pre>
<h3>Transfer your site files to your EC2 Instance</h3>
<p>You may have noticed above that we didn&#8217;t open the port for FTP when we set up our <a class="scroll_blog" href="#security_group">Security Group</a>. It&#8217;s more secure to use SFTP (file transfer protocol over SSH), or even simpler: <code>scp</code>— the Secure Copy command line utility.</p>
<p>To use scp to upload files to your EC2 instance, first let&#8217;s create a single backup of our site. In a new terminal <strong>on your local machine</strong>, export the site contents from your SVN or Git repository, or download all the files from your current host. Next, use Tar and GZip to bundle the site files using the following command as shown:</p>
<pre class="brush: bash; title: ; notranslate">
$PROMPT&gt; tar -czvf sitefiles.tgz /path/to/site/files</pre>
<p>After that finishes, we can send the .tgz file you created to your server instance using the scp command. Note the use of the -i flag to provide the SSH key you created on step 9 above:</p>
<pre class="brush: bash; title: ; notranslate">
$PROMPT&gt; scp -i ~/.aws/clientname-key.pem sitefiles.tgz \
username@ec2-10-20-30-40.compute-1.amazonaws.com</pre>
<p>Once your .tgz is uploaded to the server, switch back over to your terminal still connected to your EC2 instance and unstuff it like so:</p>
<pre class="brush: bash; title: ; notranslate">
$PROMPT&gt; tar -xvf sitefiles.tgz</pre>
<p>Then, move the sitefiles into the htdocs or www directory. The location of this directory is different on various systems.</p>
<pre class="brush: bash; title: ; notranslate">
$PROMPT&gt; sudo mv sitefiles/* /opt/bitnami/apache2/htdocs/</pre>
<p>You might need to set the owner and permissions using something like:</p>
<pre class="brush: bash; title: ; notranslate">
$PROMPT&gt; sudo chown bitnami:daemon /opt/bitnami/apache2/htdocs</pre>
<p><strong>You are done!</strong> &#8230;<br />
Well, half done. Ok, we did say at the beginning that this was Part 1 right? Currently your EC2 Instance is setup and running, just as your website would be hosted anywhere else.	 </p>
<p><strong>Coming up in <a href="http://www.cardinalpath.com/autoscaling-your-website-with-amazon-web-services-part-2/" title="Auto scaling your website with Amazon Web Services (AWS) – Part 2">Part 2</a></strong>, we&#8217;ll show you how we used CloudWatch, AutoScale Events and an Elastic Load Balancer to turn this single EC2 instance into a an <em>intelligent, auto-scaling web server farm</em>—all using AWS.</p>
<img src="http://feeds.feedburner.com/~r/seo-and-usability/~4/Gdi5Di95D-Y" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.cardinalpath.com/autoscaling-your-website-with-amazon-web-services-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.cardinalpath.com/autoscaling-your-website-with-amazon-web-services-part-1/</feedburner:origLink></item>
	</channel>
</rss>

