<?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>TheRosiek.com</title>
	<atom:link href="http://therosiek.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://therosiek.com</link>
	<description>Random tech notes and tutorials</description>
	<lastBuildDate>Mon, 02 Aug 2010 13:35:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Server path error in vSphere 4.1</title>
		<link>http://therosiek.com/2010/07/server-path-error-in-vsphere-4-1/</link>
		<comments>http://therosiek.com/2010/07/server-path-error-in-vsphere-4-1/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 03:38:23 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Tech Notes]]></category>
		<category><![CDATA[VMware]]></category>

		<guid isPermaLink="false">http://therosiek.com/?p=160</guid>
		<description><![CDATA[First off, this is related to the post in VMware Communities here: http://communities.vmware.com/message/1576370 I recently updated a VMware Infrastructure to vCenter 4.1. All ESX servers were still on ESXi 3.5. This shouldn&#8217;t be a problem, you just can&#8217;t use some of the new features available in 4.1. That&#8217;s fine, except that I couldn&#8217;t view the ]]></description>
			<content:encoded><![CDATA[<p>First off, this is related to the post in VMware Communities here: <a href="http://communities.vmware.com/message/1576370">http://communities.vmware.com/message/1576370</a></p>
<p>I recently updated a VMware Infrastructure to vCenter 4.1.  All ESX servers were still on ESXi 3.5.  This shouldn&#8217;t be a problem, you just can&#8217;t use some of the new features available in 4.1.  That&#8217;s fine, except that I couldn&#8217;t view the managed paths in the ESX servers.  I would get the error below.  I would get the same error when trying to manually migrate a virtual machine to a different ESX server.</p>
<p><a href="http://therosiek.com/wp-content/uploads/2010/07/vmware-storage-error1.png"><img src="http://therosiek.com/wp-content/uploads/2010/07/vmware-storage-error1-300x222.png" alt="vmware error" title="vmware-storage-error1" width="300" height="222" class="size-medium wp-image-159" /></a></p>
<p>You can see the error states <strong>Item has already been added.  Key in dictionary: &#8216;Vmomi.Host.PlugStoreTopology+Path&#8217; Key being added: &#8216;Vmomi.Host.PlugStoreTopology+Path&#8217;</strong>.  And of course you can see that two entries are listed.</p>
<p>I tried multiple solutions, including completely reinstalling vCenter with a new database and reconfiguring.  Restarting the ESX servers didn&#8217;t matter.  The real solution was upgrading all of the ESXi servers to 4.1.  This shouldn&#8217;t seem necessary, but the upgrade through Upgrade Manager (they got rid of the Host Update Utility after 4.0) was relatively easy and smooth.  After having issues with vCenter 4.1 I was reluctant to move the ESX servers there, but so far everything is working great, including migrations and managed paths.</p>
]]></content:encoded>
			<wfw:commentRss>http://therosiek.com/2010/07/server-path-error-in-vsphere-4-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Latest and greatest Subversion on Debian Lenny</title>
		<link>http://therosiek.com/2010/07/latest-and-greatest-subversion-on-debian-lenny/</link>
		<comments>http://therosiek.com/2010/07/latest-and-greatest-subversion-on-debian-lenny/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 14:13:37 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Tech Notes]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Subversion]]></category>

		<guid isPermaLink="false">http://therosiek.com/?p=157</guid>
		<description><![CDATA[Debian has its own package for Subversion, but most of the time you want to use the latest Subversion package that&#8217;s out there. This explains how to build and use that over Apache and HTTPS. Installation Configuration Maintenance and Use Installation This particular install does not use the Berkeley DB method of code repository storage, ]]></description>
			<content:encoded><![CDATA[<p>Debian has its own package for Subversion, but most of the time you want to use the latest Subversion package that&#8217;s out there.  This explains how to build and use that over Apache and HTTPS.</p>
<ul>
<li><a href="#1">Installation</a></li>
<li><a href="#2">Configuration</a></li>
<li><a href="#3">Maintenance and Use</a></li>
</ul>
<hr />
<p><a name="1"></a></p>
<h2>Installation</h2>
<p>This particular install does not use the Berkeley DB method of code repository storage, but rather the flat file system storage method. Both have their advantages, but the file is believed to be faster. Read more <a href="http://svnbook.red-bean.com/en/1.5/svn.reposadmin.planning.html#svn.reposadmin.basics.backends">here</a>.</p>
<p>First setup Apache and get all the Subversion dependencies.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> apache2<br />
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> build-dep subversion<br />
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<br />
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>subversion.tigris.org<span style="color: #000000; font-weight: bold;">/</span>downloads<span style="color: #000000; font-weight: bold;">/</span>subversion-1.6.11.tar.gz<br />
<span style="color: #c20cb9; font-weight: bold;">tar</span> zxvf subversion -1.6.11.tar.gz<br />
<span style="color: #7a0874; font-weight: bold;">cd</span> subversion-1.6.11<br />
.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span></div></div>
<p>Then we get this warning, but FSFS is fine to use instead of Berkeley.</p>
<pre>configure: WARNING: we have configured without BDB filesystem support

You don't seem to have Berkeley DB version 4.0.14 or newer
installed and linked to APR-UTIL.  We have created Makefiles which
will build without the Berkeley DB back-end; your repositories will
use FSFS as the default back-end.  You can find the latest version of
Berkeley DB here:

http://www.oracle.com/technology/software/products/berkeley-db/index.html</pre>
<p>Continue with the build:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">make</span><br />
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></div></div>
<p>After install, this error comes up, but it can be ignored and the next few steps will fix.</p>
<pre>apxs:Error: Activation failed for custom /etc/apache2/httpd.conf file..
apxs:Error: At least one `LoadModule' directive already has to exist..
make: *** [install-mods-shared] Error 1</pre>
<p>Create the file <strong>/etc/apache2/mods-available/dav_svn.load</strong> with the following:</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># Depends: dav<br />
LoadModule dav_svn_module /usr/lib/apache2/modules/mod_dav_svn.so<br />
LoadModule authz_svn_module /usr/lib/apache2/modules/mod_authz_svn.so</div></div>
<p>Copy over the modules from source and install them in the Apache directories; also enable SSL since we want to push this over a secure channel:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>subversion-1.6.11<span style="color: #000000; font-weight: bold;">/</span>subversion<span style="color: #000000; font-weight: bold;">/</span>mod_dav_svn<span style="color: #000000; font-weight: bold;">/</span>.libs<span style="color: #000000; font-weight: bold;">/</span>mod_dav_svn.so <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>modules<span style="color: #000000; font-weight: bold;">/</span><br />
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>subversion-1.6.11<span style="color: #000000; font-weight: bold;">/</span>subversion<span style="color: #000000; font-weight: bold;">/</span>mod_authz_svn<span style="color: #000000; font-weight: bold;">/</span>.libs<span style="color: #000000; font-weight: bold;">/</span>mod_authz_svn.so <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>modules<span style="color: #000000; font-weight: bold;">/</span><br />
a2enmod dav_svn<br />
a2enmod ssl</div></div>
<p><a name="2"></a></p>
<h2>Configuration</h2>
<p>Create the file <strong>/etc/apache2/sites-available/svn</strong> so that Apache knows about the SVN repository:</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">NameVirtualHost svn.mysite.com:443<br />
<br />
&lt;VirtualHost svn.mysite.com:443&gt;<br />
<br />
DocumentRoot /var/svn<br />
<br />
# SSL Definitions<br />
SSLEngine on<br />
SSLCertificateFile /etc/ssl/private/myserver_svn.crt<br />
SSLCertificateKeyFile /etc/ssl/private/myserver_svn.key<br />
<br />
# Subversion<br />
&lt;Location /svn&gt;<br />
&nbsp; &nbsp; DAV svn<br />
&nbsp; &nbsp; SVNListParentPath on<br />
&nbsp; &nbsp; SVNParentPath /var/svn<br />
&nbsp; &nbsp; AuthType Basic<br />
&nbsp; &nbsp; AuthName &quot;Subversion Repository&quot;<br />
&nbsp; &nbsp; AuthUserFile /etc/svn/dav_svn.passwd<br />
&nbsp; &nbsp; AuthzSVNAccessFile /etc/svn/dav_svn.control<br />
&nbsp; &nbsp; Require valid-user<br />
&lt;/Location&gt;<br />
&lt;/VirtualHost&gt;</div></div>
<p>Now enable the site and start/restart Apache:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">a2ensite <span style="color: #c20cb9; font-weight: bold;">svn</span><br />
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>apache2 restart</div></div>
<p>Setup the initial repository with the svncreate command and make the user running the web service the owner, since they will be the user actually modifying the repository files.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">svn</span><br />
<span style="color: #c20cb9; font-weight: bold;">svnadmin</span> create <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>myproject<br />
<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> www-data:www-data <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>myproject</div></div>
<p>Now we can create the username/password files along with the access files.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">svn</span><br />
<span style="color: #c20cb9; font-weight: bold;">touch</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>dav_svn.passwd<br />
htpasswd <span style="color: #660033;">-mb</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>dav_svn.passwd myuser mypassword</div></div>
<p>Create the access file to your repositories.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">touch</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>dav_svn.control</div></div>
<p>And now edit the file. You can set users using r and rw access writes. First you list the repository, and then the folder location after that for more fine grained permissions.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">[myproject:/]<br />
myuser = r<br />
<br />
[myproject:/trunk/base/code]<br />
myuser = rw</div></div>
<p>Now reboot the server and test access; it should start up automatically.</p>
<p><a name="3"></a></p>
<h2>Maintenance and Use</h2>
<p>The best way to use SVN over HTTPS is with Tortoise for Windows or some other tool if using Linux, like RapidSVN.</p>
<h3>Adding Additional Users</h3>
<p>To add more users, just run the htpasswd command linked to your <strong>dav_svn.passwd</strong> file, same as the initial configuration for users.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">htpasswd <span style="color: #660033;">-mb</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>dav_svn.passwd newuser newpassword</div></div>
<p>And now edit the access file containing the other users and defined in the Apache configuration. You can set users using r and rw access writes. First you list the repository, and then the folder location after that for more fine grained permissions.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">[myproject:/]<br />
myuser = r<br />
newuser = r<br />
<br />
[myproject:/trunk/base/code]<br />
myuser = rw<br />
newuser = rw</div></div>
<h3>Backing Up the Repositories</h3>
<p>To backup a repository, use the svnadmin dump command which will export the entire database and revisions. You can then tar up and gzip the dump file for compression, and back it up to tape or disk somewhere else. There are also incremental backups that can be done of disk/tape space is an issue.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">svnadmin</span> dump <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>myproject <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>backups<span style="color: #000000; font-weight: bold;">/</span>myproject_dumpfile</div></div>
<h3>Restoring the Repositories</h3>
<p>Restoring the SVN database is simply rewriting all the revisions from the dump back into a database. The restore process also works well for moving an older repository over to a new one since restoring the dump into a new SVN database will update it to that version.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">svnadmin</span> create <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>restoredproject<br />
<span style="color: #c20cb9; font-weight: bold;">svnadmin</span> load <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>restoredproject <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>backups<span style="color: #000000; font-weight: bold;">/</span>myproject_dumpfile<br />
<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> www-data:www-data <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>restoredproject<br />
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #660033;">-R</span> <span style="color: #000000;">770</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>restoredproject</div></div>
]]></content:encoded>
			<wfw:commentRss>http://therosiek.com/2010/07/latest-and-greatest-subversion-on-debian-lenny/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Duplicity Install and Backup Samples</title>
		<link>http://therosiek.com/2010/01/duplicity-install-and-backup-samples/</link>
		<comments>http://therosiek.com/2010/01/duplicity-install-and-backup-samples/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 17:54:45 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Tech Notes]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OpenBSD]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://therosiek.com/?p=150</guid>
		<description><![CDATA[Duplicity is a backup tool that works off of rsync and rdiff libraries to copy only changes to a backup location. It can use compression and encryption tools on the data and also has the ability to save to Amazon&#8217;s S3 service. More details can be found here. Installation on OpenBSD 4.4 Installation on OpenBSD ]]></description>
			<content:encoded><![CDATA[<p>Duplicity is a backup tool that works off of rsync and rdiff libraries to copy only changes to a backup location. It can use compression and encryption tools on the data and also has the ability to save to Amazon&#8217;s S3 service. More details can be found <a href="http://duplicity.nongnu.org/">here</a>.</p>
<ul>
<li><a href="#1">Installation on OpenBSD 4.4</a></li>
<li><a href="#2">Installation on OpenBSD 4.6</a></li>
<li><a href="#3">Installation on Debian Lenny 5.0</a></li>
<li><a href="#4">Sample Backup Scripts</a></li>
</ul>
<hr />
<p><a name="1"></a></p>
<h2>Installation on OpenBSD 4.4</h2>
<p>The 4.4 version was the most difficult to get working since the majority of the issues came from the given OpenBSD libraries. Even installing the Duplicity port from the packages didn&#8217;t function right.</p>
<p>First we need to add a few packages. You can use the <strong>pkg_add</strong> function with whatever mirror to obtain the following, some depend on others so there will be others in the file install list:</p>
<ul>
<li>python-2.5.2p4</li>
<li>py-boto-1.3</li>
<li>gpgme-1.1.5</li>
<li>librsync-0.9.7</li>
<li>ncftp-3.2.1</li>
</ul>
<p>When the main Python package is installed, it will ask you to create a few symbolic links, so create those.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-sf</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>python2.5 <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>python<br />
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-sf</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>pydoc2.5 &nbsp;<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>pydoc</div></div>
<p>Version 4.4 needs a separate Python XML package to work properly. If it&#8217;s not installed, you&#8217;ll get a series of errors when trying to send data to S3; I believe the XML error is when it tries to read the response. Something like this will error out:</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Traceback (most recent call last):<br />
&nbsp; File &quot;/usr/local/bin/duplicity&quot;, line 482, in &lt;module&gt;<br />
&nbsp; &nbsp; with_tempdir(main)<br />
&nbsp; File &quot;/usr/local/bin/duplicity&quot;, line 477, in with_tempdir<br />
&nbsp; &nbsp; fn()<br />
&nbsp; File &quot;/usr/local/bin/duplicity&quot;, line 468, in main<br />
&nbsp; &nbsp; full_backup(col_stats)<br />
&nbsp; File &quot;/usr/local/bin/duplicity&quot;, line 174, in full_backup<br />
&nbsp; &nbsp; col_stats.set_values(sig_chain_warning = None).cleanup_signatures()<br />
&nbsp; File &quot;/usr/obj/ports/duplicity-0.4.12/fake-amd64/usr/local/lib/python2.5/site-packages/duplicity/collections.py&quot;, line 476, in set_values<br />
&nbsp; File &quot;/usr/obj/ports/duplicity-0.4.12/fake-amd64/usr/local/lib/python2.5/site-packages/duplicity/backends.py&quot;, line 802, in list<br />
&nbsp; File &quot;/usr/local/lib/python2.5/site-packages/boto/s3/bucketlistresultset.py&quot;, line 31, in bucket_lister<br />
&nbsp; &nbsp; delimiter=delimiter)<br />
&nbsp; File &quot;/usr/local/lib/python2.5/site-packages/boto/s3/bucket.py&quot;, line 205, in get_all_keys<br />
&nbsp; &nbsp; xml.sax.parseString(body, h)<br />
&nbsp; File &quot;/usr/local/lib/python2.5/xml/sax/__init__.py&quot;, line 43, in parseString<br />
&nbsp; &nbsp; parser = make_parser()<br />
&nbsp; File &quot;/usr/local/lib/python2.5/xml/sax/__init__.py&quot;, line 93, in make_parser<br />
&nbsp; &nbsp; raise SAXReaderNotAvailable(&quot;No parsers found&quot;, None)<br />
xml.sax._exceptions.SAXReaderNotAvailable: No parsers found</div></div>
<p>To avoid that, a separate Python XML package needs to be downloaded and installed:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<br />
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>downloads.sourceforge.net<span style="color: #000000; font-weight: bold;">/</span>project<span style="color: #000000; font-weight: bold;">/</span>pyxml<span style="color: #000000; font-weight: bold;">/</span>pyxml<span style="color: #000000; font-weight: bold;">/</span>0.8.4<span style="color: #000000; font-weight: bold;">/</span>PyXML-0.8.4.tar.gz<br />
<span style="color: #c20cb9; font-weight: bold;">tar</span> zxvf PyXML-0.8.4.tar.gz<br />
<span style="color: #7a0874; font-weight: bold;">cd</span> PyXML-0.8.4<br />
python setup.py <span style="color: #c20cb9; font-weight: bold;">install</span></div></div>
<p>Now we can install Duplicity.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<br />
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>code.launchpad.net<span style="color: #000000; font-weight: bold;">/</span>duplicity<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">0.6</span>-series<span style="color: #000000; font-weight: bold;">/</span>0.6.06<span style="color: #000000; font-weight: bold;">/</span>+download<span style="color: #000000; font-weight: bold;">/</span>duplicity-0.6.06.tar.gz<br />
<span style="color: #7a0874; font-weight: bold;">cd</span> duplicity-0.6.06<br />
python setup.py <span style="color: #660033;">--librsync-dir</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span> build<br />
python setup.py <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span></div></div>
<p>If you run the Duplicity jobs as root in a cron job, there is something about OpenBSD (I&#8217;m sure a security issue) that causes it to fail. I would get the output below in my log only when it ran as a cron job:</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Traceback (most recent call last):<br />
&nbsp; File &quot;/usr/local/bin/duplicity&quot;, line 583, in &lt;module&gt;<br />
&nbsp; &nbsp; with_tempdir(main)<br />
&nbsp; File &quot;/usr/local/bin/duplicity&quot;, line 577, in with_tempdir<br />
&nbsp; &nbsp; fn()<br />
&nbsp; File &quot;/usr/local/bin/duplicity&quot;, line 558, in main<br />
&nbsp; &nbsp; full_backup(col_stats)<br />
&nbsp; File &quot;/usr/local/bin/duplicity&quot;, line 234, in full_backup<br />
&nbsp; &nbsp; bytes_written = write_multivol(&quot;full&quot;, tarblock_iter, globals.backend)<br />
&nbsp; File &quot;/usr/local/bin/duplicity&quot;, line 148, in write_multivol<br />
&nbsp; &nbsp; globals.gpg_profile, globals.volsize)<br />
&nbsp; File &quot;/usr/local/lib/python2.5/site-packages/duplicity/gpg.py&quot;, line 240, in GPGWriteFile<br />
&nbsp; &nbsp; bytes_to_go = data_size - get_current_size()<br />
&nbsp; File &quot;/usr/local/lib/python2.5/site-packages/duplicity/gpg.py&quot;, line 232, in get_current_size<br />
&nbsp; &nbsp; return os.stat(filename).st_size<br />
OSError: [Errno 2] No such file or directory:'/tmp/duplicity-gM4CN9-tempdir/mktemp-iZknw0-2'</div></div>
<p>Odd that it can&#8217;t read the temporary folder that it created. Changing the folder location also did not work. The solution is to create a separate user for only backups. The can be an issue if you have files that cannot be read by all users and need backup, but I found in my case this worked for the specific files that needed to be saved.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">useradd <span style="color: #660033;">-m</span> <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>dpbackup <span style="color: #660033;">-c</span> <span style="color: #ff0000;">'Duplicity'</span> dpbackup<br />
usermod <span style="color: #660033;">-G</span> nogroup dpbackup<br />
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>dpbackup<span style="color: #000000; font-weight: bold;">/</span>log</div></div>
<p>Make sure to add the new user to the deny list in SSH with <strong>DenyUsers dpbackup</strong> in the file <em>/etc/ssh/sshd_config</em>; there isn&#8217;t any reason for it to log in.</p>
<p>Now su as this new user. A GPG key needs to be created so that the compressed backups can be encrypted and signed. This way no one else that may have access to our S3 account (Amazon employees) can read the data.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">su</span> dpbackup<br />
$ <span style="color: #7a0874; font-weight: bold;">cd</span><br />
$ gpg <span style="color: #660033;">--list-keys</span><br />
gpg: directory <span style="color: #000000; font-weight: bold;">`/</span>root<span style="color: #000000; font-weight: bold;">/</span>.gnupg<span style="color: #ff0000;">' created<br />
gpg: new configuration file `/root/.gnupg/gpg.conf'</span> created<br />
gpg: WARNING: options <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`/</span>root<span style="color: #000000; font-weight: bold;">/</span>.gnupg<span style="color: #000000; font-weight: bold;">/</span>gpg.conf<span style="color: #ff0000;">' are not yet active during this run<br />
gpg: keyring `/root/.gnupg/pubring.gpg'</span> created<br />
gpg: <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>.gnupg<span style="color: #000000; font-weight: bold;">/</span>trustdb.gpg: trustdb created<br />
<br />
$ gpg <span style="color: #660033;">--gen-key</span></div></div>
<p>There will be a series of questions, most of the defaults are fine.</p>
<ul>
<li>Choose option 1 for DSA and Elgamal (the default)</li>
<li>Choose the default key size of 2048</li>
<li>Leave the default that the key will not expire, option 0</li>
<li>Enter a User ID, Email address, and comment for the key.</li>
<li>Type O for OK to accept.</li>
<li>Enter a long passphrase for the key and allow it to be generated. I usually do at least 20 characters since the password will just sit in a script anyway. </li>
</ul>
<p>Move the keys to some other safe place so that they can&#8217;t be lost. No key means the backups are worthless. Typically a second backup source is a good idea.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">tar</span> cf gpg_keys.tar .gnupg<span style="color: #000000; font-weight: bold;">/</span><br />
$ <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">600</span> gpg_keys.tar</div></div>
<p>See sample scripts below for backup jobs.</p>
<hr />
<p><a name="2"></a></p>
<h2>Installation on OpenBSD 4.4</h2>
<p>The 4.4 version was the most difficult to get working since the majority of the issues came from the given OpenBSD libraries. Even installing the Duplicity port from the packages didn&#8217;t function right.</p>
<p>First we need to add a few packages. You can use the <strong>pkg_add</strong> function with whatever mirror to obtain the following, some depend on others so there will be others in the file install list:</p>
<ul>
<li>python-2.5.4p1</li>
<li>py-xml-0.8.4p8</li>
<li>py-boto-1.7a</li>
<li>gpgme-1.1.5p0</li>
<li>librsync-0.9.7p0</li>
<li>ncftp-3.2.2 </li>
</ul>
<p>When the main Python package is installed, it will ask you to create a few symbolic links, so create those.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-sf</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>python2.5 <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>python<br />
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-sf</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>python2.5-config <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>python-config<br />
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-sf</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>pydoc2.5 <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>pydoc</div></div>
<p>Now we can install Duplicity.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<br />
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>code.launchpad.net<span style="color: #000000; font-weight: bold;">/</span>duplicity<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">0.6</span>-series<span style="color: #000000; font-weight: bold;">/</span>0.6.06<span style="color: #000000; font-weight: bold;">/</span>+download<span style="color: #000000; font-weight: bold;">/</span>duplicity-0.6.06.tar.gz<br />
<span style="color: #7a0874; font-weight: bold;">cd</span> duplicity-0.6.06<br />
python setup.py <span style="color: #660033;">--librsync-dir</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span> build<br />
python setup.py <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span></div></div>
<p>If you run the Duplicity jobs as root in a cron job, there is something about OpenBSD (I&#8217;m sure a security issue) that causes it to fail. I would get the output below in my log only when it ran as a cron job:</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Traceback (most recent call last):<br />
&nbsp; File &quot;/usr/local/bin/duplicity&quot;, line 583, in &lt;module&gt;<br />
&nbsp; &nbsp; with_tempdir(main)<br />
&nbsp; File &quot;/usr/local/bin/duplicity&quot;, line 577, in with_tempdir<br />
&nbsp; &nbsp; fn()<br />
&nbsp; File &quot;/usr/local/bin/duplicity&quot;, line 558, in main<br />
&nbsp; &nbsp; full_backup(col_stats)<br />
&nbsp; File &quot;/usr/local/bin/duplicity&quot;, line 234, in full_backup<br />
&nbsp; &nbsp; bytes_written = write_multivol(&quot;full&quot;, tarblock_iter, globals.backend)<br />
&nbsp; File &quot;/usr/local/bin/duplicity&quot;, line 148, in write_multivol<br />
&nbsp; &nbsp; globals.gpg_profile, globals.volsize)<br />
&nbsp; File &quot;/usr/local/lib/python2.5/site-packages/duplicity/gpg.py&quot;, line 240, in GPGWriteFile<br />
&nbsp; &nbsp; bytes_to_go = data_size - get_current_size()<br />
&nbsp; File &quot;/usr/local/lib/python2.5/site-packages/duplicity/gpg.py&quot;, line 232, in get_current_size<br />
&nbsp; &nbsp; return os.stat(filename).st_size<br />
OSError: [Errno 2] No such file or directory:'/tmp/duplicity-gM4CN9-tempdir/mktemp-iZknw0-2'</div></div>
<p>Odd that it can&#8217;t read the temporary folder that it created. Changing the folder location also did not work. The solution is to create a separate user for only backups. The can be an issue if you have files that cannot be read by all users and need backup, but I found in my case this worked for the specific files that needed to be saved.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">useradd <span style="color: #660033;">-m</span> <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>dpbackup <span style="color: #660033;">-c</span> <span style="color: #ff0000;">'Duplicity'</span> dpbackup<br />
usermod <span style="color: #660033;">-G</span> nogroup dpbackup<br />
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>dpbackup<span style="color: #000000; font-weight: bold;">/</span>log</div></div>
<p>Make sure to add the new user to the deny list in SSH with <strong>DenyUsers dpbackup</strong> in the file <em>/etc/ssh/sshd_config</em>; there isn&#8217;t any reason for it to log in.</p>
<p>Now su as this new user. A GPG key needs to be created so that the compressed backups can be encrypted and signed. This way no one else that may have access to our S3 account (Amazon employees) can read the data.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">su</span> dpbackup<br />
$ <span style="color: #7a0874; font-weight: bold;">cd</span><br />
$ gpg <span style="color: #660033;">--list-keys</span><br />
gpg: directory <span style="color: #000000; font-weight: bold;">`/</span>root<span style="color: #000000; font-weight: bold;">/</span>.gnupg<span style="color: #ff0000;">' created<br />
gpg: new configuration file `/root/.gnupg/gpg.conf'</span> created<br />
gpg: WARNING: options <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`/</span>root<span style="color: #000000; font-weight: bold;">/</span>.gnupg<span style="color: #000000; font-weight: bold;">/</span>gpg.conf<span style="color: #ff0000;">' are not yet active during this run<br />
gpg: keyring `/root/.gnupg/pubring.gpg'</span> created<br />
gpg: <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>.gnupg<span style="color: #000000; font-weight: bold;">/</span>trustdb.gpg: trustdb created<br />
<br />
$ gpg <span style="color: #660033;">--gen-key</span></div></div>
<p>There will be a series of questions, most of the defaults are fine.</p>
<ul>
<li>Choose option 1 for DSA and Elgamal (the default)</li>
<li>Choose the default key size of 2048</li>
<li>Leave the default that the key will not expire, option 0</li>
<li>Enter a User ID, Email address, and comment for the key.</li>
<li>Type O for OK to accept.</li>
<li>Enter a long passphrase for the key and allow it to be generated. I usually do at least 20 characters since the password will just sit in a script anyway. </li>
</ul>
<p>Move the keys to some other safe place so that they can&#8217;t be lost. No key means the backups are worthless. Typically a second backup source is a good idea.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">tar</span> cf gpg_keys.tar .gnupg<span style="color: #000000; font-weight: bold;">/</span><br />
$ <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">600</span> gpg_keys.tar</div></div>
<p>See sample scripts below for backup jobs.</p>
<hr />
<p><a name="3"></a></p>
<h2>Installation on Debian Lenny 5.0</h2>
<p>The Debian install is a little bit simpler and can run the backup job as root inside cron. Get some install packages first:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> python python-dev librsync-dev python-boto</div></div>
<p>Install Duplicity:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<br />
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>code.launchpad.net<span style="color: #000000; font-weight: bold;">/</span>duplicity<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">0.6</span>-series<span style="color: #000000; font-weight: bold;">/</span>0.6.06<span style="color: #000000; font-weight: bold;">/</span>+download<span style="color: #000000; font-weight: bold;">/</span>duplicity-0.6.06.tar.gz<br />
<span style="color: #c20cb9; font-weight: bold;">tar</span> zxvf duplicity-0.6.06.tar.gz<br />
<span style="color: #7a0874; font-weight: bold;">cd</span> duplicity-0.6.06<br />
python setup.py build<br />
python setup.py <span style="color: #c20cb9; font-weight: bold;">install</span></div></div>
<p>Creating a user is optional, but good security practice for it not to be root.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">useradd <span style="color: #660033;">-m</span> <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>dpbackup <span style="color: #660033;">-c</span> <span style="color: #ff0000;">'Duplicity'</span> dpbackup<br />
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>dpbackup<span style="color: #000000; font-weight: bold;">/</span>log</div></div>
<p>Make sure to add the new user to the deny list in SSH with <strong>DenyUsers dpbackup</strong> in the file <em>/etc/ssh/sshd_config</em>; there isn&#8217;t any reason for it to log in.</p>
<p>Now su as this new user. A GPG key needs to be created so that the compressed backups can be encrypted and signed. This way no one else that may have access to our S3 account (Amazon employees) can read the data.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">su</span> dpbackup<br />
$ <span style="color: #7a0874; font-weight: bold;">cd</span><br />
$ gpg <span style="color: #660033;">--list-keys</span><br />
gpg: directory <span style="color: #000000; font-weight: bold;">`/</span>root<span style="color: #000000; font-weight: bold;">/</span>.gnupg<span style="color: #ff0000;">' created<br />
gpg: new configuration file `/root/.gnupg/gpg.conf'</span> created<br />
gpg: WARNING: options <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`/</span>root<span style="color: #000000; font-weight: bold;">/</span>.gnupg<span style="color: #000000; font-weight: bold;">/</span>gpg.conf<span style="color: #ff0000;">' are not yet active during this run<br />
gpg: keyring `/root/.gnupg/pubring.gpg'</span> created<br />
gpg: <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>.gnupg<span style="color: #000000; font-weight: bold;">/</span>trustdb.gpg: trustdb created<br />
<br />
$ gpg <span style="color: #660033;">--gen-key</span></div></div>
<p>There will be a series of questions, most of the defaults are fine.</p>
<ul>
<li>Choose option 1 for DSA and Elgamal (the default)</li>
<li>Choose the default key size of 2048</li>
<li>Leave the default that the key will not expire, option 0</li>
<li>Enter a User ID, Email address, and comment for the key.</li>
<li>Type O for OK to accept.</li>
<li>Enter a long passphrase for the key and allow it to be generated. I usually do at least 20 characters since the password will just sit in a script anyway. </li>
</ul>
<p>Move the keys to some other safe place so that they can&#8217;t be lost. No key means the backups are worthless. Typically a second backup source is a good idea.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">tar</span> cf gpg_keys.tar .gnupg<span style="color: #000000; font-weight: bold;">/</span><br />
$ <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">600</span> gpg_keys.tar</div></div>
<p>See sample scripts below for backup jobs.</p>
<hr />
<p><a name="4"></a></p>
<h2>Sample Backup Scripts</h2>
<p>The first portion of the script defines the variables we&#8217;ll need to use. The AWS keys are defined for you when you sign up for S3.  Passphrase is the GPG passphrase set on the key generated from gpg &#8211;gen-key. The S3 bucket should be fairly unique, so I use the host name of the server. The others are pretty obvious but will be explained later.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">#!/bin/sh</span><br />
<br />
<span style="color: #666666; font-style: italic;"># Variables</span><br />
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">AWS_ACCESS_KEY_ID</span>=ABABAB3333338888WWWW<br />
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">AWS_SECRET_ACCESS_KEY</span>=BBBBBBBBBBTTTTTTTTTT8888888888VVVVVVVVVV<br />
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PASSPHRASE</span>=somelongpassphrase<br />
<span style="color: #007800;">DBHOST</span>=<span style="color: #ff0000;">'dbserver1'</span><br />
<span style="color: #007800;">TIMESTAMP</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #000000; font-weight: bold;">%</span>m<span style="color: #000000; font-weight: bold;">%</span>d<span style="color: #000000; font-weight: bold;">%</span>Y<span style="color: #000000; font-weight: bold;">%</span>H<span style="color: #000000; font-weight: bold;">%</span>M<span style="color: #000000; font-weight: bold;">`</span><br />
<span style="color: #007800;">FILE_PREFIX_DB</span>=<span style="color: #ff0000;">'mydb_'</span><br />
<span style="color: #007800;">FILE_PREFIX_SVN_REPO</span>=<span style="color: #ff0000;">'repo_'</span><br />
<span style="color: #007800;">GPG_PUB_KEY</span>=<span style="color: #ff0000;">'AAEE66BB'</span><br />
<span style="color: #007800;">BACKUP_LOG_FILE</span>=<span style="color: #ff0000;">'/home/dpbackup/log/s3_backup.log'</span><br />
<span style="color: #007800;">FULL_IF_OLDER_THAN</span>=<span style="color: #ff0000;">'7D'</span><br />
<span style="color: #007800;">KEEP_MAX_SETS</span>=<span style="color: #ff0000;">'2'</span><br />
<span style="color: #007800;">S3_BUCKET</span>=<span style="color: #ff0000;">'serverhostname'</span><br />
<span style="color: #007800;">CURRENT_HOST</span>=<span style="color: #ff0000;">'server-hostname'</span><br />
<span style="color: #007800;">TO_EMAIL</span>=<span style="color: #ff0000;">'sysadmin@example.com'</span></div></div>
<p>Just some sample backup methods for MySQL or Subversion if needed.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>mysqldump <span style="color: #660033;">-h</span> <span style="color: #007800;">$DBHOST</span> <span style="color: #660033;">-u</span> mysql_admin <span style="color: #660033;">-pmypass</span> mydb <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>dpbackup<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$FILE_PREFIX_DB</span><span style="color: #007800;">$TIMESTAMP</span>.sql<br />
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">svnadmin</span> dump <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>repo <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>dpbackup<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$FILE_PREFIX_SVN_REPO</span><span style="color: #007800;">$TIMESTAMP</span>.svnbk</div></div>
<p>This is only necessary on OpenBSD since it&#8217;s a security feature. We open it up now from 128 and close it back down later.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># Increase open file limit</span><br />
<span style="color: #7a0874; font-weight: bold;">ulimit</span> <span style="color: #660033;">-n</span> <span style="color: #000000;">1024</span></div></div>
<p>Most of these options can be read in the <a href="http://duplicity.nongnu.org/duplicity.1.html">man page of Duplicity</a>, and there are many more to choose from. Basically this backup is going to do a full backup ever 7 days (from the $FULL_IF_OLDER_THAN variable), and use encryption with the highest bzip compression, before sending it to S3. It will write a fresh backup log to the defined file, which we&#8217;ll email out later.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># Backup to S3</span><br />
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>duplicity <span style="color: #660033;">--s3-use-new-style</span> <span style="color: #660033;">--tempdir</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>dpbackup <span style="color: #660033;">--full-if-older-than</span> <span style="color: #007800;">$FULL_IF_OLDER_THAN</span> <span style="color: #660033;">--encrypt-key</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$GPG_PUB_KEY</span>&quot;</span> <span style="color: #660033;">--sign-key</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$GPG_PUB_KEY</span>&quot;</span> <span style="color: #660033;">--gpg-options</span>=<span style="color: #ff0000;">'--compress-algo=bzip2 --bzip2-compress-level=9'</span> <span style="color: #660033;">--include</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2 <span style="color: #660033;">--include</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>dpbackup<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">svn</span> <span style="color: #660033;">--include</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>dpbackup<span style="color: #000000; font-weight: bold;">/</span>mysql <span style="color: #660033;">--exclude</span> <span style="color: #ff0000;">'**'</span> <span style="color: #000000; font-weight: bold;">/</span> s3+http:<span style="color: #000000; font-weight: bold;">//</span><span style="color: #007800;">$S3_BUCKET</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$BACKUP_LOG_FILE</span></div></div>
<p>This line just gives us some space in the log file; really it&#8217;s just for email formatting.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># Separate the log file a bit</span><br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'\n\n==== REMOVE OLD BACKUP SETS ====\n\n'</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$BACKUP_LOG_FILE</span></div></div>
<p>This command will check how many full backup sets are already on S3, and remove any more than what is defined in KEEP_MAX_SETS.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># Clean out backup sets older than variable sets</span><br />
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>duplicity remove-all-but-n-full <span style="color: #007800;">$KEEP_MAX_SETS</span> s3+http:<span style="color: #000000; font-weight: bold;">//</span><span style="color: #007800;">$S3_BUCKET</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$BACKUP_LOG_FILE</span></div></div>
<p>Again, for formatting purposes.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># Separate the log file a bit</span><br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'\n\n==== CURRENT FILES IN BACKUP SET &nbsp;====\n\n'</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$BACKUP_LOG_FILE</span></div></div>
<p>This command lists out the current files in our backup set so they can be reviewed in the email, making sure everything is working out it should.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># List all files in backup set for verification</span><br />
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>duplicity list-current-files s3+http:<span style="color: #000000; font-weight: bold;">//</span><span style="color: #007800;">$S3_BUCKET</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$BACKUP_LOG_FILE</span></div></div>
<p>Now we can mail out the log file. The -s flag is for the subject line, and the TO_EMAIL is defined in our variables. We&#8217;re just writing the log file as the body of the email.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># Mail out log to sysadmins for verification</span><br />
mail <span style="color: #660033;">-s</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$CURRENT_HOST</span> Backup Log for <span style="color: #007800;">$TIMESTAMP</span>&quot;</span> <span style="color: #007800;">$TO_EMAIL</span> <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #007800;">$BACKUP_LOG_FILE</span></div></div>
<p>Since we exported the keys and passphrases, we want to make sure we don&#8217;t leave those around any longer than we have to; set them null.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># Clear secret variables</span><br />
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">AWS_ACCESS_KEY_ID</span>=<br />
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">AWS_SECRET_ACCESS_KEY</span>=<br />
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PASSPHRASE</span>=</div></div>
<p>Just a little clean up so we don&#8217;t waste space.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># Remove old and temporary files</span><br />
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>dpbackup<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/*</span><br />
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>dpbackup<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/*</span></div></div>
<p>This is for OpenBSD only. Since we opened the open file limit up at the beginning of the script, close it back down.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># Put open file limit back to default</span><br />
<span style="color: #7a0874; font-weight: bold;">ulimit</span> <span style="color: #660033;">-n</span> <span style="color: #000000;">128</span></div></div>
<p>End it.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># Exit</span><br />
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://therosiek.com/2010/01/duplicity-install-and-backup-samples/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Slackware 13 on Lenovo T61, Trackpad and scrolling</title>
		<link>http://therosiek.com/2010/01/slackware-13-on-lenovo-t61-trackpad-and-scrolling/</link>
		<comments>http://therosiek.com/2010/01/slackware-13-on-lenovo-t61-trackpad-and-scrolling/#comments</comments>
		<pubDate>Fri, 01 Jan 2010 16:53:11 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Tech Notes]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Slackware]]></category>

		<guid isPermaLink="false">http://therosiek.com/?p=139</guid>
		<description><![CDATA[Out of the box the trackpad didn&#8217;t scroll or have &#8220;click&#8221; capability. Just creating these two files fixed the issue. /etc/hal/fdi/policy/x11-synaptics.fdi &#60;?xml version=&#34;1.0&#34; encoding=&#34;ISO-8859-1&#34;?&#62; &#60;deviceinfo version=&#34;0.2&#34;&#62; &#160; &#60;device&#62; &#160; &#160; &#60;match key=&#34;info.capabilities&#34; contains=&#34;input.touchpad&#34;&#62; &#160; &#160; &#160; &#160; &#60;merge key=&#34;input.x11_driver&#34; type=&#34;string&#34;&#62;synaptics&#60;/merge&#62; &#160; &#160; &#160; &#160; &#60;merge key=&#34;input.x11_options.SHMConfig&#34; type=&#34;string&#34;&#62;true&#60;/merge&#62; &#160; &#160; &#160; &#160; &#60;merge key=&#34;input.x11_options.TapButton1&#34; type=&#34;string&#34;&#62;1&#60;/merge&#62; &#160; ]]></description>
			<content:encoded><![CDATA[<p>Out of the box the trackpad didn&#8217;t scroll or have &#8220;click&#8221; capability.  Just creating these two files fixed the issue.</p>
<p><strong>/etc/hal/fdi/policy/x11-synaptics.fdi</strong></p>
<div class="codecolorer-container xml vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;ISO-8859-1&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;deviceinfo</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;0.2&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;device<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;match</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;info.capabilities&quot;</span> <span style="color: #000066;">contains</span>=<span style="color: #ff0000;">&quot;input.touchpad&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.x11_driver&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>synaptics<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/merge<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.x11_options.SHMConfig&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/merge<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.x11_options.TapButton1&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/merge<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.x11_options.MaxTapMove&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>2000<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/merge<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.x11_options.VertEdgeScroll&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/merge<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.x11_options.HorizEdgeScroll&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/merge<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/match<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/device<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/deviceinfo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
<p><strong>/etc/hal/fdi/policy/mouse-wheel.fdi</strong></p>
<div class="codecolorer-container xml vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;match</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;info.product&quot;</span> <span style="color: #000066;">string</span>=<span style="color: #ff0000;">&quot;TPPS/2 IBM TrackPoint&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.x11_options.EmulateWheel&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/merge<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.x11_options.EmulateWheelButton&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>2<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/merge<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.x11_options.YAxisMapping&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>4 5<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/merge<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.x11_options.Emulate3Buttons&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/merge<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.x11_options.EmulateWheelTimeout&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>200<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/merge<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/match<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
<p>Reboot and give it a try.</p>
]]></content:encoded>
			<wfw:commentRss>http://therosiek.com/2010/01/slackware-13-on-lenovo-t61-trackpad-and-scrolling/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>QuickBooks Enterprise Install on Debian</title>
		<link>http://therosiek.com/2009/12/quickbooks-enterprise-install-on-debian/</link>
		<comments>http://therosiek.com/2009/12/quickbooks-enterprise-install-on-debian/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 19:13:50 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Tech Notes]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[QuickBooks]]></category>

		<guid isPermaLink="false">http://therosiek.com/?p=128</guid>
		<description><![CDATA[Operating System: Debian Lenny 5.0 This server needs an /opt directory for the package install, so the partitioning is a little bit different than a typical Linux setup. This is what mine ended up looking like: Filesystem Size Mounted on /dev/sda1 2G / /swap X /swap /dev/sda9 (rest) /home /dev/sda6 2G /opt /dev/sda7 1G /tmp ]]></description>
			<content:encoded><![CDATA[<p><strong>Operating System:</strong> Debian Lenny 5.0</p>
<p>This server needs an /opt directory for the package install, so the partitioning is a little bit different than a typical Linux setup.  This is what mine ended up looking like:</p>
<table>
<th>Filesystem</th>
<th>Size</th>
<th>Mounted on</th>
<tr>
<td>/dev/sda1</td>
<td>2G</td>
<td>/</td>
</tr>
<tr>
<td>/swap</td>
<td>X</td>
<td>/swap</td>
</tr>
<tr>
<td>/dev/sda9</td>
<td>(rest)</td>
<td>/home</td>
</tr>
<tr>
<td>/dev/sda6</td>
<td>2G</td>
<td>/opt</td>
</tr>
<tr>
<td>/dev/sda7</td>
<td>1G</td>
<td>/tmp</td>
</tr>
<tr>
<td>/dev/sda5</td>
<td>3G</td>
<td>/usr</td>
</tr>
<tr>
<td>/dev/sda8</td>
<td>2G</td>
<td>/var</td>
</tr>
</table>
<p>Setup a few packages necessary for the server first.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> samba gamin alien</div></div>
<p>Now users and groups need to be added for permissions and the Samba folder share access.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">groupadd quickbooks<br />
useradd <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>user1 <span style="color: #660033;">-g</span> quickbooks user1<br />
useradd <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>user2 <span style="color: #660033;">-g</span> quickbooks user2<br />
useradd <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>user3 <span style="color: #660033;">-g</span> quickbooks user3<br />
useradd <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>user4 <span style="color: #660033;">-g</span> quickbooks user4<br />
smbpasswd <span style="color: #660033;">-a</span> user1<br />
smbpasswd <span style="color: #660033;">-a</span> user2<br />
smbpasswd <span style="color: #660033;">-a</span> user3<br />
smbpasswd <span style="color: #660033;">-a</span> user4</div></div>
<p>Create the folder where the QuickBooks data files will be stored and set the appropriate permissions.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>qbdata<br />
<span style="color: #c20cb9; font-weight: bold;">chown</span> user1:quickbooks <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>qbdata<span style="color: #000000; font-weight: bold;">/</span><br />
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">775</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>qbdata<span style="color: #000000; font-weight: bold;">/</span></div></div>
<p>Now configure Samba by moving the built in configuration and writing your own.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>samba<br />
<span style="color: #c20cb9; font-weight: bold;">mv</span> smb.conf smb.conf.orig<br />
<span style="color: #c20cb9; font-weight: bold;">cp</span> smb.conf.orig smb.conf<br />
<span style="color: #c20cb9; font-weight: bold;">vi</span> smb.conf</div></div>
<p>The configuration file should read:</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">[global]<br />
&nbsp; &nbsp;workgroup = WORKGROUP<br />
&nbsp; &nbsp;server string = %h server<br />
&nbsp; &nbsp;dns proxy = no<br />
&nbsp; &nbsp;log file = /var/log/samba/log.%m<br />
&nbsp; &nbsp;max log size = 1000<br />
&nbsp; &nbsp;syslog = 0<br />
&nbsp; &nbsp;panic action = /usr/share/samba/panic-action %d<br />
&nbsp; &nbsp;encrypt passwords = true<br />
&nbsp; &nbsp;passdb backend = tdbsam<br />
&nbsp; &nbsp;obey pam restrictions = yes<br />
&nbsp; &nbsp;unix password sync = yes<br />
&nbsp; &nbsp;passwd program = /usr/bin/passwd %u<br />
&nbsp; &nbsp;passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .<br />
&nbsp; &nbsp;pam password change = yes<br />
<br />
[qbdata]<br />
&nbsp; &nbsp;path = /home/qbdata<br />
&nbsp; &nbsp;comment = Quickbooks Enterprise database share<br />
&nbsp; &nbsp;valid users = user1,user2,user3,user4<br />
&nbsp; &nbsp;public = no<br />
&nbsp; &nbsp;writeable = yes<br />
&nbsp; &nbsp;printable = no<br />
&nbsp; &nbsp;create mask = 0765</div></div>
<p>Now restart Samba and test the permissions using a Windows client. You should be able to see the logs created by each client and who was accessing the share.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>samba restart<br />
<span style="color: #c20cb9; font-weight: bold;">tail</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>samba<span style="color: #000000; font-weight: bold;">/</span>log.smbd<br />
<span style="color: #c20cb9; font-weight: bold;">tail</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>samba<span style="color: #000000; font-weight: bold;">/</span>log.rst-win-utl3</div></div>
<p>Using Alien, we&#8217;ll create a deb package from an rpm so it can be installed. Some other directories and files need to be created for logging purposes since Debian uses rsyslog and QuickBooks won&#8217;t create them on its own.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<br />
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>http-download.intuit.com<span style="color: #000000; font-weight: bold;">/</span>http.intuit<span style="color: #000000; font-weight: bold;">/</span>CMO<span style="color: #000000; font-weight: bold;">/</span>qbes<span style="color: #000000; font-weight: bold;">/</span>resources<span style="color: #000000; font-weight: bold;">/</span>qbdbm-<span style="color: #000000;">20.0</span>-<span style="color: #000000;">5</span>.i386.rpm<br />
alien qbdbm-<span style="color: #000000;">20.0</span>-<span style="color: #000000;">5</span>.i386.rpm<br />
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lock<span style="color: #000000; font-weight: bold;">/</span>subsys<br />
<span style="color: #c20cb9; font-weight: bold;">dpkg</span> <span style="color: #660033;">-i</span> qbdbm_20.0-<span style="color: #000000;">6</span>_i386.deb<br />
<span style="color: #c20cb9; font-weight: bold;">touch</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>qbdbfilemon.log<br />
<span style="color: #c20cb9; font-weight: bold;">touch</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>qbdbmgrn_20.log<br />
<span style="color: #c20cb9; font-weight: bold;">touch</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lock<span style="color: #000000; font-weight: bold;">/</span>subsys<span style="color: #000000; font-weight: bold;">/</span>qbdbfilemon<br />
<span style="color: #c20cb9; font-weight: bold;">touch</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lock<span style="color: #000000; font-weight: bold;">/</span>subsys<span style="color: #000000; font-weight: bold;">/</span>qbdbmgrn_20</div></div>
<p>We need to add a line to the syslog configuration in <strong>/etc/rsyslog.conf</strong>, just put it at the end.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">daemon.* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-/var/log/qbdbfilemon.log</div></div>
<p>Setup the QuickBooks binaries to startup automatically.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">update-rc.d qbdbfilemon defaults<br />
update-rc.d qbdbmgrn_20 defaults</div></div>
<p>Modify the file <strong>/opt/qb/util/qbmonitord.conf</strong> in include the directory where the QuickBooks data will live.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/home/qbdata</div></div>
<p>Restart the server and you should be able to run a <strong>ps -e</strong> and see the following processes running indicating the server is up. There also should be a <strong>/home/qbdata/qbdir.dat</strong> file created automatically.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;1987 ? &nbsp; &nbsp; &nbsp; &nbsp;00:00:01 qbmonitord<br />
&nbsp;1994 ? &nbsp; &nbsp; &nbsp; &nbsp;00:00:02 gam_server<br />
&nbsp;1995 ? &nbsp; &nbsp; &nbsp; &nbsp;00:25:40 QBDBMgrN_20</div></div>
]]></content:encoded>
			<wfw:commentRss>http://therosiek.com/2009/12/quickbooks-enterprise-install-on-debian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://http-download.intuit.com/http.intuit/CMO/qbes/resources/qbdbm-20.0-5.i386.rpm" length="7959629" type="audio/x-pn-realaudio-plugin" />
		</item>
		<item>
		<title>Slackware 13 on Lenovo T61, Intel Wireless 4965</title>
		<link>http://therosiek.com/2009/12/slackware-13-on-lenovo-t61-intel-wireless-4965/</link>
		<comments>http://therosiek.com/2009/12/slackware-13-on-lenovo-t61-intel-wireless-4965/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 18:29:14 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Tech Notes]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Slackware]]></category>

		<guid isPermaLink="false">http://therosiek.com/?p=113</guid>
		<description><![CDATA[I had some trouble getting the wireless to function properly on my T61 with Slackware 13. I tried combinations of wicd (the wireless network manager) and DHCP clients, different drivers, but nothing seemed to work. I could see the wireless points, but they always showed up as &#8220;hidden&#8221; and appear to connect, but would dever ]]></description>
			<content:encoded><![CDATA[<p>I had some trouble getting the wireless to function properly on my T61 with Slackware 13.  I tried combinations of wicd (the wireless network manager) and DHCP clients, different drivers, but nothing seemed to work.  I could see the wireless points, but they always showed up as &#8220;hidden&#8221; and appear to connect, but would dever be able to get an IP address.</p>
<p>At this point I moved to Debian to see if that would connect using wicd.  Sure enough, wicd connected and authenticated fine, but a kernel panic in Lenny using that wireless adapter would only leave it connected for about 5 minutes and then lock.  Enough of that.</p>
<p>Back to Slackware.  One thing I noticed was that Debian used the latest wicd, version 1.6.2.2 where the Slackware <em>extras</em> includes the 1.6.2.1 Slackware package.  Even the wicd site recommends using the included package in the <em>extras</em>.</p>
<p>Slackware also came with the same firmware for the 4965 wireless as Debian, so I know if I used that, I should be good to go on that end.  First, enable the firmware as root:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">modprobe iwl4965</div></div>
<p>Restart your computer and make sure the wireless adapter is loading properly on boot.  You should be able to do an <strong>lsmod | grep iwlagn</strong> and see a few lines with the module enabled.  Now grab wicd 1.6.2.2 from source; you can view them here: http://sourceforge.net/projects/wicd/files/.  Unpack it and install wicd.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<br />
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>sourceurl<span style="color: #000000; font-weight: bold;">/</span>wicd-1.6.2.2.tar.gz<br />
<span style="color: #c20cb9; font-weight: bold;">tar</span> zxvf wicd-1.6.2.2.tar.gz<br />
<span style="color: #7a0874; font-weight: bold;">cd</span> wicd-1.6.2.2<br />
python setup.py configure<br />
python setup.py <span style="color: #c20cb9; font-weight: bold;">install</span></div></div>
<p>You can check <strong>/etc/rc.d</strong> and find a <em>rc.wicd</em> executable.  This means the daemon should start on it&#8217;s own when booting.  Start the wicd daemon and then the curses version of the client.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">wicd<br />
wicd-curses</div></div>
<p>The curses GUI is pretty easy to understand and you should be able to configure the network no problem.  When you hit Shift+C to connect to an AP, you can see that it will authenticate and grab an IP this time&#8230;finally.  I&#8217;ve been able to connect to WPAv2 and WPAv1.  Previously I could connect to neither, although I never tried plain old WEP.  Others clamined WEP would work and WPA would not, but not being able to connect to a WPA network was a big show stopper for me.</p>
]]></content:encoded>
			<wfw:commentRss>http://therosiek.com/2009/12/slackware-13-on-lenovo-t61-intel-wireless-4965/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Backing up Subversion to FTP</title>
		<link>http://therosiek.com/2009/10/backing-up-subversion-to-ftp/</link>
		<comments>http://therosiek.com/2009/10/backing-up-subversion-to-ftp/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 17:28:07 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Tech Notes]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Subversion]]></category>

		<guid isPermaLink="false">http://therosiek.com/?p=107</guid>
		<description><![CDATA[Handy little script for backing up Subversion to an FTP server. #!/bin/sh # Variables HOST='server.local.com' USER='unixbackup' PASSWD='mypass' TIMESTAMP=`date +%m%d%Y%H%M` FILEPRE='egsvn_' # Backup EG repository /usr/local/bin/svnadmin dump /usr/home/svn &#62; /home/me/svn_backups/$FILEPRE$TIMESTAMP # FTP backup to tape server cd /home/me/svn_backups ftp -n $HOST &#62; /tmp/ftp.worked 2&#62; /tmp/ftp.failed &#60;&#60;END_SCRIPT quote USER $USER quote PASS $PASSWD binary put $FILEPRE$TIMESTAMP quit ]]></description>
			<content:encoded><![CDATA[<p>Handy little script for backing up Subversion to an FTP server.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">#!/bin/sh</span><br />
<br />
<span style="color: #666666; font-style: italic;"># Variables</span><br />
<br />
<span style="color: #007800;">HOST</span>=<span style="color: #ff0000;">'server.local.com'</span><br />
<span style="color: #007800;">USER</span>=<span style="color: #ff0000;">'unixbackup'</span><br />
<span style="color: #007800;">PASSWD</span>=<span style="color: #ff0000;">'mypass'</span><br />
<span style="color: #007800;">TIMESTAMP</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #000000; font-weight: bold;">%</span>m<span style="color: #000000; font-weight: bold;">%</span>d<span style="color: #000000; font-weight: bold;">%</span>Y<span style="color: #000000; font-weight: bold;">%</span>H<span style="color: #000000; font-weight: bold;">%</span>M<span style="color: #000000; font-weight: bold;">`</span><br />
<span style="color: #007800;">FILEPRE</span>=<span style="color: #ff0000;">'egsvn_'</span><br />
<br />
<span style="color: #666666; font-style: italic;"># Backup EG repository</span><br />
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">svnadmin</span> dump <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">svn</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>me<span style="color: #000000; font-weight: bold;">/</span>svn_backups<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$FILEPRE</span><span style="color: #007800;">$TIMESTAMP</span><br />
<br />
<span style="color: #666666; font-style: italic;"># FTP backup to tape server</span><br />
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>me<span style="color: #000000; font-weight: bold;">/</span>svn_backups<br />
<span style="color: #c20cb9; font-weight: bold;">ftp</span> <span style="color: #660033;">-n</span> <span style="color: #007800;">$HOST</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>ftp.worked <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>ftp.failed<br />
<span style="color: #000000; font-weight: bold;">&lt;&lt;</span>END_SCRIPT<br />
quote USER <span style="color: #007800;">$USER</span><br />
quote PASS <span style="color: #007800;">$PASSWD</span><br />
binary<br />
put <span style="color: #007800;">$FILEPRE</span><span style="color: #007800;">$TIMESTAMP</span><br />
quit<br />
END_SCRIPT<br />
<br />
<span style="color: #666666; font-style: italic;"># Remove old files</span><br />
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>me<span style="color: #000000; font-weight: bold;">/</span>svn_backups<span style="color: #000000; font-weight: bold;">/*</span><br />
<br />
<span style="color: #666666; font-style: italic;"># Exit</span><br />
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://therosiek.com/2009/10/backing-up-subversion-to-ftp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuring Sendmail</title>
		<link>http://therosiek.com/2009/10/configuring-sendmail/</link>
		<comments>http://therosiek.com/2009/10/configuring-sendmail/#comments</comments>
		<pubDate>Sat, 24 Oct 2009 14:31:01 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Tech Notes]]></category>
		<category><![CDATA[OpenBSD]]></category>
		<category><![CDATA[Sendmail]]></category>

		<guid isPermaLink="false">http://therosiek.com/?p=100</guid>
		<description><![CDATA[Operating System: OpenBSD 4.4 Sendmail is configured and enabled by default in OpenBSD, but it only allows you to send mail out from the machine itself (on localhost, as it should). These steps will allow you to relay from the server and set relay restrictions. As root, make a copy of the original localhost config ]]></description>
			<content:encoded><![CDATA[<p><strong>Operating System:</strong> OpenBSD 4.4</p>
<p>Sendmail is configured and enabled by default in OpenBSD, but it only allows you to send mail out from the machine itself (on localhost, as it should). These steps will allow you to relay from the server and set relay restrictions.</p>
<p>As root, make a copy of the original localhost config file to one of your own.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>sendmail<span style="color: #000000; font-weight: bold;">/</span>cf<br />
<span style="color: #c20cb9; font-weight: bold;">cp</span> openbsd-localhost.mc openbsd-myconfig.mc</div></div>
<p>Open the file you just created and comment out the line:</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">FEATURE(`accept_unresolvable_domans')dnl</div></div>
<p>by adding <strong>dnl</strong> to the the front to read</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">dnlFEATURE(`accept_unresolvable_domans')dnl</div></div>
<p>Then modify this line so that Sendmail will listen on all interfaces rather than just local:</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">DAEMON_OPTIONS(`Family=inet, address=127.0.0.1, Name=MTA')dnl</div></div>
<p>to read&#8230;</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">DAEMON_OPTIONS(`Family=inet, address=0.0.0.0, Name=MTA')dnl</div></div>
<p>Now compile the configuration that you created and make it the default Sendmail config:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">m4</span> ..<span style="color: #000000; font-weight: bold;">/</span>m4<span style="color: #000000; font-weight: bold;">/</span>cf.m4 openbsd-myconfig.mc <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>mail<span style="color: #000000; font-weight: bold;">/</span>sendmail.cf</div></div>
<p>Open <em>/etc/mail/relay-domains</em> and add IP addresses/ranges that are allowed to relay through the server. The format used is: 192.168.1 which is equivalent to 192.168.1.0/24.  This will allow other hosts on your network to relay mail through this server.</p>
<p>Modify <em>/etc/rc.conf</em> and replace:</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">sendmail_flags=&quot;-L sm-mta -C/etc/mail/localhost.cf -bd -q30m&quot;;</div></div>
<p>with&#8230;</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">sendmail_flags=&quot;-L sm-mta -C/etc/mail/sendmail.cf -bd -q2d&quot;</div></div>
<p>This will tell the flags to use our newly created .cf file we compiled earlier.  I usually change the <strong>q30m</strong> (which means keep things in the queue for 30 minutes) to <strong>q2d</strong>, keeping the queue active for 2 days before ditching it.</p>
<p>Do a clean reboot and make sure the correct configuration comes up. You can test access by using a server with the same subnet as in your &#8220;relay-domains&#8221; file and telnet-ing to port 25.</p>
<p>You can restart Sendmail quickly by killing the process first&#8230;</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">kill</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">head</span> <span style="color: #660033;">-n1</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>sendmail.pid<span style="color: #000000; font-weight: bold;">`</span></div></div>
<p>&#8230;and then restarting:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">. <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>rc.conf<br />
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">sendmail</span> <span style="color: #007800;">$sendmail_flags</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://therosiek.com/2009/10/configuring-sendmail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Subversion &#8211; Installation, Configuration, and Use</title>
		<link>http://therosiek.com/2009/10/subversion-installation-configuration-and-use/</link>
		<comments>http://therosiek.com/2009/10/subversion-installation-configuration-and-use/#comments</comments>
		<pubDate>Sat, 24 Oct 2009 14:09:06 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Tech Notes]]></category>
		<category><![CDATA[OpenBSD]]></category>
		<category><![CDATA[Subversion]]></category>

		<guid isPermaLink="false">http://therosiek.com/?p=3</guid>
		<description><![CDATA[Operating System: OpenBSD 4.4 Installation First grab the necessary compiled packages from OpenBSD. export PKG_PATH=ftp://carroll.cac.psu.edu/pub/OpenBSD/4.4/packages/amd64 pkg_add db-4.6.21.tgz neon-0.26.2.tgz Then get the Apache source code for the HTTP server, configure and install. Use a 2.2.x version. cd /usr/src http://www.gtlib.gatech.edu/pub/apache/httpd/httpd-2.2.x.tar.gz tar zxvf httpd-2.2.x.tar.gz cd http-2.2.x ./configure --with-included-apr --with-berkeley-db=/usr/local --enable-shared=yes --enable-dav --enable-so --enable-rewrite --enable-ssl make make install Next ]]></description>
			<content:encoded><![CDATA[<p><strong>Operating System:</strong> OpenBSD 4.4</p>
<hr style="margin-bottom:15px" />
<h2>Installation</h2>
<p>First grab the necessary compiled packages from OpenBSD.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PKG_PATH</span>=<span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>carroll.cac.psu.edu<span style="color: #000000; font-weight: bold;">/</span>pub<span style="color: #000000; font-weight: bold;">/</span>OpenBSD<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">4.4</span><span style="color: #000000; font-weight: bold;">/</span>packages<span style="color: #000000; font-weight: bold;">/</span>amd64<br />
pkg_add db-4.6.21.tgz neon-0.26.2.tgz</div></div>
<p>Then get the Apache source code for the HTTP server, configure and install.  Use a 2.2.x version.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<br />
http:<span style="color: #000000; font-weight: bold;">//</span>www.gtlib.gatech.edu<span style="color: #000000; font-weight: bold;">/</span>pub<span style="color: #000000; font-weight: bold;">/</span>apache<span style="color: #000000; font-weight: bold;">/</span>httpd<span style="color: #000000; font-weight: bold;">/</span>httpd-<span style="color: #000000;">2.2</span>.x.tar.gz<br />
<span style="color: #c20cb9; font-weight: bold;">tar</span> zxvf httpd-<span style="color: #000000;">2.2</span>.x.tar.gz<br />
<span style="color: #7a0874; font-weight: bold;">cd</span> http-<span style="color: #000000;">2.2</span>.x<br />
.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--with-included-apr</span> <span style="color: #660033;">--with-berkeley-db</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span> <span style="color: #660033;">--enable-shared</span>=<span style="color: #c20cb9; font-weight: bold;">yes</span> <span style="color: #660033;">--enable-dav</span> <span style="color: #660033;">--enable-so</span> <span style="color: #660033;">--enable-rewrite</span> <span style="color: #660033;">--enable-ssl</span><br />
<span style="color: #c20cb9; font-weight: bold;">make</span><br />
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></div></div>
<p>Next get the newest Subversion source code, configure and install.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<br />
<span style="color: #c20cb9; font-weight: bold;">wget</span> subversion-<span style="color: #000000;">1.5</span>.x.tar.gz<br />
<span style="color: #c20cb9; font-weight: bold;">tar</span> zxvf subversion-<span style="color: #000000;">1.5</span>.x.tar.gz<br />
<span style="color: #7a0874; font-weight: bold;">cd</span> subversion-<span style="color: #000000;">1.5</span>.x<br />
.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--with-apr</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>apr-<span style="color: #000000;">1</span>-config <span style="color: #660033;">--with-apxs</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>apxs <span style="color: #660033;">--with-neon</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span></div></div>
<p>Add the proper user to run the httpd daemon</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">useradd <span style="color: #660033;">-u3690</span> <span style="color: #660033;">-g</span>=uid <span style="color: #660033;">-c</span><span style="color: #ff0000;">&quot;Apache2&quot;</span> -d<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>empty -s<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>nologin _apache2</div></div>
<hr style="margin-bottom:15px" />
<h2>Configuration</h2>
<p>Setup the initial repository with the <strong>svncreate</strong> command and make the user running the web service the owner, since they will be the user actually modifying the repository files.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">svn</span><br />
<span style="color: #c20cb9; font-weight: bold;">svnadmin</span> create <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>myproject<br />
<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> _apache2:_apache2 <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span></div></div>
<p>Now edit your main <em>httpd.conf</em> file in <strong>/usr/local/apache2/conf/</strong> to read these changes. They&#8217;re not all in the same place, just scattered throughout the file. The first two changes should already be there after installing the Subversion source, just require slight modification. The last &#8220;location&#8221; change you&#8217;ll need to add manually. You&#8217;ll see the dav_svn* files in there, we&#8217;ll get to those next.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">LoadModule dav_svn_module &nbsp; &nbsp; modules/mod_dav_svn.so<br />
LoadModule authz_svn_module &nbsp; modules/mod_authz_svn.so<br />
...<br />
User _apache2<br />
Group _apache2<br />
...<br />
&lt;Location /svn&gt;<br />
&nbsp; DAV svn<br />
&nbsp; SVNListParentPath on<br />
&nbsp; SVNParentPath /home/svn<br />
&nbsp; &nbsp; AuthType Basic<br />
&nbsp; &nbsp; AuthName &quot;Subversion Repository&quot;<br />
&nbsp; &nbsp; AuthUserFile /etc/svn/dav_svn.passwd<br />
&nbsp; &nbsp; AuthzSVNAccessFile /etc/svn/dav_svn.control<br />
&nbsp; &nbsp; Require valid-user<br />
&lt;/Location&gt;</div></div>
<p>Now we can create the username/password files along with the access files.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">svn</span><br />
<span style="color: #c20cb9; font-weight: bold;">touch</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>dav_svn.passwd<br />
htpasswd <span style="color: #660033;">-mb</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>dav_svn.passwd myuser mypassword</div></div>
<p>Create the access file to your repositories.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">touch</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>dav_svn.control</div></div>
<p>And now edit the file.  You can set users using <strong>r</strong> and <strong>rw</strong> access writes.  First you list the repository, and then the folder location after that for more fine grained permissions.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">[myproject:/]<br />
myuser = r<br />
<br />
[myproject:/trunk/base/code]<br />
myuser = rw</div></div>
<p>Naturally you&#8217;ll want to lock this service down with SSL and possibly make it available outside the network. To simply create a self-signed certificate and add it to Apache, do the following.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">openssl genrsa <span style="color: #660033;">-out</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssl<span style="color: #000000; font-weight: bold;">/</span>private<span style="color: #000000; font-weight: bold;">/</span>svnserver.key <span style="color: #000000;">1024</span><br />
openssl req <span style="color: #660033;">-new</span> <span style="color: #660033;">-key</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssl<span style="color: #000000; font-weight: bold;">/</span>private<span style="color: #000000; font-weight: bold;">/</span>svnserver.key <span style="color: #660033;">-out</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssl<span style="color: #000000; font-weight: bold;">/</span>private<span style="color: #000000; font-weight: bold;">/</span>svnserver.csr<br />
openssl x509 <span style="color: #660033;">-req</span> <span style="color: #660033;">-days</span> <span style="color: #000000;">365</span> <span style="color: #660033;">-in</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssl<span style="color: #000000; font-weight: bold;">/</span>private<span style="color: #000000; font-weight: bold;">/</span>svnserver.csr <span style="color: #660033;">-signkey</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssl<span style="color: #000000; font-weight: bold;">/</span>private<span style="color: #000000; font-weight: bold;">/</span>svnserver.key <span style="color: #660033;">-out</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssl<span style="color: #000000; font-weight: bold;">/</span>svnserver.crt</div></div>
<p>Now add the lines in the <em>httpd.conf</em> file in <strong>/usr/local/apache2/conf/</strong> just about the Location setting.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Listen 443<br />
SSLEngine on<br />
SSLCertificateFile &nbsp; &nbsp;/etc/ssl/svnserver.crt<br />
SSLCertificateKeyFile /etc/ssl/private/svnserver.key</div></div>
<p>Edit the <em>rc.conf.local</em> file in <strong>/etc/</strong> to turn on Apache.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">apache2=YES</div></div>
<p>And then edit the <strong>rc.local</strong> file to auto start Apache.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># Apache2 Startup</span><br />
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> X<span style="color: #ff0000;">&quot;<span style="color: #007800;">${apache2}</span>&quot;</span> == X<span style="color: #ff0000;">&quot;YES&quot;</span> <span style="color: #660033;">-a</span> <span style="color: #660033;">-x</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>httpd <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span><br />
&nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>apachectl start <span style="color: #000000; font-weight: bold;">&amp;</span>amp;<br />
&nbsp; &nbsp;<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot; apache2&quot;</span>;<br />
<span style="color: #000000; font-weight: bold;">fi</span></div></div>
<p>As well as the shutdown file <em>rc.shutdown</em> to kill the process.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># Apache2 Shutdown</span><br />
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> X<span style="color: #ff0000;">&quot;<span style="color: #007800;">${apache2}</span>&quot;</span> == X<span style="color: #ff0000;">&quot;YES&quot;</span> <span style="color: #660033;">-a</span> <span style="color: #660033;">-x</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>httpd <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span><br />
&nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>apachectl stop <span style="color: #000000; font-weight: bold;">&amp;</span>amp;<br />
&nbsp; &nbsp;<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot; apache2&quot;</span>;<br />
<span style="color: #000000; font-weight: bold;">fi</span></div></div>
<p>Now reboot the server and test access; it should start up automatically.</p>
<hr style="margin-bottom:15px" />
<h2>Maintenance and Use</h2>
<p>The best way to use SVN over HTTPS is with <a href="http://tortoisesvn.tigris.org/" target="_top">Tortoise</a> for Windows or some other tool if using Linux, like RapidSVN.</p>
<h3>Adding Additional Users</h3>
<p>To add more users, just run the <strong>htpasswd</strong> command linked to your <em>dav_svn.passwd</em> file, same as the initial configuration for users.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">htpasswd <span style="color: #660033;">-mb</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>dav_svn.passwd newuser newpassword</div></div>
<p>And now edit the access file containing the other users and defined in the Apache configuration.  You can set users using <strong>r</strong> and <strong>rw</strong> access writes.  First you list the repository, and then the folder location after that for more fine grained permissions.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">[myproject:/]<br />
myuser = r<br />
newuser = r<br />
<br />
[myproject:/trunk/base/code]<br />
myuser = rw<br />
newuser = rw</div></div>
<h3>Backing Up the Repositories</h3>
<p>To backup a repository, use the <strong>svnadmin dump</strong> command which will export the entire database and revisions. You can then tar up and gzip the dump file for compression, and back it up to tape or disk somewhere else. There are also incremental backups that can be done of disk/tape space is an issue.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">svnadmin dump /home/svn/myproject &gt; /home/backups/myproject_dumpfile</div></div>
<h3>Restoring the Repositories</h3>
<p>Restoring the SVN database is simply rewriting all the revisions from the dump back into a database. The restore process also works well for moving an older repository over to a new one since restoring the dump into a new SVN database will update it to that version.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">svnadmin</span> create <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>restoredproject<br />
<span style="color: #c20cb9; font-weight: bold;">svnadmin</span> load <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>restoredproject <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>backups<span style="color: #000000; font-weight: bold;">/</span>myproject_dumpfile</div></div>
]]></content:encoded>
			<wfw:commentRss>http://therosiek.com/2009/10/subversion-installation-configuration-and-use/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenVPN &#8211; Installation and Configuration</title>
		<link>http://therosiek.com/2009/10/openvpn-installation-and-configuration/</link>
		<comments>http://therosiek.com/2009/10/openvpn-installation-and-configuration/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 01:00:15 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Tech Notes]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OpenVPN]]></category>

		<guid isPermaLink="false">http://therosiek.com/?p=78</guid>
		<description><![CDATA[Operating System: Debian Etch 4.0 Install and Key Generation First we just need to grab the primary packages from the repos and install. Make sure you&#8217;re root. apt-get install openvpn openssl Next find the easy-rsa directory, and copy those files over to the OpenVPN configuration directory so we can setup a certificate. cp -R /usr/share/doc/openvpn/examples/easy-rsa/2.0 ]]></description>
			<content:encoded><![CDATA[<p><strong>Operating System:</strong> Debian Etch 4.0</p>
<hr style="margin-bottom:15px" />
<h2>Install and Key Generation</h2>
<p>First we just need to grab the primary packages from the repos and install.  Make sure you&#8217;re root.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> openvpn openssl</div></div>
<p>Next find the <strong>easy-rsa</strong> directory, and copy those files over to the OpenVPN configuration directory so we can setup a certificate.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-R</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>doc<span style="color: #000000; font-weight: bold;">/</span>openvpn<span style="color: #000000; font-weight: bold;">/</span>examples<span style="color: #000000; font-weight: bold;">/</span>easy-rsa<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">2.0</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>openvpn<span style="color: #000000; font-weight: bold;">/</span></div></div>
<p>Now in the <em>/etc/openvpn</em> directory open up the <strong>vars</strong> file and make some edits that suit you. I only made changes to the very end of the file.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">export KEY_SIZE=2048 export KEY_COUNTRY=US export KEY_PROVINCE=NA export KEY_CITY=mycity export KEY_ORG=&quot;My Company&quot; export KEY_OU=&quot;Operations&quot; export KEY_CN=&quot;CommonName&quot; export KEY_EMAIL=&quot;sysadmin@test.com&quot;</div></div>
<p>Save this file. Then run:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">. .<span style="color: #000000; font-weight: bold;">/</span>vars</div></div>
<p>Yeah, there&#8217;s a dot, a space, and then another dot in there. Then these commands:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">.<span style="color: #000000; font-weight: bold;">/</span>clean-all<br />
.<span style="color: #000000; font-weight: bold;">/</span>build-ca</div></div>
<p>You&#8217;ll be asked the cert questions, but most of the defaults should be filled in for you since you manually entered them in the vars file. Now build the server key:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">.<span style="color: #000000; font-weight: bold;">/</span>build-key-server myserver</div></div>
<p>You&#8217;ll be asked the same type of questions, but for common name you need to enter something. &#8220;Server&#8221; is the default. Run this next command, which will take awhile.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">.<span style="color: #000000; font-weight: bold;">/</span>build-dh</div></div>
<p>Then generate your TLS-AUTH keys:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">cd</span> keys<br />
openvpn <span style="color: #660033;">--genkey</span> <span style="color: #660033;">--secret</span> ta.key</div></div>
<p>Now create a key directory closer to the root folder to stay organized and copy the necessary keys there:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-m</span> 0700 <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>openvpn<span style="color: #000000; font-weight: bold;">/</span>keys<br />
<span style="color: #c20cb9; font-weight: bold;">cp</span> ca.crt ..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>keys <br />
<span style="color: #c20cb9; font-weight: bold;">mv</span> dh2048.pem ta.key myserver.crt myserver.key ..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>keys</div></div>
<hr style="margin-bottom:15px" />
<h2>Server Config File</h2>
<p>My server configuration is located in <em>/etc/openvpn/server.conf</em>. It&#8217;s what worked for me. The 172.21.0.0 subnet is the virtual one used by the VPN. The 10.10.0.0 subnet is the LAN I&#8217;m trying to connect to.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">dev tun<br />
port 1194<br />
proto udp<br />
server 172.21.0.0 255.255.255.0<br />
ifconfig-pool-persist /etc/openvpn/ipp.txt<br />
push &quot;route 10.10.0.0 255.255.255.0&quot;<br />
max-clients 10<br />
user nobody<br />
group nogroup<br />
duplicate-cn<br />
<br />
ca /etc/openvpn/keys/ca.crt<br />
cert /etc/openvpn/keys/myserver.crt<br />
key /etc/openvpn/keys/myserver.key<br />
dh /etc/openvpn/keys/dh2048.pem<br />
tls-auth /etc/openvpn/keys/ta.key 0<br />
<br />
keepalive 10 120<br />
comp-lzo<br />
persist-key<br />
persist-tun<br />
status /var/log/openvpn/openvpn-status.log<br />
log /var/log/openvpn/openvpn.log<br />
verb 4</div></div>
<p>More info on configuration options is here: <a href="http://openvpn.net/howto.html">http://openvpn.net/howto.html</a>. You&#8217;ll also have to enable packet forwarding so packets can flow from the VPN interface to the ethernet interface. Open the file <em>/etc/sysctl.conf</em>and uncomment this line:</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">net.ipv4.conf.default.forwarding=1</div></div>
<p>Restart the server.</p>
<hr style="margin-bottom:15px" />
<h2>Setup the Revocation List</h2>
<p>Now setup a revocation list so you can block certificates and users that you create. Execute your variables again.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>openvpn<span style="color: #000000; font-weight: bold;">/</span>easy-rsa<br />
. .<span style="color: #000000; font-weight: bold;">/</span>vars</div></div>
<p>I had to modify my openssl configuration and repoint to my openvpn directory.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>ssl<br />
<span style="color: #c20cb9; font-weight: bold;">mv</span> openssl.cnf openssl.cnf.old<br />
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>openvpn<span style="color: #000000; font-weight: bold;">/</span>easy-rsa<span style="color: #000000; font-weight: bold;">/</span>openssl.cnf openssl.cnf</div></div>
<p>Edit the config file <em>openssl.cnf</em> at the end and comment out the <em>pkcs11</em> section if you&#8217;re not using it, otherwise it will throw errors. Then create your CRL:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">cd</span> keys<br />
openssl ca <span style="color: #660033;">-gencrl</span> <span style="color: #660033;">-keyfile</span> ca.key <span style="color: #660033;">-cert</span> ca.crt <span style="color: #660033;">-out</span> \ crl.pem</div></div>
<hr style="margin-bottom:15px" />
<h2>User Configuration</h2>
<p>Now create your first user:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">.<span style="color: #000000; font-weight: bold;">/</span>build-key-pass user1</div></div>
<p>Answer the same prompts and give it a password. If you don&#8217;t want to use a password, just use build-key instead. Restart the OpenVPN server for it to read the config:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>openvpn restart</div></div>
<p>Now, on the client machine run the same install commands (assuming you&#8217;re using an Ubuntu or Debain box) and create a keys directory:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> openvpn openssl <br />
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>openvpn<span style="color: #000000; font-weight: bold;">/</span>keys</div></div>
<p>Copy the keys <strong>ca.crt</strong>, <strong>user1.crt</strong>, <strong>user1.key</strong>, and <strong>ta.key</strong> into the keys directory and then create a file called <em>client.conf</em> in the <strong>/etc/openvpn</strong> directory.  Be sure you restrict access and lock down the keys directory, since compromise of these files will give someone else access.</p>
<p>Here&#8217;s my config:</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">client<br />
dev tun<br />
proto udp<br />
remote myserver.site.com 1194<br />
nobind<br />
user nobody<br />
group nogroup<br />
<br />
ca /etc/openvpn/keys/ca.crt<br />
cert /etc/openvpn/keys/user1.crt<br />
key /etc/openvpn/keys/user1.key<br />
tls-auth /etc/openvpn/keys/ta.key 1<br />
<br />
comp-lzo persist-key<br />
persist-tun<br />
log /var/log/openvpn/openvpn.log<br />
verb 4<br />
ns-cert-type server</div></div>
<p>You can get more info on the configuration here: <a href="http://openvpn.net/howto.html">http://openvpn.net/howto.html</a>. Now start up the VPN:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">openvpn <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>openvpn<span style="color: #000000; font-weight: bold;">/</span>client.conf</div></div>
<p>You can check the logs for errors, but in a few seconds, if you run an ifconfig, you can see a <em>tun0</em> device has been created and has one of the virtual IP addresses. You can then ping the remote VPN server&#8217;s inside address for testing.</p>
<hr style="margin-bottom:15px" />
<h2>Routing Issues</h2>
<p>In my situation, my VPN server was not the default gateway on my LAN, so I had to add some permantent routes to my clients so they could find their way back through the tunnel and to my remote client. For Linux boxes use:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">route add <span style="color: #660033;">-net</span> 172.21.0.0 netmask 255.255.255.0 gw 10.10.0.5</div></div>
<p>And on Windows use:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">route <span style="color: #660033;">-p</span> add 172.21.0.0 mask 255.255.255.0 10.10.0.5 metric <span style="color: #000000;">10</span></div></div>
<hr style="margin-bottom:15px" />
<h2>Adding and Removing Other Users</h2>
<p>When you need to add new users or client certificates, simply run:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>openvpn<span style="color: #000000; font-weight: bold;">/</span>easy-rsa<br />
. .<span style="color: #000000; font-weight: bold;">/</span>vars<br />
.<span style="color: #000000; font-weight: bold;">/</span>pkitool client2</div></div>
<p>This will generate the keys for the new client to copy down to their machine, just the same as the initial client. </p>
<p>Removing users is easy as well.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>openvpn<span style="color: #000000; font-weight: bold;">/</span>easy-rsa<br />
. .<span style="color: #000000; font-weight: bold;">/</span>vars<br />
.<span style="color: #000000; font-weight: bold;">/</span>revoke-full client2</div></div>
<p>You may see a bunch of error 23&#8242;s at the end, but that&#8217;s normal and just testing that the certificate does not have access anymore.</p>
]]></content:encoded>
			<wfw:commentRss>http://therosiek.com/2009/10/openvpn-installation-and-configuration/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
