<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>The Official Rackspace Blog &#187; Philip Thomas</title>
	<atom:link href="http://www.rackspace.com/blog/author/philip-thomas/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rackspace.com/blog</link>
	<description>The Official Rackspace Blog</description>
	<lastBuildDate>Mon, 20 May 2013 20:30:13 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Supercharge HTML5 Video With Rackspace Cloud Files</title>
		<link>http://www.rackspace.com/blog/supercharge-html5-video-with-rackspace-cloud-files/</link>
		<comments>http://www.rackspace.com/blog/supercharge-html5-video-with-rackspace-cloud-files/#comments</comments>
		<pubDate>Thu, 07 Feb 2013 21:30:53 +0000</pubDate>
		<dc:creator>Philip Thomas</dc:creator>
				<category><![CDATA[Cloud Industry Topics]]></category>
		<category><![CDATA[Product Announcements and Updates]]></category>
		<category><![CDATA[Product Discussion]]></category>
		<category><![CDATA[Akamai]]></category>
		<category><![CDATA[CDN]]></category>
		<category><![CDATA[Cloud Files]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Rackspace Media Hosting]]></category>

		<guid isPermaLink="false">http://www.rackspace.com/blog/?p=26533</guid>
		<description><![CDATA[The ease of implementation, sleek professionalism and cross-browser compatibility makes HTML5 the modern alternative to Flash-based videos. Today we will explore embedding a Rackspace Cloud Files-hosted recording using the new HTML5 video standard.]]></description>
				<content:encoded><![CDATA[<p><i>This post explores embedding a Rackspace Cloud Files-hosted video using the new HTML5 standard, like this:</i><br />
<video width="356" height="200" controls poster="http://0639ac876cdeb83a534d-95c931daa7c80b903aae4215b472f9f8.r4.cf1.rackcdn.com/Snowball.png"  ><br />
<source src="http://0639ac876cdeb83a534d-95c931daa7c80b903aae4215b472f9f8.r4.cf1.rackcdn.com/Snowball.mp4" type="video/mp4" /><br />
<source src="http://0639ac876cdeb83a534d-95c931daa7c80b903aae4215b472f9f8.r4.cf1.rackcdn.com/Snowball.ogv" type="video/ogg" /><br />
<source src="http://0639ac876cdeb83a534d-95c931daa7c80b903aae4215b472f9f8.r4.cf1.rackcdn.com/Snowball.mp4" type="video/webm" /><br />
<em>Sorry, your browser doesn&#8217;t support HTML5 video.</em><br />
</video></p>
<h2><b>Background</b></h2>
<p>In a prior post, <a href="http://www.rackspace.com/blog/scaling-html5-audio-with-rackspace-cloud-files/">I detailed the HTML5 audio standard</a>, which is useful for embedding songs and podcasts directly into websites. Today we take the HTML5 standard a step further by showing its use in embedding videos. The ease of implementation, sleek professionalism and cross-browser compatibility makes HTML5 the modern alternative to Flash-based videos. By hosting videos yourself, you can avoid ads, third-party branding and size limitations.</p>
<p>The huge size of video files makes them cumbersome to stream, and no user likes to wait as their video lags during playback. Fortunately, <a href="http://www.rackspace.com/cloud/files/">Rackspace Cloud Files</a> runs on technology designed for one purpose: stable and speedy delivery of large media like videos. Here, we explore supercharging HTML5 videos with Rackspace Cloud Files.</p>
<p><b>HTML5 Video </b></p>
<p>Historically, video has been embedded using Flash, and most hosting has been on large social sharing sites like <a href="http://youtube.com">YouTube</a> and <a href="http://vimeo.com">Vimeo</a>. Relative to Flash, HTML5 video requires few lines of code. In addition, modern browsers natively support HTML5, whereas Flash normally requires a plugin. This extends to smartphones and tablets, where HTML5 videos play without any tweaking, yet Flash is rarely supported at all. <i>(Try it &#8211; play the videos on this page on your smartphone and tablet!)</i></p>
<p>Note, though, that HTML5 video does not provide content protection &#8211; users may download the source video files without hindrance, whereas websites like YouTube use Flash because it prevents end users from being able to easily download the source video. Keep this in mind if you are hosting copyrighted content.</p>
<p><b>The Rackspace Cloud Files Advantage</b></p>
<p>Video files are huge. In fact, video consumes about half of all bandwidth in the US, according to <a href="http://arstechnica.com/business/2012/05/bandwidth-explosion-as-internet-use-soars-can-bottlenecks-be-averted/">Ars Technica</a>. Traditional file servers do not handle the requirements of video well because of the high bandwidth and large file sizes. Worse, when a site is under load, video can hog so much of the server resources that the main website slows to a halt.</p>
<p>It was for this reason that <a href="http://en.wikipedia.org/wiki/Content_delivery_network">content delivery networks</a> (CDNs) came to prominence. Every day, large corporations use distributed global networks to silently deliver your videos, applications and songs. The Akamai-powered Rackspace Cloud Files network makes this technology accessible for businesses of any size, and flat bandwidth-based pricing makes it affordable.</p>
<p>The advantage comes with the scalability of Rackspace Cloud Files &#8211; it copies your video files to servers around the world, and whether you serve dozens or thousands of users, the network&#8217;s technology silently scales to keep quick load times.</p>
<h2><b>Implementation</b></h2>
<p><b>Preparing The Files</b></p>
<p>As with HTML5 audio, while the HTML5 video standard is made to work easily, unfortunately no single video format is supported across all web browsers. <a href="http://en.wikipedia.org/wiki/HTML5_video#Browser_support">As this Wikipedia table shows,</a> there are three main formats used on the web. The reason for multiple formats is that the incumbent H.264 codec is covered by a patent, and some wish to use only open-source codecs to avoid licensing issues.</p>
<p>From a practical standpoint, the supported codecs by each browser continue to change, so for stability and long-term compatibility, it is best to provide a video in <b>all three formats</b> &#8211; H.264, Ogg Theora and WebM. In addition, note that the patents covering the H.264 codec allow free use of the format only when videos are available for free to the end user (<a href="http://en.wikipedia.org/wiki/H.264/MPEG-4_AVC#Patent_licensing">source</a>). If you intend to charge for access to videos, I advise conducting your own due diligence on licensing.</p>
<p>For this example, I am using a video of my dog chasing snowballs:</p>
<ul>
<li><a href="http://0639ac876cdeb83a534d-95c931daa7c80b903aae4215b472f9f8.r4.cf1.rackcdn.com/Snowball.mp4">Snowball.mp4</a> (H.264)</li>
<li><a href="http://0639ac876cdeb83a534d-95c931daa7c80b903aae4215b472f9f8.r4.cf1.rackcdn.com/Snowball.ogv">Snowball.ogv</a> (Ogg Theora)</li>
<li><a href="http://0639ac876cdeb83a534d-95c931daa7c80b903aae4215b472f9f8.r4.cf1.rackcdn.com/Snowball.webm">Snowball.webm</a> (WebM)</li>
</ul>
<p>The main difficulty for me was converting the videos to the necessary formats. Even with a professional video editing suite, I had difficulty. I found that the easiest way on Mac computers to convert videos was with the <a href="https://itunes.apple.com/us/app/miro-video-converter-mvc/id412699210?mt=12">Miro Video Converter</a>, which is available for free in the Mac App Store. Alternatives for Windows and Linux are also available.</p>
<p><b>Uploading To Rackspace Cloud Files</b></p>
<p>On the <a href="https://mycloud.rackspace.com/">Rackspace Cloud Control Panel</a>, first choose an existing container or create a new container to host your content. Upload the three video files and publish them in the container. Click the sprocket next to each file and then select &#8220;View All Links.&#8221; Copy the <b>HTTP</b> links for the video files.</p>
<p>Alternatively, the open-source and free <a href="http://cyberduck.ch/">Cyberduck</a> software, which is available for both Mac and Windows, makes it easier to upload multiple files. If you manage Rackspace file containers often, Cyberduck makes it quicker to manage these files.</p>
<h2><b>Embedding</b></h2>
<p><video width="356" height="200" controls poster="http://0639ac876cdeb83a534d-95c931daa7c80b903aae4215b472f9f8.r4.cf1.rackcdn.com/Snowball.png"  ><br />
<source src="http://0639ac876cdeb83a534d-95c931daa7c80b903aae4215b472f9f8.r4.cf1.rackcdn.com/Snowball.mp4" type="video/mp4" /><br />
<source src="http://0639ac876cdeb83a534d-95c931daa7c80b903aae4215b472f9f8.r4.cf1.rackcdn.com/Snowball.ogv" type="video/ogg" /><br />
<source src="http://0639ac876cdeb83a534d-95c931daa7c80b903aae4215b472f9f8.r4.cf1.rackcdn.com/Snowball.mp4" type="video/webm" /><br />
<em>Sorry, your browser doesn&#8217;t support HTML5 video.</em><br />
</video><br />
The basic HTML5 video player above uses this code:</p>
<pre>&lt;video width="356" height="200" controls poster="http://0639ac876cdeb83a534d-95c931daa7c80b903aae4215b472f9f8.r4.cf1.rackcdn.com/Snowball.png"  &gt;
&lt;source src="http://0639ac876cdeb83a534d-95c931daa7c80b903aae4215b472f9f8.r4.cf1.rackcdn.com/Snowball.mp4" type="video/mp4" /&gt;
&lt;source src="http://0639ac876cdeb83a534d-95c931daa7c80b903aae4215b472f9f8.r4.cf1.rackcdn.com/Snowball.ogv" type="video/ogg" /&gt;
&lt;source src="http://0639ac876cdeb83a534d-95c931daa7c80b903aae4215b472f9f8.r4.cf1.rackcdn.com/Snowball.mp4" type="video/webm" /&gt;
&lt;em&gt;Sorry, your browser doesn't support HTML5 video.&lt;/em&gt;
&lt;/video&gt;</pre>
<p>You may copy the code into your website, replacing the file links with your own Rackspace Cloud Files URLs. Also, note that the file names are case sensitive!</p>
<p>Let&#8217;s walk through the various parts of the code and explain what they do:</p>
<ul>
<li><b>&lt;video&gt;:</b> The video tag initializes the HTML5 video player.
<ul>
<li><i>Controls</i> in the opening tag tells the browser to show controls (like play, pause and full screen) for the video.</li>
<li>The <i>poster</i> attribute controls which picture to show when the video is not playing. If you do not specify a poster, the browser will show a frame from the video. The poster is optional, but adds a degree of professionalism, and allows you to show a logo or title before the user clicks &#8220;play.&#8221; Using Rackspace Cloud Files to host the photo will provide a speed increase, but you may wish to use a native media browser (such as that in WordPress) instead to host the video.</li>
<li><i>Width</i> and <i>height</i> control the dimensions of the video player, in pixels. This does not have to match the video file precisely, but it should match the dimensions of the poster image in order for it to display correctly.</li>
</ul>
</li>
</ul>
<p>In the opening tag, other useful attributes include:</p>
<ul>
<ul>
<li><i>Autoplay:</i> Plays the video as soon as the page loads.</li>
<li><i>Preload:</i> Begins loading the video file as soon as the page loads, rather than when the play button is clicked. This means that the page loads more slowly, but the file is immediately available when the user is ready to play it.</li>
<li><i>Loop:</i> Continuously replays the video file until it is paused.</li>
<li><i>Muted:</i> Disables audio during playback.</li>
</ul>
<li><b>&lt;source&gt;:</b> These lines declare different source files and their formats. If there is only one format and source video, it may be declared with a <i>src</i> in the opening video tag. Due to compatibility reasons, the <i>src</i> attribute is rarely used in the opening tag.</li>
<li><b>Incompatibility:</b> The text between the <i>video</i> tags is displayed only if the browser does not support HTML5. Here, I display a simple message that the browser is incompatible. To see what it looks like, try using <a href="http://browsershots.org">Browser Shots</a> on this page or your website, it can show you how an older website displays HTML5 audio content. It is possible to embed JavaScript or Flash between the video tags as a fall-back player for older browsers.</li>
</ul>
<h2><b>Conclusion</b></h2>
<p>If you have any questions, please post them in the comment section below. Other good HTML5 Video resources include:</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/HTML5_video">HTML5 Video (Wikipedia)</a></li>
<li><a href="http://videojs.com/">Video.js Open-Source Project</a></li>
</ul>
<p><i>For more information on high performance media that’s fast, simple and reliable, be sure to check out the new Rackspace Media Hosting on the Cloud website at: <a href="http://www.rackspace.com/cloud/media/">http://www.rackspace.com/cloud/media/</a>.</i></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rackspace.com/blog/supercharge-html5-video-with-rackspace-cloud-files/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
<enclosure url="http://0639ac876cdeb83a534d-95c931daa7c80b903aae4215b472f9f8.r4.cf1.rackcdn.com/Snowball.mp4" length="742921" type="video/mp4" />
<enclosure url="http://0639ac876cdeb83a534d-95c931daa7c80b903aae4215b472f9f8.r4.cf1.rackcdn.com/Snowball.ogv" length="817221" type="video/ogg" />
		</item>
		<item>
		<title>Scaling HTML5 Audio With Rackspace Cloud Files</title>
		<link>http://www.rackspace.com/blog/scaling-html5-audio-with-rackspace-cloud-files/</link>
		<comments>http://www.rackspace.com/blog/scaling-html5-audio-with-rackspace-cloud-files/#comments</comments>
		<pubDate>Wed, 06 Feb 2013 21:30:50 +0000</pubDate>
		<dc:creator>Philip Thomas</dc:creator>
				<category><![CDATA[Cloud Industry Topics]]></category>
		<category><![CDATA[Product Announcements and Updates]]></category>
		<category><![CDATA[Product Discussion]]></category>
		<category><![CDATA[Akamai]]></category>
		<category><![CDATA[CDN]]></category>
		<category><![CDATA[Cloud Files]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Rackspace Media Hosting]]></category>

		<guid isPermaLink="false">http://www.rackspace.com/blog/?p=26490</guid>
		<description><![CDATA[HTML5 makes it easy to share podcasts, recordings and more across all modern browsers. Today we will explore embedding a Rackspace Cloud Files-hosted recording using the new HTML5 audio standard.]]></description>
				<content:encoded><![CDATA[<p><i>HTML5 makes it easy to share podcasts, recordings and more across all modern browsers. Today we will explore embedding a Rackspace Cloud Files-hosted recording using the new HTML5 audio standard, like this:</i></p>
<p><audio controls><br />
<source src="http://0639ac876cdeb83a534d-95c931daa7c80b903aae4215b472f9f8.r4.cf1.rackcdn.com/RackspaceCloudFiles.mp3" type="audio/mpeg" /><br />
<source src="http://0639ac876cdeb83a534d-95c931daa7c80b903aae4215b472f9f8.r4.cf1.rackcdn.com/RackspaceCloudFiles.ogg" type="audio/ogg" /><br />
<em>Sorry, your browser doesn&#8217;t support HTML5 audio.</em><br />
</audio></p>
<h2><b>Background</b></h2>
<p><b>HTML5</b></p>
<p>HyperText Markup Language, or HTML, has served as the basic formatting language of the Internet for over two decades. As the content of the Internet has changed, so too has the language. The <a href="http://www.w3.org/">World Wide Web Consortium (W3C)</a> controls the standard for HTML, and previous revisions to the language have introduced content such as tables and images to the World Wide Web.</p>
<p>HTML5 marks the latest version of HTML, and it adds new ways to interact with content and share media. In the past, JavaScript and Flash were used to accomplish much of the same goals, but the HTML5 standard brings security, cross-browser compatibility, and ease of implementation to many of these now-common tasks.</p>
<p>This month, W3C finalized the HTML5 definitions, and in 2014 they expect to adopt them as official web standards. However, web browsers released over the past year, including those on smartphones, have already incorporated HTML5 technology, so there is no need to wait until 2014 to begin utilizing its powerful features!</p>
<p><b>HTML5 Audio</b></p>
<p>In the past, embedding audio such as music or podcasts required using JavaScript or Flash, such as with <a href="http://flash-mp3-player.net/">this open-source MP3 player</a>.</p>
<p>Rather than using this complicated code, HTML5 allows a simple <i>&lt;audio&gt;&lt;/audio&gt;</i> tag for embedding audio, similar to an HTML link. These tags link directly to the audio files. However, this means that anybody viewing the source code of the web page may then download sound file, so this is not a protected embedding of sound.</p>
<p><b>Rackspace Cloud Files / Akamai Advantage</b></p>
<p>A music or podcast file may easily be larger than the rest of a webpage combined. Thus, ensuring playback is quick and scalable on a normal file server is taxing. <a href="http://www.rackspace.com/cloud/files/">Rackspace Cloud Files</a> is optimized to serve content such as podcasts to millions at blazing speeds. The Akamai content delivery network (CDN) technology behind Rackspace Cloud Files also powers many of the top media sites, making it an industry benchmark for speed and stability. And, with Rackspace Cloud Files, anybody can access this sophisticated technology at a low price.</p>
<h2><b>Implementation</b></h2>
<p><b>Preparing the Files</b></p>
<p>While HTML5 audio has been adopted by all major web browsers, one quirk remains &#8211; not every web browser can play every type of sound file! As <a href="http://en.wikipedia.org/wiki/HTML5_Audio#.3CAudio.3E_element">this chart on Wikipedia shows</a>, we have to provide the same audio file in multiple formats to ensure that is plays in all major browsers.</p>
<p>In general, providing audio in the <a href="http://en.wikipedia.org/wiki/MP3">MP3</a> and <a href="http://en.wikipedia.org/wiki/Ogg">Ogg Vorbis</a> formats allows it to be played in all major browsers.</p>
<p>For this demo, I am using these two files:</p>
<ul>
<li><a href="http://0639ac876cdeb83a534d-95c931daa7c80b903aae4215b472f9f8.r4.cf1.rackcdn.com/RackspaceCloudFiles.mp3">RackspaceCloudFiles.mp3</a></li>
<li><a href="http://0639ac876cdeb83a534d-95c931daa7c80b903aae4215b472f9f8.r4.cf1.rackcdn.com/RackspaceCloudFiles.ogg">RackspaceCloudFiles.ogg</a></li>
</ul>
<p>I found that the easiest way to convert files to <i>.mp3</i> and <i>.ogg</i> was with the website <a href="http://media.io/">Media.io</a>.</p>
<p><b>Uploading to Rackspace Cloud Files</b></p>
<p>On the <a href="https://mycloud.rackspace.com/">Rackspace open cloud</a> interface, first choose an existing container or create a new container to host your content. Upload the <i>.mp3</i> and <i>.ogg</i> files and publish them in the container. Click the sprocket next to each file, and then select &#8220;View All Links.&#8221; Copy the <b>HTTP</b> links for the two audio files.</p>
<h2><b>Embedding</b></h2>
<p><audio controls><br />
<source src="http://0639ac876cdeb83a534d-95c931daa7c80b903aae4215b472f9f8.r4.cf1.rackcdn.com/RackspaceCloudFiles.mp3" type="audio/mpeg" /><br />
<source src="http://0639ac876cdeb83a534d-95c931daa7c80b903aae4215b472f9f8.r4.cf1.rackcdn.com/RackspaceCloudFiles.ogg" type="audio/ogg" /><br />
<em>Sorry, your browser doesn&#8217;t support HTML5 audio.</em><br />
</audio><br />
The basic HTML5 audio player above uses this code:</p>
<pre>&lt;audio controls&gt;
&lt;source src="http://0639ac876cdeb83a534d-95c931daa7c80b903aae4215b472f9f8.r4.cf1.rackcdn.com/RackspaceCloudFiles.mp3" type="audio/mpeg" /&gt;
&lt;source src="http://0639ac876cdeb83a534d-95c931daa7c80b903aae4215b472f9f8.r4.cf1.rackcdn.com/RackspaceCloudFiles.ogg" type="audio/ogg" /&gt;
&lt;em&gt;Sorry, your browser doesn't support HTML5 audio.&lt;/em&gt;
&lt;/audio&gt;</pre>
<p>You may copy the code into your website, replacing the .mp3 and .ogg file links with your own.</p>
<p>Let&#8217;s walk through the various parts of the code and explain what they do:</p>
<ul>
<li><b>&lt;audio&gt;:</b> The audio tag initializes the HTML5 audio player. <i>Controls</i> in the opening tag tells the browser to show controls for the audio. In the opening tag, other useful attributes include:
<ul>
<li><i>Autoplay:</i> Begins the audio as soon as the page loads</li>
<li><i>Preload:</i> Begins loading the audio file as soon as the page loads, rather than when the play button is clicked. This means that the page loads more slowly, but the file is immediately available when the user is ready to listen to it.</li>
<li><i>Loop:</i> Continuously replays the sound file until it is paused.</li>
</ul>
</li>
<li><b>&lt;source&gt;:</b> These lines declare different source files and their formats. If there is only one format, a <i>src</i> may be declared in the opening audio tag. However, because no single audio format is compatible across all major browsers, using <i>source</i> tags is the most common way to embed multiple audio formats.</li>
<li><b>Incompatibility:</b> The text between the <i>audio</i> tags is displayed only if the browser does not support HTML5. Here, I display a simple message that the browser is incompatible. To see what it looks like, try using <a href="http://browsershots.org">Browser Shots</a> on this page or your website, it can show you how an older website displays HTML5 audio content. It is possible to embed JavaScript between the audio tags as a fall-back player for older browsers.</li>
</ul>
<h2><b>Conclusion</b></h2>
<p>If you have any questions, please post them in the comment section below. Other good HTML5 Audio resources include:</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/HTML5_Audio">HTML5 Audio (Wikipedia)</a></li>
<li><a href="http://www.jplayer.org/">JPlayer jQuery HTML5 Audio / Video Library (OpenSource)</a></li>
</ul>
<p>Check back tomorrow when I&#8217;ll discuss supercharging HTML5 video with Rackspace Cloud Files.</p>
<p><i>For more information on high performance media that’s fast, simple and reliable, be sure to check out the new Rackspace Media Hosting on the Cloud website at: <a href="http://www.rackspace.com/cloud/media/">http://www.rackspace.com/cloud/media/</a>. </i></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rackspace.com/blog/scaling-html5-audio-with-rackspace-cloud-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://0639ac876cdeb83a534d-95c931daa7c80b903aae4215b472f9f8.r4.cf1.rackcdn.com/RackspaceCloudFiles.mp3" length="61056" type="audio/mpeg" />
<enclosure url="http://0639ac876cdeb83a534d-95c931daa7c80b903aae4215b472f9f8.r4.cf1.rackcdn.com/RackspaceCloudFiles.ogg" length="60073" type="audio/ogg" />
		</item>
		<item>
		<title>Running Jekyll On Rackspace Cloud Files</title>
		<link>http://www.rackspace.com/blog/running-jekyll-on-rackspace-cloud-files/</link>
		<comments>http://www.rackspace.com/blog/running-jekyll-on-rackspace-cloud-files/#comments</comments>
		<pubDate>Thu, 20 Dec 2012 21:00:13 +0000</pubDate>
		<dc:creator>Philip Thomas</dc:creator>
				<category><![CDATA[Business Tips and Tricks]]></category>
		<category><![CDATA[Cloud Industry Topics]]></category>
		<category><![CDATA[Open Cloud]]></category>
		<category><![CDATA[Product Discussion]]></category>
		<category><![CDATA[Tips for Devs and Sys Admins]]></category>
		<category><![CDATA[Akamai]]></category>
		<category><![CDATA[CDN]]></category>
		<category><![CDATA[Cloud Files]]></category>
		<category><![CDATA[How-to]]></category>

		<guid isPermaLink="false">http://www.rackspace.com/blog/?p=25755</guid>
		<description><![CDATA[This post is a guide to maintaining a Jekyll website on the Akamai-powered Rackspace Cloud Files CDN network.]]></description>
				<content:encoded><![CDATA[<p><em>This post is a guide to maintaining a </em><a href="http://jekyllrb.com"><em>Jekyll</em></a><em> website on the Akamai-powered </em><a href="http://www.rackspace.com/cloud/public/files/"><em>Rackspace Cloud Files CDN</em></a><em> network. However, it may serve as a general guide for hosting any static website on the network.</em></p>
<p><strong>Background</strong><br />
I decided to use the Akamai Content Delivery Network as a host after reading an article about the use of Jekyll and Akamai in the Obama fundraising campaign. In general, hosting a static website on a CDN gives extremely quick load times with nearly unlimited scalability. However, CDNs were built for delivering content, not whole websites, so making this setup work requires some finagling.</p>
<p>This guide assumes:</p>
<ul>
<li>An existing Rackspace account</li>
<li>Familiarity with cURL statements</li>
<li>Access to and understanding of your site&#8217;s DNS</li>
<li>Basic familiarity with the Rackspace interface (including access to your API key)</li>
<li>A working Jekyll site, and a basic understanding of it</li>
</ul>
<p><strong>Container Creation</strong><br />
In the Rackspace Cloud Files interface, first create a Cloud Files container, then publish it to the CDN. Note the <strong>published URL</strong>, as it is used to configure the CNAME in DNS, below.</p>
<p>Also decide on a TTL for your domain &#8211; this will be the maximum time items are cached. I keep mine at seven days, but this also means that any whole-site changes could take up to a week to propagate. Also note that we can override a TTL with <a href="http://www.rackspace.com/knowledge_center/article/using-cdn-edge-purge">Edge Purge</a>, as discussed below.</p>
<p><strong>DNS</strong><br />
In order to set your URL (ex. <em>www.example.com</em>) to the CDN, set the CNAME record to the <em>published URL</em> of your cloud container that was noted in the above step (omitting the &#8220;http://&#8221;). For using <em>www.example.com</em>, this means setting the <em>www</em> CNAME to the published URL.</p>
<p><strong>Note:</strong> Because Cloud Files requires a CNAME instead of an A record, in general we must use a subdomain. Therefore, the naked domain (e.g. example.com) cannot be used. While it is technically against standards, some nameserver-level services such as <a href="http://cloudflare.com">Cloudflare</a> allow naked domain CNAME records. I have had limited success with naked domain CNAME records and do not suggest it.</p>
<p><strong>Uploading</strong><br />
After you have configured DNS, the next step is uploading your Jekyll site to the CDN. First, run the command <em>Jekyll</em> to compile your site into the <em>_site</em> folder.</p>
<p>In order to upload my site to the CDN, I use <a href="https://github.com/nicholaskuechler/jekyll-rackspace-cloudfiles-clean-urls/blob/master/cloudfiles_jekyll_upload.py">this Jekyll to Rackspace Cloud Files Python script</a>. It requires having Python installed on your computer &#8211; if you are unsure of how to do this, Google the directions, because installation on each operating system differs.</p>
<p>Save the script to your root Jekyll directory, and edit it to put in your Rackspace username, API key and container name. To run the file, thus uploading your site to the CDN, use the command:</p>
<pre>python cloudfiles_jekyll_upload.py</pre>
<p><strong>Warning:</strong> Add the uploading script to the <a href="http://blog.patrickcrosby.com/2009/09/05/jekyll-exclude-files.html">exclude</a> in your <em>_config.yml</em>, and consider adding it to your <em>.gitignore</em>. Otherwise, the access credentials for your Rackspace account could be compromised.</p>
<p><strong>Note:</strong> You may upload the contents of your <em>_site</em> folder however you wish; I find the above script most efficient, but using the web interface or <a href="http://cyberduck.ch">Cyberduck</a> is equally viable.</p>
<p><strong>Setting a Web Index</strong><br />
If you type in the root URL of your website now, e.g. <em>www.example.com</em>, it will show an error. However, accessing a specific file works &#8211; e.g. <em>www.example.com/index.html</em>. This is because, when accessing the root URL, you are not calling a specific file, just the container. We need to tell Akamai which file to show when somebody accesses just the container. Here, we will make <em>index.html</em> the <strong>web index</strong> of the container, so that visiting <em>www.example.com</em> will show the file at <em>http://www.example.com/index.html</em>.</p>
<p>We do this in two steps using the Rackspace API. <strong>First</strong>, we authenticate to receive an <em>authorization token</em>, which gives us access to the files for 24 hours, and also to find the <em>CDN URL</em> where we will send our request. <strong>Second</strong>, we set the container&#8217;s web index to <em>index.html</em>.</p>
<p><strong>API Authentication</strong><br />
This step authenticates with Rackspace and gives us an <strong>authentication token</strong> (valid for 24 hours) to access the container through API. It also gives us the <strong>CDN URL</strong> for managing your containers.</p>
<p><strong>Note:</strong> The <em>CDN URL</em> is different from the <em>published URL</em> for your container that we put in your CNAME record. The <em>CDN URL</em> is obtained through the API, and it gives you the ability to control <em>all</em> of your containers. The <em>published URL</em> is specific to a container, and is the public view of a container&#8217;s files. Use the <em>CDN URL</em> for cURL statements / management, and use the <em>published URL</em> to update your DNS records.</p>
<p>In order to obtain an authentication token and in order to see the CDN URL, you need your Rackspace username and Rackspace API Key (available in your Rackspace Account information). Run this cURL command:</p>
<pre>cURL -H "X-Auth-User: <em>[Rackspace Username]</em>" -H "X-Auth-Key: <em>[Your Rackspace API Key]</em>" https://auth.api.rackspacecloud.com/v1.0/ -v</pre>
<p>In the response, there are two important lines for this guide. <strong>X-Storage-Url</strong> is your <strong>CDN URL</strong>, and <strong>X-Auth-Token</strong> is your <strong>authentication token</strong>. Record both of these, as we will use them in the next step.</p>
<p><strong>Setting Web Index</strong><br />
Now that we have the authentication token and CDN URL, we can set the web index file using the below cURL command. The command is specific to a container, so you need your container name, which you append to the CDN URL. Here, I am setting the web index to <em>index.html</em>, but you could hypothetically set it to any file in the container.</p>
<pre>cURL -X POST -H "X-Container-Meta-Web-Index: <em>index.html</em>" -H "X-Auth-Token: <em>[Authentication Token]</em>" <em>[CDN URL]</em>/<em>[Container Name]</em>/ -v</pre>
<p>It should take a few minutes for this to propagate, but you then should be able to navigate to your root URL, e.g. <em>www.example.com</em>, and see the contents of <em>index.html</em>.</p>
<p><strong>Error Pages</strong><br />
Rackspace also allows <strong>401</strong> (unauthorized) and <strong>404</strong> (not found) error pages to be configured for a container. This means that if somebody navigates to <em>www.example.com/nonexistent_file</em>, you can show your own 404 error page instead of the default Rackspace error. This adds professionalism to your site.</p>
<p>To start, you need to add two static pages to Jekyll: <strong>401error.html</strong> and <strong>404error.html</strong>. Rackspace is a bit idiosyncratic in that you must have <strong>both</strong> a 401 page and a 404 page to use their custom error pages. The query for configuring error pages is almost exactly the same as creating a web index, and requires information from the preceding API authentication step. Once you have uploaded the error pages and obtained the authentication token and CDN URL, run this cURL statement:</p>
<pre>cURL -X POST -H "X-Container-Meta-Web-Error: <em>error.html</em>" -H "X-Auth-Token: <em>[Authentication Token]</em>" <em>[CDN URL]</em>/<em>[Container Name]</em>/ -v</pre>
<p>Note that we set the web error page to error.html, even though we created the pages 401error.html and 404error.html. This is because Rackspace preprends the error code to the page we set. Thus, if you want the error pages to be 401request.html and 404request.html, you could update the above statement with <em>request.html</em> in place of <em>error.html</em>.</p>
<p><strong>Pushing Changes with Edge Purge</strong><br />
Updating the site is a simple matter of running the upload script. However, updates on existing pages may not be visible for the time length of your TTL. That means that, if your TTL is one week, it could take one week for your change to propagate through the CDN. This section covers how to override the TTL in order to push changes immediately so that changes are visible in minutes, rather than days.</p>
<p><strong>Updating a Page</strong><br />
If you are updating a single file in the root of your container (e.g. <em>www.example.com/about.html</em>), you can use a basic Edge Purge. Edge Purge overrides the TTL of a file, and resets it across the CDN in a couple minutes.</p>
<p>Executing an Edge Purge is simple through the <a href="https://mycloud.rackspace.com/">Rackspace Open Cloud Files control panel</a>. When viewing the contents of the container, click the sprocket on the left and select <em>Refresh File (Purge)</em>. The update should then be visible in a few minutes.</p>
<p>If you use <a href="http://cyberduck.ch">Cyberduck</a> to manage your cloud files, the software <a href="http://trac.cyberduck.ch/wiki/help/en/howto/akamai#Invalidation">supports Edge Purge with its &#8220;invalidation&#8221; command</a>.</p>
<p><strong>Note:</strong> Rackspace limits you to <strong>25</strong> Edge Purges per day.</p>
<p><strong>Updating a Page in a Directory</strong><br />
If you have a file at <em>www.example.com/folder/index.html</em> (for example a Jekyll blog post), you can access it three ways:<br />
www.example.com/folder<br />
www.example.com/folder/<br />
www.example.com/folder/index.html</p>
<p>In our structural directories, we see this as one file. However, Akamai uses a <a href="http://en.wikipedia.org/wiki/Flat_file_database">flat file database</a>. This means when you upload /folder/index.html it creates three separate files to match the above files. If you Edge Purge the <em>index.html</em> file, only one of the three file paths will be updated:<br />
www.example.com/folder/index.html</p>
<p>The other paths will remain unchanged because Akamai sees them as separate files:<br />
www.example.com/folder<br />
www.example.com/folder/</p>
<p>This is a problem because the permalink structure of Jekyll posts will use the <em>www.example.com/folder/</em> path in navigation, which does not reflect an update to <em>www.example.com/folder/index.html</em>. Thus, attempting to update a blog post can be difficult.</p>
<p>In order to overcome this, we need to use the API again. We run three separate purges &#8211; one for each of the file structures. However, these purges are <strong>destructive</strong>, meaning that you must upload the corrected file <strong>after</strong> running these queries.</p>
<p>Run these three queries, subbing in your authorization token, CDN URL and container name. They are structured to delete the file path /folder/index.html; modify the query for folders or sub-folders. In addition, you can insert your email address and Akamai will email you when the purge is complete. In my experience, deleting files through this method takes about 10 minutes.</p>
<p><strong>Delete /folder</strong></p>
<pre>cURL -D – -X DELETE -H "X-Auth-Token: <em>[Auth Token]</em>" -H "X-Purge-Email: <em>[Your Email]</em>" <em>[CDN URL]</em>/<em>[Container Name]</em>/folder -v</pre>
<p><strong>Delete /folder/</strong></p>
<pre>cURL -D – -X DELETE -H "X-Auth-Token: <em>[Auth Token]</em>" -H "X-Purge-Email: <em>[Your Email]</em>" <em>[CDN URL]</em>/<em>[Container Name]</em>/folder/ -v</pre>
<p><strong>Delete /folder/index.html</strong></p>
<pre>cURL -D – -X DELETE -H "X-Auth-Token: <em>[Auth Token]</em>" -H "X-Purge-Email: <em>[Your Email]</em>" <em>[CDN URL]</em>/<em>[Container Name]</em>/folder -v</pre>
<p>At this point, you have successfully deleted the old file. Now, upload your corrected <em>/folder/index.html</em> file, and changes should be reflected online in about five minutes.</p>
<p><strong>Note:</strong> Each of these purges counts against your daily limit of 25 Edge Purges through Rackspace.</p>
<p><strong>Site-wide change</strong><br />
If you are making a large-scale change to your Jekyll site (like updating the footer on every page), consider setting up a new container and starting fresh. After re-configuring the index and error pages, updating your CNAME will put the new site live. Rackspace does offer a whole-container edge purge that you may request through a support ticket, but I have found problems with the script (specifically related to the flat file structure) and am currently working with Rackspace to fix these problems.</p>
<p><strong>A Note on SSL</strong><br />
Cloud Files CDN does support <a href="http://www.rackspace.com/blog/rackspace-cloud-files-cdn-launches-ssl-delivery/">SSL delivery</a>, but the certificate is valid only for the Rackspace domain. This means that you cannot use SSL on your own domain using this static site method.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rackspace.com/blog/running-jekyll-on-rackspace-cloud-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Switching From WordPress To Jekyll</title>
		<link>http://www.rackspace.com/blog/switching-from-wordpress-to-jekyll/</link>
		<comments>http://www.rackspace.com/blog/switching-from-wordpress-to-jekyll/#comments</comments>
		<pubDate>Wed, 19 Dec 2012 21:00:13 +0000</pubDate>
		<dc:creator>Philip Thomas</dc:creator>
				<category><![CDATA[Business Tips and Tricks]]></category>
		<category><![CDATA[Cloud Industry Topics]]></category>
		<category><![CDATA[Open Cloud]]></category>
		<category><![CDATA[Product Discussion]]></category>
		<category><![CDATA[Tips for Devs and Sys Admins]]></category>
		<category><![CDATA[Akamai]]></category>
		<category><![CDATA[CDN]]></category>
		<category><![CDATA[Cloud Files]]></category>
		<category><![CDATA[jekyll]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.rackspace.com/blog/?p=25727</guid>
		<description><![CDATA[Here, I chronicle the move from WordPress to Jekyll on the Rackspace Cloud Files CDN Network powered by Akamai.]]></description>
				<content:encoded><![CDATA[<p><strong>Incumbant: WordPress</strong><br />
I have used <a href="http://wordpress.org">WordPress</a> to manage my personal website for the past two years. The system performed excellently, and it consistently handled traffic spikes with quick load times.</p>
<p>I have been on a discounted trial with my current hosting provider so cost has not been an issue. With the trial concluding, I sought a new host because the convenience afforded by the service does not justify its full cost.</p>
<p><strong>Enter Jekyll</strong><br />
A recent article about the technology behind the Obama fundraising campaign piqued my interest. Their network used <a href="http://jekyllrb.com">Jekyll</a>-generated static pages hosted on the Akamai CDN to accept $250 million in campaign donations. WordPress caching plugins essentially aim to serve the site with static pages, so the idea of generating static pages locally using Ruby then serving a purely static site made logical sense.</p>
<p>Jekyll, however, is not an automated content management system &#8211; it requires basic familiarity with Ruby, HTML and CSS. The technical granularity coupled with the ability to version-control the website with Git appealed to me.</p>
<p>Using a CDN to purely serve a website intrigued me most because of the potential for extremely fast speeds with near-infinite scalability. Putting my personal website on Akamai would be like strapping a <a href="http://en.wikipedia.org/wiki/Kestrel_%28rocket_engine%29">Kestrel rocket</a> on the back of my Honda Civic.</p>
<p><strong>Switch</strong><br />
The full code for my website is available on Github <a href="http://github.com/philipithomas/www.philipithomas.com">here</a>. Learning Jekyll and using its plugins proved quite trivial.</p>
<p>The tedious part of the shift was redirecting the permalinks from my WordPress site to the Jekyll site. My previous website was based on the naked domain, whereas using a CDN requires a subdomain (for a CNAME record). Thus, I had to switch both permalink structure and domain. I did this manually with 301 directs in .htaccess served by <a href="http://heroku.com">Heroku</a>. That file is <a href="https://github.com/philipithomas/philipithomas301/blob/master/.htaccess">here</a>. After putting the redirects online, I then manually submitted a <a href="http://support.google.com/webmasters/bin/answer.py?hl=en&amp;answer=1352276">crawl request</a> through Google for each old page. This process, though tedious, preserves inbound links and SEO.</p>
<p><a href="http://rackspace.com">Rackspace</a> offers access to the Akamai CDN through <a href="http://www.rackspace.com/cloud/public/files/">Cloud Files</a>. Using Akamai with Jekyll required much tinkering because the platform was not designed to serve a full website. After many calls to Rackspace&#8217;s Fanatical Support team, I was able to overcome all issues, including caching limitations. I have decided to provide a full guide to interfacing Jekyll with Akamai in a separate forthcoming blog post in order to cover all of these idiosyncrasies in sufficient deal.</p>
<p><strong>Results</strong></p>
<p style="text-align: center;"><img class="aligncenter" src="http://ddf912383141a8d7bbe4-e053e711fc85de3290f121ef0f0e3a1f.r87.cf1.rackcdn.com/wordpress-to-jekyll.1.png" alt="" width="625" height="218" /></p>
<p>With my prior hosting provider, I consistently clocked page load times under two seconds. With this Jekyll implementation, load times closer to 300 milliseconds have been average, with the occasional sub-100-millisecond reading, as shown above (via <a href="http://tools.pingdom.com">Pingdom</a>). While these speeds are outrageous, it is exciting to realize that with Akamai as a host this speed is essentially independent of scale, and the network can accommodate nearly any traffic level I could expect.</p>
<p>Of note, though, these page load speeds are so excellent because the site is static content. Making a website scale at these speeds with database queries and sessions would be much more difficult.</p>
<p><em>This post is the first in a two-part series. Tune in tomorrow for a guide to maintaining a Jekyll website on the Rackspace Cloud Files CDN Network powered by Akamai.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rackspace.com/blog/switching-from-wordpress-to-jekyll/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Content Delivery Network via Rackspace Cloud Files: c3414940.r40.cf0.rackcdn.com

 Served from: www.rackspace.com @ 2013-05-21 01:03:57 by W3 Total Cache -->