<?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>LinuxSoftware &#187; tunnel</title>
	<atom:link href="http://linuxsoftware.co.nz/blog/tag/tunnel/feed" rel="self" type="application/rss+xml" />
	<link>http://linuxsoftware.co.nz/blog</link>
	<description>Coding and tramping in Aotearoa / New Zealand</description>
	<lastBuildDate>Fri, 03 Feb 2012 23:57:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Website Mirroring</title>
		<link>http://linuxsoftware.co.nz/blog/2008/04/website-mirroring</link>
		<comments>http://linuxsoftware.co.nz/blog/2008/04/website-mirroring#comments</comments>
		<pubDate>Sat, 26 Apr 2008 23:23:26 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[LCA2008]]></category>
		<category><![CDATA[LinuxSoftware]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mirror]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[tunnel]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://linuxsoftware.co.nz/blog/2008/04/27/website-mirroring</guid>
		<description><![CDATA[How can you be really confident of your backups? My cunning plan is to mirror my whole website back onto my home box so I can see that I have all the data safely duplicated. When I say &#8220;my plan&#8221; I really mean I stole the idea off Ralph who has had his web site [...]]]></description>
			<content:encoded><![CDATA[<p>How can you be really confident of your backups?  My cunning plan is to mirror my whole <a href="/wiki/Website">website</a> back onto my home box so I can see that I have all the data safely duplicated.  When I say &#8220;my plan&#8221; I really mean I stole the idea off <a href="http://homepages.ihug.co.nz/~suckfish">Ralph</a> who has had his web site served both from ihug and from his home box for ~4 years.</p>
<p>The content on mysite is in the <a href="/wiki/MySQL">MySQL</a> database and various files.  The files are easy to mirror with rsync.  Getting the database <a href="http://dev.mysql.com/doc/refman/5.1/en/replication-howto.html">mirrored</a> has been a lot more fun.</p>
<p><img src="http://linuxsoftware.co.nz/wiki/Website?action=AttachFile&amp;do=get&amp;target=webmirror.png" /></p>
<p>I use a SSH tunnel to securely connect the database on the webserver with its mirror on my home box.  MySQL can support <a href="http://dev.MySQL.com/doc/refman/5.1/en/secure-using-ssl.html">SSL</a> connections, but using a tunnel seemed easier.  I didn&#8217;t want to enslave the main MySQL server on my home box so instead I run a new MySQL server with a custom socket and port.  I then set this up to connect to the master server on the webserver.  The commands for this are in <a href="/wiki/Website?action=AttachFile&amp;do=view&amp;target=localdbsetup.sh">localdbsetup.sh</a>.</p>
<p>Every half an hour I have a cron job run <a href="http:/wiki/Website?action=AttachFile&amp;do=view&amp;target=localsync.sh">localsync.sh</a> which rsyncs the files across and checks that the MySQL replication is still running.  I can check my data is ok just by looking at the mirrored website.  Then each night <a href="/wiki/Website?action=AttachFile&amp;do=view&amp;target=localbkup.sh">localbkup.sh</a> runs to dump the data from the mirror and tarball it up.</p>
<p>Seems to be <a href="http://linux.software.gen.nz">working</a> pretty well.  Yes, it is massive overkill just for a simple website backup, but it was an interesting project for the long weekend.</p>
]]></content:encoded>
			<wfw:commentRss>http://linuxsoftware.co.nz/blog/2008/04/website-mirroring/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

