<?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>Bashton Blog &#187; apache</title>
	<atom:link href="http://blog.bashton.com/tag/apache/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.bashton.com</link>
	<description>Bashton Ltd</description>
	<lastBuildDate>Tue, 13 Apr 2010 05:30:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Why Tornado shows the future of Web Servers, but not for the reason you might think</title>
		<link>http://blog.bashton.com/2009/why-tornado-shows-the-future-of-web-servers-but-not-for-the-reason-you-might-think/</link>
		<comments>http://blog.bashton.com/2009/why-tornado-shows-the-future-of-web-servers-but-not-for-the-reason-you-might-think/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 10:48:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Speculation]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[tornado]]></category>

		<guid isPermaLink="false">http://blog.bashton.com/?p=252</guid>
		<description><![CDATA[There&#8217;s been a lot of discussion around the release of Tornado, the web server that powers FriendFeed, which was recently Open Sourced.
Most of this discussion revolves around the technical merits of Tornado; whether other platforms are quicker, or whether it&#8217;s too limited.  Whilst interesting, I think that many of these discussions are rather missing the [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s been a lot of discussion around the release of <a href="http://www.tornadoweb.org/">Tornado</a>, the web server that powers FriendFeed, which was recently Open Sourced.</p>
<p>Most of this discussion revolves around the technical merits of Tornado; whether other platforms are quicker, or whether it&#8217;s too limited.  Whilst interesting, I think that many of these discussions are rather missing the point.</p>
<p>What I find interesting about FriendFeed is that it was built primarily because of the requirements of the way the FriendFeed site works.  To give an overview without getting too much into the technical details, the difference is in the way real-time data is updated.<br />
The way pretty much every other website works with regards to updating data is to poll for updates at regular intervals.  FriendFeed works differently; they create a connection to the server, and sit there waiting for an update.  When an update does happen, it displays immediately, because there&#8217;s no need to wait for a polling update to run.<br />
A website that works like this, with every user having a connection open waiting for an update, isn&#8217;t feasible to create when using a mainstream web server (Apache, Nginx, IIS), because they are designed with the older &#8216;open a connection, send the data, close the connection&#8217; way of working in mind.</p>
<p>I expect that as desktop software dies out and everything moves to a web-based &#8217;software-as-a-service&#8217; approach it will become increasingly common that parts of the site will run on custom-written software.  The days of the dominance of Apache are over, not because another better webserver daemon has come along, but because with increasingly complex webapps one size no longer fits all.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bashton.com/2009/why-tornado-shows-the-future-of-web-servers-but-not-for-the-reason-you-might-think/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Move a Website Without Downtime</title>
		<link>http://blog.bashton.com/2008/how-to-move-a-website-without-downtime/</link>
		<comments>http://blog.bashton.com/2008/how-to-move-a-website-without-downtime/#comments</comments>
		<pubDate>Wed, 30 Jul 2008 14:46:22 +0000</pubDate>
		<dc:creator>sam</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[howto]]></category>

		<guid isPermaLink="false">http://blog.bashton.com/2008/how-to-move-a-website-without-downtime/</guid>
		<description><![CDATA[The scenario:
You have a website you need to move to a new web server on a new IP address.  You intend to keep the domain and all URLs the same.
By utilising the Apache module mod_proxy we can make sure that all requests are sent to the correct server, despite any cached DNS entries which [...]]]></description>
			<content:encoded><![CDATA[<h3>The scenario:</h3>
<p>You have a website you need to move to a new web server on a new IP address.  You intend to keep the domain and all URLs the same.</p>
<p>By utilising the Apache module <a href="http://httpd.apache.org/docs/2.0/mod/mod_proxy.html">mod_proxy</a> we can make sure that all requests are sent to the correct server, despite any cached DNS entries which are pointing to the old IP.  Whilst this isn&#8217;t too much of a problem for static web-sites, for modern, database driven sites it is vital that all data is written to the correct location.  One particular benefit feature of this approach is that you can move just a single VirtualHost, where other approaches expect you to be moving everything hosted on that server.<br />
<span id="more-42"></span></p>
<h3>Pre-requisites:</h3>
<ul>
<li>Apache and mod_proxy on the server you are moving from</li>
<li>Access to the Apache configuration files on the server you are moving from</li>
<li>Control over the DNS for your domain</li>
</ul>
<h3>The Science Bit</h3>
<p>Essentially, what we&#8217;re going to do is make the old server into a &#8216;reverse proxy&#8217;, so it will forward all requests on to the new server, then return the reply to the client.  One thing to watch out for is scripts that do checking based on the remote IP address, as this will be seen as the old server&#8217;s IP for proxied connections.</p>
<h3>The Procedure</h3>
<h4>Testing on the new server</h4>
<p>First, I&#8217;d recommend taking a copy of your website and putting it up on the new server to test that everything is OK.  You can view the website on the new server by making an entry in your &#8216;hosts&#8217; file on your local machine(/etc/hosts on Linux/Mac OS X, c:\windows\system32\drivers\etc on Windows).  An example entry is below:</p>
<pre>
  # Temporary entry for www.example.com on the new server

  192.168.0.5   www.example.com</pre>
<p>Once you&#8217;ve ascertained that everything is working correctly on the new server, we can begin the process of moving the website.</p>
<h4>Disable updates</h4>
<p>Firstly, we need to stop any modifications to the site/database, so you might want to put up an &#8216;under maintenance&#8217; page.  Many applications (Wordpress comes to mind) already include this feature, so it could be as simple as ticking a box and hitting save.  An important thing to remember here is that just putting up a page on the front of your site isn&#8217;t going to be enough &#8211; people will be following deep links and/or already using the site.</p>
<h4>Copy the site across</h4>
<p>Take a copy of the site, move it to the new server and disable the &#8216;under maintenance&#8217; page on the server you&#8217;re moving to.  You might want to double-check everything is OK on the new server at this point, as pretty soon we&#8217;re going to hit the point of no (easy) return.</p>
<h4>Edit the hosts file on the server</h4>
<p>Next, add the hosts entry you made on your local machine to the hosts file on the server you&#8217;re moving from.  You need this because we&#8217;re going to be proxying to the new server by hostname &#8211; if the old server still thinks it&#8217;s hosting the domain, we&#8217;re going to get ourselves in an infinite loop.</p>
<h4>Alter the Apache Config</h4>
<p>Now here&#8217;s where the actual proxying part comes in.  In the VirtualHost declaration for the website you want to move, replace the existing config with the following:</p>
<pre>
  ServerName www.example.com  ProxyRequests Off

&lt;Proxy *&gt;

    Order deny,allow

    Allow from all

  &lt;/Proxy&gt;

ProxyPass / http://www.example.com/

  ProxyPassReverse / http://www.example.com/</pre>
<p>It&#8217;s also probably a good idea to leave your log statements intact &#8211; this way you can see how many hits to the old IP you&#8217;re getting.</p>
<p>Now run a config check (<em>apachectl configtest</em>), and reload the Apache configuration.</p>
<p>Remove the entry you made in your local hosts file earlier, and verify that the proxy is indeed working.  If all is well, you should see an entry in your Apache log on your old server, and an entry in the Apache log on the new server showing the IP of the old server a<br />
s the client.</p>
<h4>Move DNS</h4>
<p>Now the proxying is set up and we&#8217;ve verified it all as working, it&#8217;s time to switch the DNS across to the new IP address.  From now on you&#8217;ll gradually get more and more connections directly to the new server.</p>
<p>After a week or two it should be safe to remove the configuration from the old server &#8211; I&#8217;d suggest checking the logs to ascertain when the last connection was received to the previous server.  If it&#8217;s been more than a week, you&#8217;re probably safe.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bashton.com/2008/how-to-move-a-website-without-downtime/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
