<?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/"
	xmlns:series="http://unfoldingneurons.com/"
	>

<channel>
	<title>Stephen Foskett, Pack Rat &#187; HTTP Archives  &#8211; Stephen Foskett, Pack Rat</title>
	<atom:link href="http://blog.fosketts.net/tag/http/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.fosketts.net</link>
	<description>Understanding the accumulation of data</description>
	<lastBuildDate>Fri, 10 Feb 2012 17:40:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com" />
	<atom:link rel="hub" href="http://superfeedr.com/hubbub" />
			<item>
		<title>How To Force Apache To Redirect To Canonical Hostnames, or ServerAlias Is Not Your Friend</title>
		<link>http://blog.fosketts.net/2010/08/01/force-apache-redirect-canonical-hostnames-serveralias-friend/</link>
		<comments>http://blog.fosketts.net/2010/08/01/force-apache-redirect-canonical-hostnames-serveralias-friend/#comments</comments>
		<pubDate>Sun, 01 Aug 2010 15:19:42 +0000</pubDate>
		<dc:creator>Stephen</dc:creator>
				<category><![CDATA[Enterprise storage]]></category>
		<category><![CDATA[Everything]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[redirect]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[ServerAlias]]></category>
		<category><![CDATA[VirtualHost]]></category>

		<guid isPermaLink="false">http://blog.fosketts.net/?p=3475</guid>
		<description><![CDATA[Today I came up against a frustrating realization: Apache doesn't have a satisfying way to redirect multiple domains to canonical hostnames! In other words, it's fairly easy to redirect one domain's content from "www.example.com" to just plain "example.com" or to make both hostnames work, but there's no one-stop solution to do this with a dozen domains. I've hit on a method that correctly redirects alternate hostnames and will save you aggravation in the long run.]]></description>
			<content:encoded><![CDATA[<p>Yesterday I discussed <a href="http://blog.fosketts.net/2010/07/30/high-performance-memory-apache-php-virtual-private-server/"  target="_blank">how to set up a lightweight PHP web server using Apache</a>. Next we have to get everything running smoothly, and I came up against a frustrating realization: Apache doesn&#8217;t have a satisfying way to redirect multiple domains to canonical hostnames! In other words, it&#8217;s fairly easy to redirect one domain&#8217;s content from &#8220;www.example.com&#8221; to just plain &#8220;example.com&#8221; or to make both hostnames work, but there&#8217;s no one-stop solution to do this with a dozen domains. But I&#8217;ve hit on a method that correctly redirects alternate hostnames and will save you aggravation in the long run.</p>
<h3>The Easy Way</h3>
<p>Apache is one amazingly flexible web server. It handles multiple domains with ease, using the VirtualHost method, and the ServerAlias directive allows you to host permutations easily. Consider the following totally made-up example:</p>
<pre>&lt;VirtualHost *:80&gt;
  ServerName blog.fosketts.net
  ServerAlias www.blog.fosketts.net
  ServerAlias fosketts.net
  ServerAlias www.fosketts.net
  DocumentRoot /var/www/
&lt;/VirtualHost&gt;</pre>
<p>This looks great, right? It tells Apache to watch any IP on port 80 for an HTTP request for a server called blog.fosketts.net and to serve it the content from /var/www/. It also tells Apache to accept plain old &#8220;fosketts.net&#8221;, &#8220;www.fosketts.net&#8221;, and even &#8221;www.blog.fosketts.net&#8221;.</p>
<h3>What&#8217;s Wrong With Easy?</h3>
<p>Although accepting all these hostnames seems like the friendly and correct thing to do, it&#8217;s not in your best interest. It tells web clients that the exact same content lives on four different servers, and they&#8217;ll start linking to your content every which way. Pretty soon you&#8217;ll have incoming links for all four hostnames. So what&#8217;s wrong with this?</p>
<ol>
<li><strong>It&#8217;s confusing for users</strong> &#8211; They&#8217;ll start asking, &#8220;is your site www.fosketts.net or blog.fosketts.net?&#8221; It&#8217;s fine to segment things, but confusing to do it unnecessarily.</li>
<li><strong>It&#8217;s hard to configure and maintain</strong> &#8211; Once your site starts getting linked to and shared around, you&#8217;re stuck supporting all possible combinations. When you switch hosts or server platforms (<a href="http://blog.fosketts.net/2010/07/30/high-performance-memory-apache-php-virtual-private-server/"  target="_blank">ahem</a>) you have to make sure everything still works.</li>
<li><strong>It hurts your search ranking</strong> &#8211; You might not be all that concerned with search engine placement, and <a rel="nofollow" href="http://googlewebmastercentral.blogspot.com/2008/09/demystifying-duplicate-content-penalty.html"  target="_blank">it&#8217;s not as bad</a> <a href="http://www.seomoz.org/blog/gonna-set-it-straight-this-watergate"  target="_blank">as some say</a>, but splitting your traffic between multiple sites also splits your &#8220;SEO juice&#8221;.</li>
<li><strong>Web crawls overload your servers</strong> &#8211; Search engines treat each host name as a different server. If you allow links to multiple names without a proper redirect, you&#8217;ll get multiple crawls, often at the same time.</li>
</ol>
<p>In summary, the easy was isn&#8217;t good. ServerAlias looks friendly, but it&#8217;s not a friend when used this way.</p>
<p>Let&#8217;s say your name was Stephen, but some people call you Steve. Rather than insist on one or the other, you could just go through life accepting either. But imprecision can lead to issues, even in the real world. Will people know to look up Stephen in the company directory when they know you as Steve? You might start getting duplicate junk mail for both names as they find their way onto mailing lists. Then there&#8217;s the embarrassing &#8220;I always called him Steve&#8221; moment at the company party, when someone feels like they&#8217;re not part of the &#8220;in crowd&#8221; that knows your real name. It&#8217;s best to be friendly and accept anything but politely suggest that everyone uses just one name in the interest of sanity.</p>
<h3>Redirection is Right</h3>
<p>The best approach in life is also the correct method on the web. Your server should be set to accept any number of possible names in case someone comes in with the wrong one. But rather than blithely accepting the name, your server should issue a proper &#8220;redirect&#8221; call, instructing the browser or crawler to reload the page using the correct name from that point on.</p>
<p>This is simple when using Lighttpd. I just added the following lines to my lighttpd.conf file and it magically issued a proper redirect whenever someone came in using the &#8220;www&#8221; name:</p>
<pre>$HTTP["host"] =~ "^www\.(.*)$" {
  url.redirect  = (
    "^/(.*)" =&gt; "http://%1/$1",
  )
}</pre>
<p>I was amazed that I could locate no such universal redirect option in Apache. You can do all the RedirectMatch calls you want, but their regular expressions only operate on the path part of the URL, not the hostname. This is great for adding a &#8220;www&#8221; but makes it impossible to create a generic rule to eliminate them!</p>
<p>Instead, we have to use RedirectMatch on each VirtualHost domain individually. This also opens the possibility to deal with other conditions we might come across, but it&#8217;s not as simple and clean as the Lighttpd method.</p>
<p>Here&#8217;s where the magic is. Each VirtualHost configuration you add (in /etc/apache2/sites-available on Ubuntu) should include rules to deal with the incorrect names as well as the single correct one. Here&#8217;s the correct redirect rule for the example above:</p>
<pre>&lt;VirtualHost *:80&gt;
  ServerName fosketts.net
  ServerAlias www.fosketts.net
  ServerAlias www.blog.fosketts.net
  RedirectMatch 301 (.*) http://blog.fosketts.net$1
&lt;/VirtualHost&gt;

&lt;VirtualHost *:80&gt;
  DocumentRoot /var/www/
  ServerName blog.fosketts.net
&lt;/VirtualHost&gt;</pre>
<p>The first VirtualHost block matches all the incorrect hostnames and redirects them (with a code of 301 for &#8220;Permanent&#8221;) to the correct hostname. The &#8220;(.*)&#8221; part matches any and all paths and arguments and the &#8220;$1&#8243; part appends them to the new hostname. Then we set up another VirtualHost block for only the correct hostname and put any and all rules in there.</p>
<p>This way, any clients or crawlers that hit &#8220;www.fosketts.net&#8221; or any of the other alternatives will get a proper 301 redirect to &#8220;blog.fosketts.net&#8221; and go about its business. It tells Google that there is only one proper server name for this content and encourages users (who will likely copy and paste from the address bar) to use it, too. Neat and tidy, and very friendly.</p>
<p>I&#8217;d love to hear alternative methods of doing this. Please leave a comment if you have a suggestion that uses a 301 redirect and works across multiple domains!</p>
<div id="crp_related"><h3>You might also want to read these other posts...</h3><ul><li><a href="http://blog.fosketts.net/2010/07/30/high-performance-memory-apache-php-virtual-private-server/"  rel="bookmark" class="crp_title">A High-Performance, Low-Memory Apache/PHP Virtual Private Server</a></li><li><a href="http://blog.fosketts.net/2009/06/26/multiserver-web-host-environment/"  rel="bookmark" class="crp_title">Setting Up a Multi-Server Web Hosting Environment</a></li><li><a href="http://blog.fosketts.net/guides/ipad-exchange-activesync/ipad-exchange-activesync-troubleshooting-guide/"  rel="bookmark" class="crp_title">iPad Exchange ActiveSync Troubleshooting Guide</a></li><li><a href="http://blog.fosketts.net/2011/04/26/5307/"  rel="bookmark" class="crp_title"></a></li><li><a href="http://blog.fosketts.net/2009/06/29/tuning-lighttpd-linux/"  rel="bookmark" class="crp_title">Tuning Lighttpd For Linux</a></li></ul></div><script src="http://feeds.feedburner.com/~s/sfoskett?i=http://blog.fosketts.net/2010/08/01/force-apache-redirect-canonical-hostnames-serveralias-friend/" type="text/javascript" charset="utf-8"></script><hr />
<p><small>© sfoskett for <a href="http://blog.fosketts.net">Stephen Foskett, Pack Rat</a>, 2010. |
<a href="http://blog.fosketts.net/2010/08/01/force-apache-redirect-canonical-hostnames-serveralias-friend/">How To Force Apache To Redirect To Canonical Hostnames, or ServerAlias Is Not Your Friend</a>
<br/>
This post was categorized as <a href="http://blog.fosketts.net/category/everything/enterprisestorage/" title="View all posts in Enterprise storage" rel="category tag">Enterprise storage</a>, <a href="http://blog.fosketts.net/category/everything/" title="View all posts in Everything" rel="category tag">Everything</a>. Each of my categories has its own feed if you'd like to filter out or focus on posts like this.<br/>
</small></p>]]></content:encoded>
			<wfw:commentRss>http://blog.fosketts.net/2010/08/01/force-apache-redirect-canonical-hostnames-serveralias-friend/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<series:name><![CDATA[Web Hosting]]></series:name>
	</item>
		<item>
		<title>We Don&#8217;t Need Cloud Standards (Yet)</title>
		<link>http://blog.fosketts.net/2009/09/16/cloud-services-standards/</link>
		<comments>http://blog.fosketts.net/2009/09/16/cloud-services-standards/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 17:03:02 +0000</pubDate>
		<dc:creator>Stephen</dc:creator>
				<category><![CDATA[Computer History]]></category>
		<category><![CDATA[Enterprise storage]]></category>
		<category><![CDATA[Gestalt IT]]></category>
		<category><![CDATA[Virtual Storage]]></category>
		<category><![CDATA[Amazon]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[cloud computing]]></category>
		<category><![CDATA[cloud storage]]></category>
		<category><![CDATA[CloudLoop]]></category>
		<category><![CDATA[EC2]]></category>
		<category><![CDATA[featured]]></category>
		<category><![CDATA[FUD]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[NetApp]]></category>
		<category><![CDATA[Nirvanix]]></category>
		<category><![CDATA[Rackspace]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[RightScale]]></category>
		<category><![CDATA[S3]]></category>
		<category><![CDATA[SNIA]]></category>
		<category><![CDATA[Terremark]]></category>
		<category><![CDATA[Yahoo]]></category>

		<guid isPermaLink="false">http://blog.fosketts.net/?p=2312</guid>
		<description><![CDATA[Championing "open" and calling for standards has become the first stalling action by late-movers in technology spaces. They see opportunity passing by and try to hold back progress and FUD the market by yelling about proprietary solutions, vendor lock-in, and a lack of standards. Many well-intentioned IT folks follow along: After all, who doesn't want openness, standardization, and interoperability?]]></description>
			<content:encoded><![CDATA[<p>Championing &#8220;open&#8221; and calling for standards has become the first stalling action by late-movers in technology spaces. They see opportunity passing by and try to hold back progress and FUD the market by yelling about proprietary solutions, vendor lock-in, and a lack of standards. Many well-intentioned IT folks follow along: After all, who doesn&#8217;t want openness, standardization, and interoperability?</p>
<p>But cloud services are different.<span id="more-2312"></span> Seriously! <strong>Cloud services don&#8217;t need standards</strong> because:</p>
<ol>
<li><strong>Cloud services are still rapidly evolving</strong> &#8211; No one knows how they will look in a year, let alone a decade, and a premature standard will be worthless. Similarly, it&#8217;s not at all clear what use cases will eventually win out, and <strong>usage should drive interfaces</strong>, not the other way around.</li>
<li><strong>Cloud services are many and varied</strong> &#8211; It&#8217;s incredibly hard to come up with a reasonably-complete standard programming API or management platform when each vendor&#8217;s offering is radically different. <strong>Standards must follow the 80/20 rule</strong>, but today&#8217;s cloud offerings are only about 20% similar.</li>
<li><strong>(Real) cloud systems are open already</strong> &#8211; The whole point of the public cloud is to leverage existing open standards for access (IP/HTTP) and any worthwhile service already has a freely-usable REST-like API. Cloud services are engineered to be programmable and open, so <strong>the only lock-in is in how you use the cloud</strong>.</li>
</ol>
<p>We can&#8217;t even agree on terminology at this point. Is data storage as a service <a href="http://www.snia.org/tech_activities/publicreview/CDMI_Spec_v08.pdf"  target="_blank">DaaS</a> (as SNIA says) or <a href="http://communities.netapp.com/people/garcia/blog/tags/staas"  target="_blank">STaaS</a> (as NetApp says)? How do you define public, private, and hybrid cloud? And what is cloud anyway? Cloud computing is <a href="http://blog.gardeviance.org/2009/09/cloud-computing-standards-war.html"  target="_blank">not a war</a>, it&#8217;s a <a href="http://www.rationalsurvivability.com/blog/?p=1316"  target="_blank">fantastically exciting race</a> to deliver value!</p>
<h3>Open for Business</h3>
<p>I&#8217;d like to return for a moment to that last point: <strong>The key element I&#8217;ve seen in most interesting cloudy products is programmability</strong>. Service providers publish API documents outlining the inputs, processing, and outputs for their systems and developers and end users create applications that leverage these. The best of these APIs use the concept of REST, delivering services through extremely simple and self-contained HTTP calls. This barely even rises to the level of software coding (and thus isn&#8217;t a true API) and is the hallmark of the cloud.</p>
<p><strong>These systems are wide open</strong>: You can explore their interfaces, discovering new ways to use the them that were never intended. The same process accompanies all Internet systems, from RSS and Atom to Yahoo Finance. Just as one can rapidly migrate from Yahoo to Google by <a rel="nofollow" href="http://computerprogramming.suite101.com/article.cfm/google_yahoo_finance_and_rebol_programming"  target="_blank">substituting a few URLs and parameters</a>, so too can one move between cloud platforms.</p>
<p>Note that certain cloud systems lend themselves more to this kind of mobility. Once cannot move virtual machines from Amazon EC2 to Rackspace or Terremark because the underlying hypervisor technology is different. But even here companies like <a href="http://www.rightscale.com/"  target="_blank">RightScale</a> are stepping in to enable mobility.</p>
<p>When it comes to cloud storage services, <strong>the major players&#8217; interfaces are open enough that migrating data in and out is simply a matter of performance</strong>: Read from this one, write to that one, and wait until the process is done. I am not a programmer and yet I was able to port an application from S3 to Nirvanix in just a few hours using only the respective API documentation. Interfaces like <a href="http://www.cloudloop.com/"  target="_blank">CloudLoop</a> can also be leveraged to ease the movement of data.</p>
<h3>Standards When?</h3>
<p>Cloud services will eventually settle down and be standardized. I expect a workable cross-platform API for RESTful cloud storage within 24 months, for example. And one expects that the management of cloud compute instances will pass through a consistent and stable interface in that same timeframe. But these will develop as a natural part of the evolution of the systems themselves, not through some artificial &#8220;build it and they will come&#8221; standardization process.</p>
<p>There is nothing wrong with big companies sending their representatives to SNIA and DMTF meetings to talk about standardization. In fact, this is a great way to discuss ideas and begin to orient the industry. But the time for standards has not yet come, and users of cloud services have no need to wait for them. In fact, waiting for a standard will just prolong the maturation of cloud services, since <strong>real-world applications are the external pressure that forces evolutionary selection</strong>. Amazon would never have created their virtual private cloud (VPC) capability without customer input, and they will never perfect this capability if they rely only on pundits, bloggers, and product marketers.</p>
<p>Even when standards do appear, they will not eliminate per-solution APIs. Cloud service providers will continue to explore new concepts, and these will appear first in &#8220;proprietary&#8221; interfaces. Perhaps they will use entirely unique calls, or perhaps they will leverage reserved or unassigned sections of the standard, but innovation will continue. Witness the radical changes in HTML versions to date, the additions to CSS, and the wide world of browser plugins.</p>
<p>So we don&#8217;t need cloud standards yet. They will come, whether artificially pushed by committees or evolving through use, but <strong>only useful standards will survive</strong>. Isn&#8217;t that just how it should be?</p>
<blockquote><p>Note: I am employed by <a href="http://www.nirvanix.com/"  target="_blank">Nirvanix</a>, a cloud managed storage service provider, providing independent cloud strategy advice as Director of Consulting. Although this article was not created for my employer and is not intended to reflect their views, my perceptions are obviously colored by my daily work.</p>
</blockquote>
<div id="crp_related"><h3>You might also want to read these other posts...</h3><ul><li><a href="http://blog.fosketts.net/2009/09/22/zend-simple-cloud-api/"  rel="bookmark" class="crp_title">Zend Simple Cloud API = Freedom!</a></li><li><a href="http://blog.fosketts.net/2009/07/01/cloudstuff-stuff-cloud/"  rel="bookmark" class="crp_title">CloudStuff Versus Stuff in the Cloud</a></li><li><a href="http://blog.fosketts.net/2009/05/19/lessons-cloud-computing-conference-expo-prague-2009/"  rel="bookmark" class="crp_title">Lessons From the Cloud Computing Conference and Expo Prague 2009</a></li><li><a href="http://blog.fosketts.net/2009/03/19/sun-cloud/"  rel="bookmark" class="crp_title">Sun Launches Their Own Cloud, But For Which Market?</a></li><li><a href="http://blog.fosketts.net/2009/04/23/cloud-slam-storage-panel/"  rel="bookmark" class="crp_title">Cloud Slam Storage Panel: This Will Be Interesting</a></li></ul></div><script src="http://feeds.feedburner.com/~s/sfoskett?i=http://blog.fosketts.net/2009/09/16/cloud-services-standards/" type="text/javascript" charset="utf-8"></script><hr />
<p><small>© sfoskett for <a href="http://blog.fosketts.net">Stephen Foskett, Pack Rat</a>, 2009. |
<a href="http://blog.fosketts.net/2009/09/16/cloud-services-standards/">We Don&#8217;t Need Cloud Standards (Yet)</a>
<br/>
This post was categorized as <a href="http://blog.fosketts.net/category/everything/computerhistory/" title="View all posts in Computer History" rel="category tag">Computer History</a>, <a href="http://blog.fosketts.net/category/everything/enterprisestorage/" title="View all posts in Enterprise storage" rel="category tag">Enterprise storage</a>, <a href="http://blog.fosketts.net/category/gestaltit/" title="View all posts in Gestalt IT" rel="category tag">Gestalt IT</a>, <a href="http://blog.fosketts.net/category/everything/virtualstorage/" title="View all posts in Virtual Storage" rel="category tag">Virtual Storage</a>. Each of my categories has its own feed if you'd like to filter out or focus on posts like this.<br/>
</small></p>]]></content:encoded>
			<wfw:commentRss>http://blog.fosketts.net/2009/09/16/cloud-services-standards/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

