<?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>laneolson.ca</title>
	<atom:link href="http://www.laneolson.ca/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.laneolson.ca</link>
	<description></description>
	<lastBuildDate>Fri, 07 Jan 2011 23:06:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using iGoogle To Simplify Job Searching</title>
		<link>http://www.laneolson.ca/2011/01/07/using-igoogle-to-simplify-job-searching/</link>
		<comments>http://www.laneolson.ca/2011/01/07/using-igoogle-to-simplify-job-searching/#comments</comments>
		<pubDate>Fri, 07 Jan 2011 22:56:17 +0000</pubDate>
		<dc:creator>Lane</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Job search]]></category>
		<category><![CDATA[rss]]></category>

		<guid isPermaLink="false">http://www.laneolson.ca/?p=216</guid>
		<description><![CDATA[<p>A few months back I read an article on <a href="http://freelancefolder.com/how-to-build-the-ultimate-job-finding-dashboard-with-igoogle/" target="_blank">how to build the ultimate iGoogle job finding dashboard</a>.  I found this article to be extremely helpful, but geared more towards people in the United States.  After a recent move I'm currently in between jobs and I've created an iGoogle dashboard that completely simplifies searching for jobs online.  I use a similar method of grabbing feeds to get updated on my favorite news and tech sites, but why not do it for job listings too?</p>
<p>The great thing about sites like <a href="http://www.kijiji.ca/" target="_blank">Kijiji</a>, <a href="http://www.craigslist.ca/">craig's list</a>, <a href="http://www.monster.ca">monster</a>, etc is that they all have RSS feeds for any search results.</p>
<a href="http://www.laneolson.ca/wp-content/uploads/2011/01/6.jpg"><img src="http://www.laneolson.ca/wp-content/uploads/2011/01/pre.jpg" alt="" title="iGoogle Dashboard Page" width="459" height="173" class="alignnone size-full wp-image-223" /></a>
<p>Here's a list of sites that I use to populate my iGoogle job dashboard, all of which offer RSS feeds of specific searches and categories.  Feel free to add your own.  Note: these are all catered to people in Canada.</p>
<ul>
<li><a href="http://www.kijiji.ca/">Kijiji</a></li>
<li><a href="http://www.monster.ca/">Monster</a></li>
<li><a href="http://www.craigslist.ca/">Craig's Lis</a>t</li>
<li><a href="http://www.workopolis.ca/">Workopolis</a></li>
<li><a href="http://www.wowjobs.ca/">Wow Jobs</a></li>
<li><a href="http://www.careerbuilder.ca/">Career Builder</a> (This one's a bit tricky, I'll explain later)</li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>A few months back I read an article on <a href="http://freelancefolder.com/how-to-build-the-ultimate-job-finding-dashboard-with-igoogle/" target="_blank">how to build the ultimate iGoogle job finding dashboard</a>.  I found this article to be extremely helpful, but geared more towards people in the United States.  After a recent move I&#8217;m currently in between jobs and I&#8217;ve created an iGoogle dashboard that completely simplifies searching for jobs online.  I use a similar method of grabbing feeds to get updated on my favorite news and tech sites, but why not do it for job listings too?</p>
<p>The great thing about sites like <a href="http://www.kijiji.ca/" target="_blank">Kijiji</a>, <a href="http://www.craigslist.ca/">craig&#8217;s list</a>, <a href="http://www.monster.ca">monster</a>, etc is that they all have RSS feeds for any search results.</p>
<p>Here&#8217;s a list of sites that I use to populate my iGoogle job dashboard, all of which offer RSS feeds of specific searches and categories.  Feel free to add your own.  Note: these are all catered to people in Canada.</p>
<ul>
<li><a href="http://www.kijiji.ca/">Kijiji</a></li>
<li><a href="http://www.monster.ca/">Monster</a></li>
<li><a href="http://www.craigslist.ca/">Craig&#8217;s Lis</a>t</li>
<li><a href="http://www.workopolis.ca/">Workopolis</a></li>
<li><a href="http://www.wowjobs.ca/">Wow Jobs</a></li>
<li><a href="http://www.careerbuilder.ca/">Career Builder</a> (This one&#8217;s a bit tricky for Canadians, I&#8217;ll explain later)</li>
</ul>
<h2>Building the dashboard</h2>
<p>The guide on <a href="http://freelancefolder.com/how-to-build-the-ultimate-job-finding-dashboard-with-igoogle/" target="_blank">how to build the ultimate iGoogle job finding dashboard</a> has most of the specifics you will need to actually create the new tab and sign up for a Google account if need be, this article is more about getting the right feeds for your interests.</p>
<h2>Adding The Feeds</h2>
<p>Most of the sites offer their feeds in plain sight when you do a search or browse a category.  Adding the feeds to iGoogle is easy once you have the link to the feed.  Simply click on the &#8220;Add Stuff&#8221; link on iGoogle, then in the menu on the left there is a &#8220;Add feed or gadget link&#8221;.  Click on that, paste the URL for the feed, and your set!</p>
<h2>Finding the Right Feeds</h2>
<p>Obviously you are going to want to use feeds that target the area you&#8217;re searching for a job in, and also the types of jobs you are interested in.  For most of the sites it&#8217;s a pretty straight forward process.  Go to one of the sites listed above, type in a search for the type of job you are looking for, then on the search results page click on the RSS feed icon and copy the url.  Paste the URL into iGoogle.  Here&#8217;s a quick example of doing it on Kijiji.ca.</p>
<ol>
<li>Go to kijiji.ca, select your location, click on a category.  You can also do a keyword search if you prefer that method.<br />
<a href="http://www.laneolson.ca/wp-content/uploads/2011/01/2.jpg"><img src="http://www.laneolson.ca/wp-content/uploads/2011/01/2.jpg" alt="" title="Select a category" width="303" height="298" class="alignnone size-full wp-image-217" /></a></li>
<li>Click on the RSS feed link towards the bottom of the page of results.<a href="http://www.laneolson.ca/wp-content/uploads/2011/01/3.jpg"><img src="http://www.laneolson.ca/wp-content/uploads/2011/01/3.jpg" alt="" title="Click the RSS button" width="279" height="71" class="alignnone size-full wp-image-218" /></a></li>
<li>Lastly, copy the URL of the feed, and then paste it into the &#8220;Add a gadget&#8221; section of iGoogle.  <a href="http://www.laneolson.ca/wp-content/uploads/2011/01/4.jpg"><img src="http://www.laneolson.ca/wp-content/uploads/2011/01/4.jpg" alt="" title="Copy the URL" width="642" height="170" class="alignnone size-full wp-image-219" /></a></li>
<li>Rinse, wash, repeat for the other sites!</li>
</ol>
<h2>Getting a feed out of Career Builder</h2>
<p>On the Canadian Career Builder site, there is no link to an RSS feed in the results (unless my eyes are deceiving me).  So, I had to find a bit of a work around to get that one to work.  The US site has an <a href="http://www.careerbuilder.com/RSS/rss.aspx">RSS page</a> where you can get feeds.  If you go to this page and type in a search, or select a category you will received a feed.  However, that feed will be for somewhere in the United States most likely.  In order to get Canadian results you have to manipulate the URL a bit.  Here is the feed URL for the Information Technology category:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">http:<span style="color: #000000; font-weight: bold;">//</span>www.careerbuilder.com<span style="color: #000000; font-weight: bold;">/</span>RTQ<span style="color: #000000; font-weight: bold;">/</span>rss20.aspx?<span style="color: #007800;">rssid</span>=RSS_PD<span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #007800;">num</span>=<span style="color: #000000;">25</span><span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #007800;">geoip</span>=<span style="color: #c20cb9; font-weight: bold;">false</span><span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #007800;">ddcompany</span>=<span style="color: #c20cb9; font-weight: bold;">false</span><span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #007800;">ddtitle</span>=<span style="color: #c20cb9; font-weight: bold;">false</span><span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">cat</span></span>=JN008</pre></div></div>

<p>Now, to make that give us Canadian results we can add the following parameters to the url:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #007800;">country</span>=CA<span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #007800;">city</span>=Edmonton  <span style="color: #7a0874; font-weight: bold;">&#40;</span>put <span style="color: #000000; font-weight: bold;">in</span> whatever city you want here<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>Which gives the full URL to the feed as</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">http:<span style="color: #000000; font-weight: bold;">//</span>www.careerbuilder.com<span style="color: #000000; font-weight: bold;">/</span>RTQ<span style="color: #000000; font-weight: bold;">/</span>rss20.aspx?<span style="color: #007800;">rssid</span>=RSS_PD<span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #007800;">Country</span>=CA<span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #007800;">city</span>=Edmonton<span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #007800;">num</span>=<span style="color: #000000;">25</span><span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #007800;">geoip</span>=<span style="color: #c20cb9; font-weight: bold;">false</span><span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #007800;">ddcompany</span>=<span style="color: #c20cb9; font-weight: bold;">false</span><span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #007800;">ddtitle</span>=<span style="color: #c20cb9; font-weight: bold;">false</span><span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">cat</span></span>=JN008</pre></div></div>

<p>Then paste that URL into iGoogle.</p>
<h2>Finishing up</h2>
<p>Once you have your feeds all added you can arrange them however you see fit, and adjust the number of postings each one shows.  Here is what mine looks like:<br />
<a href="http://www.laneolson.ca/wp-content/uploads/2011/01/6.jpg"><img src="http://www.laneolson.ca/wp-content/uploads/2011/01/pre.jpg" alt="" title="iGoogle Dashboard Page" width="459" height="173" class="alignnone size-full wp-image-223" /></a></p>
<p>Happy Hunting!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.laneolson.ca/2011/01/07/using-igoogle-to-simplify-job-searching/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Happy New Year!</title>
		<link>http://www.laneolson.ca/2011/01/06/happy-new-year/</link>
		<comments>http://www.laneolson.ca/2011/01/06/happy-new-year/#comments</comments>
		<pubDate>Thu, 06 Jan 2011 01:48:59 +0000</pubDate>
		<dc:creator>Lane</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://www.laneolson.ca/?p=206</guid>
		<description><![CDATA[<p>So it has been a while since I posted anything on here.  It's been a busy couple months.  I decided to move to Edmonton, Alberta and have spent the last little bit recording a CD of some of my own music.  It has been a blast and I've learned quite a bit.  The CD should be out towards the end of February 2011.  Besides that I've been picking up the odd freelance job doing various design and programming work.  Haven't had much time to work on any of my other projects besides the CD, but hopefully soon I'll have some more news on <a href="http://www.swatchee.com" target="blank">Swatchee</a>. </p>
<p>Also, a few weeks ago I was invited to record a slot for <a href="http://www.balconytvedmonton.com/" target="_blank">BalconyTV Edmonton</a>.  It was a blast hanging out, playing some tunes and watching the game.  Check out the video below!</p>
<br />
<object width="459" height="250"><param name="movie" value="http://www.youtube.com/v/Mzv3XEqkSHM?fs=1&#38;hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Mzv3XEqkSHM?fs=1&#38;hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="459" height="250"></embed></object>
<p>I'd say 2011 is shaping up to be a pretty good year!  All the best to you folks!</p>]]></description>
			<content:encoded><![CDATA[<p>So it has been a while since I posted anything on here.  It&#8217;s been a busy couple months.  I decided to move to Edmonton, Alberta and have spent the last little bit recording a CD of some of my own music.  It has been a blast and I&#8217;ve learned quite a bit.  The CD should be out towards the end of February 2011.  Besides that I&#8217;ve been picking up the odd freelance job doing various design and programming work.  Haven&#8217;t had much time to work on any of my other projects besides the CD, but hopefully soon I&#8217;ll have some more news on <a href="http://www.swatchee.com" target="blank">Swatchee</a>.  </p>
<p>Also, a few weeks ago I was invited to record a slot for <a href="http://www.balconytvedmonton.com/" target="_blank">BalconyTV Edmonton</a>.  It was a blast hanging out, playing some tunes and watching the game.  Check out the video below!</p>
<p><object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/Mzv3XEqkSHM?fs=1&amp;hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Mzv3XEqkSHM?fs=1&amp;hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.laneolson.ca/2011/01/06/happy-new-year/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Introducing&#8230; Lucy!</title>
		<link>http://www.laneolson.ca/2010/05/07/introducing-lucy/</link>
		<comments>http://www.laneolson.ca/2010/05/07/introducing-lucy/#comments</comments>
		<pubDate>Fri, 07 May 2010 21:24:17 +0000</pubDate>
		<dc:creator>Lane</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Chocolate Lab]]></category>
		<category><![CDATA[Lucy]]></category>
		<category><![CDATA[Puppy]]></category>

		<guid isPermaLink="false">http://www.laneolson.ca/?p=185</guid>
		<description><![CDATA[<p>I've been a little behind on my posting for the past couple months.  My time has been consumed by a few projects, better weather, and a little puppy named Lucy.   We picked her up just about a month ago, she is a pure bred chocolate lab.  This is my first puppy and I am surprised how much time they can eat up!  I'm slowly getting into a routine now and am finding a few packets of spare time here and there.  Hopefully I'll be able to catch up on my posting again soon.</p>
<p><a href="http://www.laneolson.ca/wp-content/uploads/2010/05/lucy1.jpg"><img src="http://www.laneolson.ca/wp-content/uploads/2010/05/lucy1.jpg" alt="Lucy in the yard" title="Lucy" width="459" height="231" class="alignnone size-full wp-image-186" /></a></p>
<p>Read the full post for more pictures.</p>
<p>In other news I have a few projects in progress.  The main one that isn't work related is called <a href="http://www.swatchee.com/">Swatchee</a>.  It is a simple web app that generates syntax highlighting schemes for a variety of editors starting with vim, textmate, and notepad++.  The app is based on <a href="http://www.jquery.com/" target="_blank">jQuery</a>, HTML5, and the <a href="http://www.lithify.me/" target="_blank">Lithium</a> framework for PHP.   If you're interested in testing or would like to lend a hand with development post a comment or send me an email at lane [at] laneolson [dot] ca.</p>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been a little behind on my posting for the past couple months.  My time has been consumed by a few projects, better weather, and a little puppy named Lucy.   We picked her up just about a month ago, she is a pure bred chocolate lab.  This is my first puppy and I am surprised how much time they can eat up!  I&#8217;m slowly getting into a routine now and am finding a few packets of spare time here and there.  Hopefully I&#8217;ll be able to catch up on my posting again soon.  Here are some pictures of her at 8 weeks old:</p>
<p><a href="http://www.laneolson.ca/wp-content/uploads/2010/05/GEDC0583.resized.jpg"><img src="http://www.laneolson.ca/wp-content/uploads/2010/05/GEDC0583.resized.jpg" alt="" title="GEDC0583.resized" width="434" height="326" class="alignnone size-full wp-image-189" /></a></p>
<p><a href="http://www.laneolson.ca/wp-content/uploads/2010/05/GEDC0564.resized.jpg"><img src="http://www.laneolson.ca/wp-content/uploads/2010/05/GEDC0564.resized.jpg" alt="Lucy Beside Her House" title="Lucy Beside Her House" width="326" height="434" class="alignnone size-full wp-image-187" /></a></p>
<p><a href="http://www.laneolson.ca/wp-content/uploads/2010/05/GEDC0579.resized.jpg"><img src="http://www.laneolson.ca/wp-content/uploads/2010/05/GEDC0579.resized.jpg" alt="Lucy Relaxing" title="Lucy Relaxing" width="434" height="326" class="alignnone size-full wp-image-188" /></a></p>
<p><a href="http://www.laneolson.ca/wp-content/uploads/2010/05/lucy1.jpg"><img src="http://www.laneolson.ca/wp-content/uploads/2010/05/lucy1.jpg" alt="Lucy in the yard" title="Lucy" width="459" height="231" class="alignnone size-full wp-image-186" /></a></p>
<p>In other news I have a few projects in progress.  The main one that isn&#8217;t work related is called <a href="http://www.swatchee.com/">Swatchee</a>.  It is a simple web app that generates syntax highlighting schemes for a variety of editors starting with vim, textmate, and notepad++.  The app is based on <a href="http://www.jquery.com/" target="_blank">jQuery</a>, HTML5, and the <a href="http://www.lithify.me/" target="_blank">Lithium</a> framework for PHP.  If you&#8217;re interested in testing or would like to lend a hand with development post a comment or send me an email at lane [at] laneolson [dot] ca.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.laneolson.ca/2010/05/07/introducing-lucy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Compiling PHP 5.3 on Ubuntu 9.10</title>
		<link>http://www.laneolson.ca/2010/02/19/compiling-php-5-3-on-ubuntu-9-10/</link>
		<comments>http://www.laneolson.ca/2010/02/19/compiling-php-5-3-on-ubuntu-9-10/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 21:11:03 +0000</pubDate>
		<dc:creator>Lane</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.laneolson.ca/?p=177</guid>
		<description><![CDATA[<p>This guide will outline how to compile PHP 5.3 from source for use with Apache.  The instructions in this guide have been tested with Ubuntu 9.10 and should work on other debian based distros.  This guide is a slight modification of the <a href="http://vimeo.com/8005503" target="_blank">video guide on setting up Apache, PHP 5.3 with xdebug, MongoDB, and Lithium</a> created by Jon Adams. Before proceeding with the instructions below you will need Apache installed on your computer.  If you do not yet have apache you can follow my <a href="http://www.laneolson.ca/2010/02/11/installing-and-configuring-apache-for-multiple-sites-on-ubuntu/">guide for setting up Apache on Ubuntu 9.10</a>.</p>
<p>The first step for installing PHP 5.3 is to get the prerequisites.  For this guide you will need the following libraries in order to compile php with the options that I use.  If you have some custom libraries/extensions that you want included in your build of PHP, now is the time to install them if you haven&#8217;t already.</p>
<p>The following command will install the libraries that I will need:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> libmcrypt-dev libxml2 libxml2-dev libbz2-dev libcurl4-gnutls-dev libjpeg62-dbg libpng12-dev libxslt1-dev libbz2-dev</pre></div></div>

<p>Once our required libraries have been installed we can go to http://www.php.net/downloads.php and choose to download the latest 5.3.x build in tar.gz format.  I chose to copy the download link and use wget to download it to the tmp directory, but you can do whatever you like.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>tmp

<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>ca2.php.net<span style="color: #000000; font-weight: bold;">/</span>get<span style="color: #000000; font-weight: bold;">/</span>php-5.3.1.tar.gz<span style="color: #000000; font-weight: bold;">/</span>from<span style="color: #000000; font-weight: bold;">/</span>this<span style="color: #000000; font-weight: bold;">/</span>mirror</pre></div></div>

<p>now untar the file and go into the directory</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xvf</span> php-5.3.1.tar.gz
<span style="color: #7a0874; font-weight: bold;">cd</span> php-5.3.1</pre></div></div>

<p>Now comes the fun part.  Here we will run the configure script that says what kind of extensions we want php built with...</p>]]></description>
			<content:encoded><![CDATA[<p>This guide will outline how to compile PHP 5.3 from source for use with Apache.  The instructions in this guide have been tested with Ubuntu 9.10 and should work on other debian based distros.  This guide is a slight modification of the <a href="http://vimeo.com/8005503" target="_blank">video guide on setting up Apache, PHP 5.3 with xdebug, MongoDB, and Lithium</a> created by Jon Adams. Before proceeding with the instructions below you will need Apache installed on your computer.  If you do not yet have apache you can follow my <a href="http://www.laneolson.ca/2010/02/11/installing-and-configuring-apache-for-multiple-sites-on-ubuntu/">guide for setting up Apache on Ubuntu 9.10</a>.</p>
<p>The first step for installing PHP 5.3 is to get the prerequisites.  For this guide you will need the following libraries in order to compile php with the options that I use.  If you have some custom libraries/extensions that you want included in your build of PHP, now is the time to install them if you haven&#8217;t already.</p>
<p>The following command will install the libraries that I will need:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> libmcrypt-dev libxml2 libxml2-dev libbz2-dev libcurl4-gnutls-dev libjpeg62-dbg libpng12-dev libxslt1-dev libbz2-dev</pre></div></div>

<p>Once our required libraries have been installed we can go to http://www.php.net/downloads.php and choose to download the latest 5.3.x build in tar.gz format.  I chose to copy the download link and use wget to download it to the tmp directory, but you can do whatever you like.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>tmp
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>ca2.php.net<span style="color: #000000; font-weight: bold;">/</span>get<span style="color: #000000; font-weight: bold;">/</span>php-5.3.1.tar.gz<span style="color: #000000; font-weight: bold;">/</span>from<span style="color: #000000; font-weight: bold;">/</span>this<span style="color: #000000; font-weight: bold;">/</span>mirror</pre></div></div>

<p>now untar the file and go into the directory</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xvf</span> php-5.3.1.tar.gz
<span style="color: #7a0874; font-weight: bold;">cd</span> php-5.3.1</pre></div></div>

<p>Now comes the fun part.  Here we will run the configure script that says what kind of extensions we want php built with.  At the beginning of the tutorial we installed a bunch of libraries (for example libbz2) and because of that we are able to build PHP with support for these libraries by specifying the &#8211;with-%library% flag.  To see the options available for configuring php type:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--help</span></pre></div></div>

<p>You should be fine using what I used below, but feel free to make adjustments as you see fit:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<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: #660033;">--with-config-file-path</span>=<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>php5<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">--with-config-file-scan-dir</span>=<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>php5<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">--with-apxs2</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>apxs2 <span style="color: #660033;">--with-bz2</span> <span style="color: #660033;">--with-curl</span> <span style="color: #660033;">--with-gd</span> <span style="color: #660033;">--with-iconv</span> <span style="color: #660033;">--with-mcrypt</span> <span style="color: #660033;">--with-mysql</span> <span style="color: #660033;">--with-mysqli</span> <span style="color: #660033;">--with-openssl</span> <span style="color: #660033;">--with-pcre-regex</span> <span style="color: #660033;">--with-pdo-mysql</span> <span style="color: #660033;">--with-pear</span> <span style="color: #660033;">--with-xmlrpc</span> <span style="color: #660033;">--with-xsl</span> <span style="color: #660033;">--with-zlib</span> <span style="color: #660033;">--enable-ftp</span> <span style="color: #660033;">--enable-mbstring</span> <span style="color: #660033;">--enable-soap</span> <span style="color: #660033;">--enable-sockets</span></pre></div></div>

<p>If all goes well with the configure script you can continue to run the make file:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #660033;">-i</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p>Once the make script is finished running we have to manually create the modules for Apache:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><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>apache2<span style="color: #000000; font-weight: bold;">/</span>mods-available
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">nano</span> php5.load</pre></div></div>

<p>The contents of this file should be:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">LoadModule php5_module <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>libphp5.so</pre></div></div>

<p>Now create the configuration file:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">nano</span> php5.conf</pre></div></div>

<p>with the contents: </p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;</span>IfModule mod_php5.c<span style="color: #000000; font-weight: bold;">&gt;</span>
	AddType application<span style="color: #000000; font-weight: bold;">/</span>x-httpd-php .php .phtml .php3
	AddType application<span style="color: #000000; font-weight: bold;">/</span>x-httpd-php-source .phps
<span style="color: #000000; font-weight: bold;">&lt;/</span>IfModule<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

<p>Once those two files have been created we can enable the php5 module for Apache, then restart Apache for the new module to load.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> a2enmod php5
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <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</pre></div></div>

<p>Now go into your web directory (if you followed my apache guide earlier go to ~/www/sandbox.loc/httpdocs) and create a file called test.php</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nano</span> ~<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>sandbox.loc<span style="color: #000000; font-weight: bold;">/</span>httpdocs<span style="color: #000000; font-weight: bold;">/</span>test.php</pre></div></div>

<p>with the following contents:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #990000;">phpinfo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Now point your web browser to the new file you created.  Which should be at http://sandbox.loc/test.php, you should get a phpinfo page if all went according to plan.</p>
<p>You have now successfully installed php 5.3.  On the phpinfo page if you scroll down to the date section you will probably see an error saying you have to set your timezone.  You can do this with the php.ini file.  To ceate the php in file first create the /etc/php5 directory and copy the php.ini-production file included in the php-5.3.1 tar file.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <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>php5
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>php-5.3.1<span style="color: #000000; font-weight: bold;">/</span>php.ini-production <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>php5<span style="color: #000000; font-weight: bold;">/</span>php.ini</pre></div></div>

<p>Now edit the php.ini file:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>php5<span style="color: #000000; font-weight: bold;">/</span>php.ini</pre></div></div>

<p>and find the line beginning with &#8220;;date.timezone&#8221;, remove the semi-colon and set the value to your desired time zone.  There is a <a href="http://ca.php.net/manual/en/timezones.php">list of supported timezones</a> in the PHP manual.  For example, I changed mine to:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">date.timezone = <span style="color: #ff0000;">&quot;America/Edmonton&quot;</span></pre></div></div>

<p>You should now be set to start using PHP 5.3 with Apache!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.laneolson.ca/2010/02/19/compiling-php-5-3-on-ubuntu-9-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MultiBeast: The Ultimate Tool For Getting Your Hackintosh Up and Running</title>
		<link>http://www.laneolson.ca/2010/02/12/multibeast-the-ultimate-tool-for-getting-your-hackintosh-up-and-running/</link>
		<comments>http://www.laneolson.ca/2010/02/12/multibeast-the-ultimate-tool-for-getting-your-hackintosh-up-and-running/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 21:58:48 +0000</pubDate>
		<dc:creator>Lane</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Hackintosh]]></category>

		<guid isPermaLink="false">http://www.laneolson.ca/?p=170</guid>
		<description><![CDATA[<img src="http://www.laneolson.ca/wp-content/uploads/2010/02/multibeast.png" /><p>A tool called <a href="http://tonymacx86.com/viewtopic.php?f=7&#038;t=286" target="_blank">MultiBeast</a>, that takes the hassle out of getting everything working on your Hackintosh, was released yesterday by tonymacx86.  As the post says:</p>
<p style="font-style: italic; padding-left: 1em; padding-right: 1em; font-size: 1.1em; margin-top: 1.5em; margin-bottom: 1.5em; border-left: 4px solid #333;">MultiBeast installs everything you need to get your system 100% in one convenient package including Bootloader, Graphics, Sound, Network, DSDT, Kernels, Extras, and Utilities. </p>
<p>This is great for those who have always wanted a Hackintosh but were too intimidated by the manual terminal work.  MultiBeast provides a straight forward GUI for performing the grudging tasks of getting your hardware to work with OS X.</p>
<p>I have been a loyal reader of <a href="http://tonymacx86.blogspot.com/" target="_blank">tonymacx86's blog</a> for the past few months since his guides have got me up and running with a Core i5 Hackintosh of my own.  His guides are very thorough and easy to follow.  The introduction of this tool makes things so much easier.  Thanks tonymacx86!  </p>

<p>Links:</p>
<ul>
	<li><a href="http://tonymacx86.blogspot.com/">tonymacx86's blog</a> - guides and various p55 i5/i7 hackintosh information</li>
	<li><a href="http://tonymacx86.com/">tonymacx86 forums</a></li>
	<li><a href="http://tonymacx86.com/viewtopic.php?f=7&#038;t=286">MultiBeast Installer</a> - The Ultimate tool for Hackintosh Post-Installation</li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>A tool called <a href="http://tonymacx86.com/viewtopic.php?f=7&#038;t=286" target="_blank">MultiBeast</a>, that takes the hassle out of getting everything working on your Hackintosh, was released yesterday by tonymacx86.  As the post says:</p>
<p>MultiBeast installs everything you need to get your system 100% in one convenient package including Bootloader, Graphics, Sound, Network, DSDT, Kernels, Extras, and Utilities. </p>
<p>This is great for those who have always wanted a Hackintosh but were too intimidated by the manual terminal work.  MultiBeast provides a straight forward GUI for performing the grudging tasks of getting your hardware to work with OS X.</p>
<p>I have been a loyal reader of <a href="http://tonymacx86.blogspot.com/" target="_blank">tonymacx86&#8217;s blog</a> for the past few months since his guides have got me up and running with a Core i5 Hackintosh of my own.  His guides are very thorough and easy to follow.  The introduction of this tool makes things so much easier.  Thanks tonymacx86!  </p>
<p>Links:</p>
<ul>
<li><a href="http://tonymacx86.blogspot.com/">tonymacx86&#8217;s blog</a> &#8211; guides and various p55 i5/i7 hackintosh information</li>
<li><a href="http://tonymacx86.com/">tonymacx86 forums</a></li>
<li><a href="http://tonymacx86.com/viewtopic.php?f=7&#038;t=286">MultiBeast Installer</a> &#8211; The Ultimate tool for Hackintosh Post-Installation</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.laneolson.ca/2010/02/12/multibeast-the-ultimate-tool-for-getting-your-hackintosh-up-and-running/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing and Configuring Apache for Multiple Sites on Ubuntu</title>
		<link>http://www.laneolson.ca/2010/02/11/installing-and-configuring-apache-for-multiple-sites-on-ubuntu/</link>
		<comments>http://www.laneolson.ca/2010/02/11/installing-and-configuring-apache-for-multiple-sites-on-ubuntu/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 21:21:27 +0000</pubDate>
		<dc:creator>Lane</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.laneolson.ca/?p=162</guid>
		<description><![CDATA[<p>I like to run a local version of <a href="http://apache.org/">Apache</a> on my laptop for various projects so I can bring them wherever I go and not have to worry about them being live or screwing anything up.  Ubuntu makes it extremely easy to setup a LAMP server.  All you have to do is run:</p>

<div class="wp_syntax"><div class="code"><pre style="font-family: monospace;" class="bash"><span style="color: rgb(194, 12, 185); font-weight: bold;">sudo</span> tasksel</pre></div></div>

<p>Then follow the onscreen instructions and choose “LAMP Server” when prompted to be up and running with Apache, MySQL, and PHP in mere minutes.</p><p>This is great for a user that just wants the standard versions of PHP or MySQL.  However, I’m working on a project that requires PHP 5.3, and installing a LAMP server using tasksel installs PHP 5.2.  I decided that I would just install Apache and PHP manually so that I could use PHP 5.3.  This guide starts with my ideal Apache setup.  This is kind of a personal preference of how I like Apache setup, others may prefer a different method.  If you follow this guide directly you will end up with your web directory in your home folder, with two sites (http://sandbox.local/ and http://production.local/).  Lets get started.</p>
<h3>Installing Apache</h3>
<p>Installing Apache is the easy part, simply use apt:</p>

<div class="wp_syntax"><div class="code"><pre style="font-family: monospace;" class="bash"><span style="color: rgb(194, 12, 185); font-weight: bold;">sudo</span> <span style="color: rgb(194, 12, 185); font-weight: bold;">apt-get</span> <span style="color: rgb(194, 12, 185); font-weight: bold;">install</span> apache2 apache2-prefork-dev apache2-mpm-prefork</pre></div></div>

<p>Let it do its thing and in a few minutes you should have Apache up and running.  Once it is done you can test if it is working by opening a web browser and entering http://localhost/ in the address bar.  You should get Apache’s default message that says “It works!”.  Now that Apache is installed we can configure it to fit our needs...</p>]]></description>
			<content:encoded><![CDATA[<p>I like to run a local version of <a href="http://apache.org/">Apache</a> on my laptop for various projects so I can bring them wherever I go and not have to worry about them being live or screwing anything up.  Ubuntu makes it extremely easy to setup a LAMP server.  All you have to do is run:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> tasksel</pre></div></div>

<p>Then follow the onscreen instructions and choose &#8220;LAMP Server&#8221; when prompted to be up and running with Apache, MySQL, and PHP in mere minutes.  This is great for a user that just wants the standard versions of PHP or MySQL.  However, I&#8217;m working on a project that requires PHP 5.3, and installing a LAMP server using tasksel installs PHP 5.2.  I decided that I would just install Apache and PHP manually so that I could use PHP 5.3.  This guide starts with my ideal Apache setup.  This is kind of a personal preference of how I like Apache setup, others may prefer a different method.  If you follow this guide directly you will end up with your web directory in your home folder, with two sites (http://sandbox.local/ and http://production.local/).  Lets get started.</p>
<h3>Installing Apache</h3>
<p>Installing Apache is the easy part, simply use apt:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> apache2 apache2-prefork-dev apache2-mpm-prefork</pre></div></div>

<p>Let it do its thing and in a few minutes you should have Apache up and running.  Once it is done you can test if it is working by opening a web browser and entering http://localhost/ in the address bar.  You should get Apache&#8217;s default message that says &#8220;It works!&#8221;.  Now that Apache is installed we can configure it to fit our needs.</p>
<h3>Configuring Apache</h3>
<p>The first thing we are going to do is edit our hosts file to include our two &#8220;domain names&#8221; we&#8217;ll be using for the site, sandbox.local and production.local.  Open up the /etc/hosts file with nano (or your editor of choice):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>hosts</pre></div></div>

<p>And add the following lines below the line that begins with 127.0.1.1:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">127.0.1.2 sandbox.local www.sandbox.local
127.0.1.3 production.local www.production.local</pre></div></div>

<p>For those not familiar with the hosts file, what this is doing is assigning an IP Address to the host names.  127.0.1.2 and 127.0.1.3 are IP addresses that point to the local machine.  The values following the IP Address are the host name, and host alias respectively.  If you want to additional host names that point to the local machine then add them here.  You can call your host names whatever you like instead of sandbox.local and production.local, just be sure to substitute your own names in place of these for the rest of the tutorial.</p>
<p>Now that we have our host names pointing to our local machine we can create directories to hold the content for our two websites.  I created my base web directory inside of my home directory:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> ~<span style="color: #000000; font-weight: bold;">/</span>www</pre></div></div>

</pre>
<p>Now I want a directory for each site inside of the www directory.  The following will make a directory for each site with sub directories for the type of content (httpdocs for the web files, logs for the logs).  The last line just creates an index.html file in the httpdocs directory so we can test that our websites are working later.</p>
<p>For the sandbox.local website:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> ~<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>sandbox.local
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> ~<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>sandbox.local<span style="color: #000000; font-weight: bold;">/</span>httpdocs
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> ~<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>sandbox.local<span style="color: #000000; font-weight: bold;">/</span>logs
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;&lt;h1&gt;sandbox.local&lt;/h1&gt;&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> ~<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>sandbox.local<span style="color: #000000; font-weight: bold;">/</span>httpdocs<span style="color: #000000; font-weight: bold;">/</span>index.html</pre></div></div>

<p>For the production.local website:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> ~<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>production.local
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> ~<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>production.local<span style="color: #000000; font-weight: bold;">/</span>httpdocs
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> ~<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>production.local<span style="color: #000000; font-weight: bold;">/</span>logs
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;&lt;h1&gt;production.local&lt;/h1&gt;&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> ~<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>production.local<span style="color: #000000; font-weight: bold;">/</span>httpdocs<span style="color: #000000; font-weight: bold;">/</span>index.html</pre></div></div>

<p>Now we have our host names setup, and directories setup that contain our website.  The next step is to create configuration files to tell Apache what our host name (domain name) is and where on the computer it is located.  The configuration files for each site should be created in "/etc/apache2/sites-available".</p>
<p>First lets create the configuration file for sandbox.local</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><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>apache2<span style="color: #000000; font-weight: bold;">/</span>sites-available
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">nano</span> sandbox.local</pre></div></div>

<p>The file sandbox.local should contain the following.  You will have to change the "ServerAdmin" value and all the instances of "/home/lane" to your home directory depending on your username.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;</span>VirtualHost <span style="color: #000000; font-weight: bold;">*</span>:<span style="color: #000000;">80</span><span style="color: #000000; font-weight: bold;">&gt;</span>
	ServerAdmin username<span style="color: #000000; font-weight: bold;">@</span>sandbox.local
	ServerName sandbox.local
	ServerAlias www.sandbox.local
&nbsp;
	DocumentRoot <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>lane<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>sandbox.local<span style="color: #000000; font-weight: bold;">/</span>httpdocs<span style="color: #000000; font-weight: bold;">/</span>
	<span style="color: #000000; font-weight: bold;">&lt;</span>Directory <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>lane<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>sandbox.local<span style="color: #000000; font-weight: bold;">/</span>httpdocs<span style="color: #000000; font-weight: bold;">/&gt;</span>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride All
		Order allow,deny
		allow from all
	<span style="color: #000000; font-weight: bold;">&lt;/</span>Directory<span style="color: #000000; font-weight: bold;">&gt;</span>
&nbsp;
	ErrorLog <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>lane<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>sandbox.local<span style="color: #000000; font-weight: bold;">/</span>logs<span style="color: #000000; font-weight: bold;">/</span>error.log
	LogLevel warn
	CustomLog <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>lane<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>sandbox.local<span style="color: #000000; font-weight: bold;">/</span>logs<span style="color: #000000; font-weight: bold;">/</span>access.log combined
<span style="color: #000000; font-weight: bold;">&lt;/</span>VirtualHost<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

<p>Now do the same for production.local.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">nano</span> production.local</pre></div></div>

<p>With contents:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;</span>VirtualHost <span style="color: #000000; font-weight: bold;">*</span>:<span style="color: #000000;">80</span><span style="color: #000000; font-weight: bold;">&gt;</span>
	ServerAdmin username<span style="color: #000000; font-weight: bold;">@</span>production.local
	ServerName production.local
	ServerAlias www.production.local
&nbsp;
	DocumentRoot <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>lane<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>production.local<span style="color: #000000; font-weight: bold;">/</span>httpdocs<span style="color: #000000; font-weight: bold;">/</span>
	<span style="color: #000000; font-weight: bold;">&lt;</span>Directory <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>lane<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>production.local<span style="color: #000000; font-weight: bold;">/</span>httpdocs<span style="color: #000000; font-weight: bold;">/&gt;</span>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride All
		Order allow,deny
		allow from all
	<span style="color: #000000; font-weight: bold;">&lt;/</span>Directory<span style="color: #000000; font-weight: bold;">&gt;</span>
&nbsp;
	ErrorLog <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>lane<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>production.local<span style="color: #000000; font-weight: bold;">/</span>logs<span style="color: #000000; font-weight: bold;">/</span>error.log
	LogLevel warn
	CustomLog <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>lane<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>production.local<span style="color: #000000; font-weight: bold;">/</span>logs<span style="color: #000000; font-weight: bold;">/</span>access.log combined
<span style="color: #000000; font-weight: bold;">&lt;/</span>VirtualHost<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

<p>As you can see the two configuration files are pretty straight forward XML files.  The <a href="http://httpd.apache.org/docs/1.3/mod/core.html#servername">ServerName</a> and <a href="http://httpd.apache.org/docs/1.3/mod/core.html#serveralias">ServerAlias</a> values tell Apache what host name the following configuration is meant for.  The <a href="http://httpd.apache.org/docs/1.3/mod/core.html#documentroot">DocumentRoot</a> value tells Apache where to find the files for this website.  The <a href="http://httpd.apache.org/docs/1.3/mod/core.html#directory">Directory directive</a> allows you to specify specific options for the given directory.  Lastly the <a href="http://httpd.apache.org/docs/1.3/mod/core.html#errorlog">ErrorLog</a> and <a href="http://httpd.apache.org/docs/1.3/mod/mod_log_config.html#customlog">CustomLog</a> tells Apache where to store the log files for this domain.</p>
<p>Once the configuration files have been created we want to enable them so that Apache knows they are there.  I also chose to disable the default config, this is up to you.  The default config will load whatever is in "/var/www" when you point your browser to "localhost" (which is why we recieved the "It works!" message earlier.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> a2ensite sandbox.local
<span style="color: #c20cb9; font-weight: bold;">sudo</span> a2ensite production.local
<span style="color: #c20cb9; font-weight: bold;">sudo</span> a2dissite default</pre></div></div>

<p>Finally the last step is to restart Apache.  This can be done with the following command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <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</pre></div></div>

<p>If all went well we should be able to bring up our two new local websites.  Here is where everything we've done comes together.  Open up your web browser and type in "http://sandbox.local/".  When you type in sandbox.local in your web browser, the host name is looked up (and found in /etc/hosts) which points to the localhost (127.0.1.2).  Apache is listening on port 80 (the default http port) and picks up the request for "sandbox.local".  It looks in the enabled sites for one with a ServerName of "sandbox.local" then points to the requested file (index.html by default) in "DocumentRoot".  The web browser then displays this page and should say "sandbox.local" in big letters.</p>
<p>Now point your web browser to http://production.local/ and you should receive a similar page that says "production.local" in big letters.</p>
<p>You can now put whatever web content you want in ~/www/sandbox.local/httpdocs/ or ~/www/production.local/httpdocs/ and they will load up when you type their host name into your web browser.</p>
<p>This isn't really all that useful yet because all you can load up are html pages, which you could do anyways just by double clicking on an html file.  In my next blog post I will show you how to install PHP for use with your Apache web server so you can use it as a testing ground for various projects.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.laneolson.ca/2010/02/11/installing-and-configuring-apache-for-multiple-sites-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Advanced Regular Expressions: Some Tools and an Example</title>
		<link>http://www.laneolson.ca/2010/02/09/advanced-regular-expressions-some-tools-and-an-example/</link>
		<comments>http://www.laneolson.ca/2010/02/09/advanced-regular-expressions-some-tools-and-an-example/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 20:49:47 +0000</pubDate>
		<dc:creator>Lane</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[regular expressions]]></category>

		<guid isPermaLink="false">http://www.laneolson.ca/?p=151</guid>
		<description><![CDATA[<p>I’ve found myself having to build a few somewhat complex (in my opinion) regular expressions over the last few days in order to index certain fields for Splunk.  A good friend of mine pointed me in the direction of a regular expression testing tool a while ago and it has proved to be extremely useful.  The tool, <a target="_blank" href="http://gskinner.com/RegExr/">RegExr</a>, gives a good overview of examples, special characters, and even community submitted regular expressions for you to use.  Most importantly it lets you test your regular expression on a sample of user submitted text.</p>
<p>This is a great tool for <a target="_blank" href="http://www.splunk.com/">Splunk</a>.  All you have to do is copy an event that you want to capture a custom field in, paste it in the tool, then work with the regular expression until it captures that data you need.  One example of a regular expression that I built is this monster:</p>

<div class="wp_syntax"><div class="code"><pre style="font-family: monospace;" class="bash"><span style="color: rgb(122, 8, 116); font-weight: bold;">(</span>http<span style="color: rgb(0, 0, 0); font-weight: bold;">&#124;</span>https<span style="color: rgb(122, 8, 116); font-weight: bold;">)</span>:<span style="color: rgb(0, 0, 0); font-weight: bold;">//</span><span style="color: rgb(122, 8, 116); font-weight: bold;">(</span><span style="color: rgb(122, 8, 116); font-weight: bold;">(</span><span style="color: rgb(122, 8, 116); font-weight: bold;">[</span>A-Za-z0-<span style="color: rgb(0, 0, 0);">9</span>\.\-<span style="color: rgb(122, 8, 116); font-weight: bold;">]</span><span style="color: rgb(0, 0, 0); font-weight: bold;">*</span><span style="color: rgb(122, 8, 116); font-weight: bold;">)</span>?\.<span style="color: rgb(122, 8, 116); font-weight: bold;">)</span>?<span style="color: rgb(122, 8, 116); font-weight: bold;">(</span>?<span style="color: rgb(0, 0, 0); font-weight: bold;">&#60;</span>domain_name<span style="color: rgb(0, 0, 0); font-weight: bold;">&#62;</span><span style="color: rgb(122, 8, 116); font-weight: bold;">[</span>A-Za-z0-<span style="color: rgb(0, 0, 0);">9</span>\-<span style="color: rgb(122, 8, 116); font-weight: bold;">]</span><span style="color: rgb(122, 8, 116); font-weight: bold;">{</span><span style="color: rgb(0, 0, 0);">3</span><span style="color: rgb(122, 8, 116); font-weight: bold;">}</span><span style="color: rgb(122, 8, 116); font-weight: bold;">[</span>A-Za-z0-<span style="color: rgb(0, 0, 0);">9</span>\-<span style="color: rgb(122, 8, 116); font-weight: bold;">]</span><span style="color: rgb(0, 0, 0); font-weight: bold;">*</span>\.<span style="color: rgb(122, 8, 116); font-weight: bold;">(</span><span style="color: rgb(122, 8, 116); font-weight: bold;">[</span>A-Za-z<span style="color: rgb(122, 8, 116); font-weight: bold;">]</span><span style="color: rgb(122, 8, 116); font-weight: bold;">{</span><span style="color: rgb(0, 0, 0);">2</span><span style="color: rgb(122, 8, 116); font-weight: bold;">}</span>\.<span style="color: rgb(122, 8, 116); font-weight: bold;">[</span>A-Za-z<span style="color: rgb(122, 8, 116); font-weight: bold;">]</span><span style="color: rgb(122, 8, 116); font-weight: bold;">{</span><span style="color: rgb(0, 0, 0);">2</span><span style="color: rgb(122, 8, 116); font-weight: bold;">}</span><span style="color: rgb(0, 0, 0); font-weight: bold;">&#124;</span><span style="color: rgb(122, 8, 116); font-weight: bold;">[</span>A-Za-z<span style="color: rgb(122, 8, 116); font-weight: bold;">]</span><span style="color: rgb(122, 8, 116); font-weight: bold;">{</span><span style="color: rgb(0, 0, 0);">2</span>,<span style="color: rgb(0, 0, 0);">3</span><span style="color: rgb(122, 8, 116); font-weight: bold;">}</span><span style="color: rgb(122, 8, 116); font-weight: bold;">)</span><span style="color: rgb(0, 0, 0); font-weight: bold;">&#124;</span><span style="color: rgb(122, 8, 116); font-weight: bold;">[</span><span style="color: rgb(0, 0, 0);">0</span>-<span style="color: rgb(0, 0, 0);">9</span><span style="color: rgb(122, 8, 116); font-weight: bold;">]</span><span style="color: rgb(122, 8, 116); font-weight: bold;">{</span><span style="color: rgb(0, 0, 0);">1</span>,<span style="color: rgb(0, 0, 0);">3</span><span style="color: rgb(122, 8, 116); font-weight: bold;">}</span>\.<span style="color: rgb(122, 8, 116); font-weight: bold;">[</span><span style="color: rgb(0, 0, 0);">0</span>-<span style="color: rgb(0, 0, 0);">9</span><span style="color: rgb(122, 8, 116); font-weight: bold;">]</span><span style="color: rgb(122, 8, 116); font-weight: bold;">{</span><span style="color: rgb(0, 0, 0);">1</span>,<span style="color: rgb(0, 0, 0);">3</span><span style="color: rgb(122, 8, 116); font-weight: bold;">}</span>\.<span style="color: rgb(122, 8, 116); font-weight: bold;">[</span><span style="color: rgb(0, 0, 0);">0</span>-<span style="color: rgb(0, 0, 0);">9</span><span style="color: rgb(122, 8, 116); font-weight: bold;">]</span><span style="color: rgb(122, 8, 116); font-weight: bold;">{</span><span style="color: rgb(0, 0, 0);">1</span>,<span style="color: rgb(0, 0, 0);">3</span><span style="color: rgb(122, 8, 116); font-weight: bold;">}</span>\.<span style="color: rgb(122, 8, 116); font-weight: bold;">[</span><span style="color: rgb(0, 0, 0);">0</span>-<span style="color: rgb(0, 0, 0);">9</span><span style="color: rgb(122, 8, 116); font-weight: bold;">]</span><span style="color: rgb(122, 8, 116); font-weight: bold;">{</span><span style="color: rgb(0, 0, 0);">1</span>,<span style="color: rgb(0, 0, 0);">3</span><span style="color: rgb(122, 8, 116); font-weight: bold;">}</span><span style="color: rgb(122, 8, 116); font-weight: bold;">)</span></pre></div></div>

<p>I’ll explain what this one does in a second, but you can probably guess by looking at it.  With Splunk I am indexing all data that goes through the HTTP proxy on the firewall.  Each event that Splunk indexes from the proxy includes the address processessed, right down to the file name.  However, I’m more interested in pooling all of the events by domain name to get total amount of requests, time spent, etc by domain name.  So, I needed a regular expression to extract the domain name; enter the mess of characters from above...</p>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve found myself having to build a few somewhat complex (in my opinion) regular expressions over the last few days in order to index certain fields for Splunk.  A good friend of mine pointed me in the direction of a regular expression testing tool a while ago and it has proved to be extremely useful.  The tool, <a href="http://gskinner.com/RegExr/" target="_blank">RegExr</a>, gives a good overview of examples, special characters, and even community submitted regular expressions for you to use.  Most importantly it lets you test your regular expression on a sample of user submitted text.</p>
<p>This is a great tool for <a href="http://www.splunk.com/" target="_blank">Splunk</a>.  All you have to do is copy an event that you want to capture a custom field in, paste it in the tool, then work with the regular expression until it captures that data you need.  One example of a regular expression that I built is this monster:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#40;</span>http<span style="color: #000000; font-weight: bold;">|</span>https<span style="color: #7a0874; font-weight: bold;">&#41;</span>:<span style="color: #000000; font-weight: bold;">//</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>A-Za-z0-<span style="color: #000000;">9</span>\.\-<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>?\.<span style="color: #7a0874; font-weight: bold;">&#41;</span>?<span style="color: #7a0874; font-weight: bold;">&#40;</span>?<span style="color: #000000; font-weight: bold;">&lt;</span>domain_name<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>A-Za-z0-<span style="color: #000000;">9</span>\-<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000;">3</span><span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>A-Za-z0-<span style="color: #000000;">9</span>\-<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #000000; font-weight: bold;">*</span>\.<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>A-Za-z<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>\.<span style="color: #7a0874; font-weight: bold;">&#91;</span>A-Za-z<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">|</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>A-Za-z<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000;">2</span>,<span style="color: #000000;">3</span><span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #000000; font-weight: bold;">|</span><span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">0</span>-<span style="color: #000000;">9</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000;">1</span>,<span style="color: #000000;">3</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>\.<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">0</span>-<span style="color: #000000;">9</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000;">1</span>,<span style="color: #000000;">3</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>\.<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">0</span>-<span style="color: #000000;">9</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000;">1</span>,<span style="color: #000000;">3</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>\.<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">0</span>-<span style="color: #000000;">9</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000;">1</span>,<span style="color: #000000;">3</span><span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>I&#8217;ll explain what this one does in a second, but you can probably guess just by looking at it.  With Splunk I am indexing all data that goes through the HTTP proxy on the firewall.  Each event that Splunk indexes from the proxy includes the address processessed, right down to the file name.  However, I&#8217;m more interested in pooling all of the events by domain name to get total amount of requests, time spent, etc by domain name.  So, I needed a regular expression to extract the domain name; enter the mess of characters from above.</p>
<p>The regular expression above will break down a URL and capture its domain name.  For example the regex will capture example.com from the following url:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">http:<span style="color: #000000; font-weight: bold;">//</span>www.example.com<span style="color: #000000; font-weight: bold;">/</span>some_folder<span style="color: #000000; font-weight: bold;">/</span>filename.php?<span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">id</span></span>=<span style="color: #000000;">34</span><span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #007800;">name</span>=something</pre></div></div>

<p>This is actually simple enough to capture but became more complex when you considered the following:
<ul>
<li>Subdomains (whatever.example.com)</li>
<li>Odd domain extensions (ab.ca, co.uk)</li>
<li>IP Address domains (64.75.34.12)</li>
</ul>
<p>Here is a break down of the regular expression mentioned above.</p>
<h4>Capture group 1:</h4>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#40;</span>http<span style="color: #000000; font-weight: bold;">|</span>https<span style="color: #7a0874; font-weight: bold;">&#41;</span>:<span style="color: #000000; font-weight: bold;">//</span></pre></div></div>

<p>Pretty straight forward, the url must begin with http or https.  This is a HTTP/S proxy so I know that it will begin with either of these two values.  If you were to use this for an FTP proxy you could easily put in ftp.  The http/s is always followed by ://.</p>
<h4>Capture Group 2:</h4>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>A-Za-z0-<span style="color: #000000;">9</span>\.\-<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #000000; font-weight: bold;">*</span>\.<span style="color: #7a0874; font-weight: bold;">&#41;</span>?</pre></div></div>

<p>This part of the expression is to capture the subdomain.  It looks for any number containing characters in the range A-Z, a-z, 0-9, ., and – followed by a . (dot).  The question mark at the end of this part of the expression means that it is optional, that is, not all URL&#8217;s have subdomains.  Now that we have the subdomain, the next thing to process will be the domain name.</p>
<h4>Capture Group 3 (this one&#8217;s a doosey):</h4>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>A-Za-z0-<span style="color: #000000;">9</span>\-<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000;">3</span><span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>A-Za-z0-<span style="color: #000000;">9</span>\-<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #000000; font-weight: bold;">*</span>\.<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>A-Za-z<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>\.<span style="color: #7a0874; font-weight: bold;">&#91;</span>A-Za-z<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">|</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>A-Za-z<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>2s,<span style="color: #000000;">4</span><span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #000000; font-weight: bold;">|</span><span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">0</span>-<span style="color: #000000;">9</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000;">1</span>,<span style="color: #000000;">3</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>\.<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">0</span>-<span style="color: #000000;">9</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000;">1</span>,<span style="color: #000000;">3</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>\.<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">0</span>-<span style="color: #000000;">9</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000;">1</span>,<span style="color: #000000;">3</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>\.<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">0</span>-<span style="color: #000000;">9</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000;">1</span>,<span style="color: #000000;">3</span><span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>This one is so long because it looks for a domain name, or an IP address.  Here is the part that captures a domain name:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>A-Za-z0-<span style="color: #000000;">9</span>\-<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>A-Za-z0-<span style="color: #000000;">9</span>\-<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #000000; font-weight: bold;">*</span>\.<span style="color: #7a0874; font-weight: bold;">&#91;</span>A-Za-z<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>\.<span style="color: #7a0874; font-weight: bold;">&#91;</span>A-Za-z<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">|</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>A-Za-z<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000;">2</span>,<span style="color: #000000;">6</span><span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>A domain name must be at lease 2 characters, the first part takes care of that: [A-Za-z0-9\-]{2}.</p>
<p>The expression that follows that captures the remaining characters in the domain up until the “.” before the domain extension:  [A-Za-z0-9\-]*\.</p>
<p>The final part captures the domain extension, which can sometimes be a provice/state followed by a country code (ab.ca or fl.us which is ([A-Za-z]{2}\.[A-Za-z]{2}) or (|) an extension from two characters (ie: .ca) to six characters (ie: .museum) which is represented by [A-Za-z]{2,6}.</p>
<p>I also wanted to capture the IP address if the http request used an IP instead of a host name.  That&#8217;s what the last part captures:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">0</span>-<span style="color: #000000;">9</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000;">1</span>,<span style="color: #000000;">3</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>\.<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">0</span>-<span style="color: #000000;">9</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000;">1</span>,<span style="color: #000000;">3</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>\.<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">0</span>-<span style="color: #000000;">9</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000;">1</span>,<span style="color: #000000;">3</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>\.<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">0</span>-<span style="color: #000000;">9</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000;">1</span>,<span style="color: #000000;">3</span><span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>

<p>This one is fairly easy as well.  An Ipv4 address is just a series of 1 to 3 digits, a dot, 1 to 3 digits, a dot, 1 to 3 digits, a dot, then 1 to 3 digits.  That is what the above captures.</p>
<p>To reiterate, the full regular expression is:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#40;</span>http<span style="color: #000000; font-weight: bold;">|</span>https<span style="color: #7a0874; font-weight: bold;">&#41;</span>:<span style="color: #000000; font-weight: bold;">//</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>A-Za-z0-<span style="color: #000000;">9</span>\.\-<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>?\.<span style="color: #7a0874; font-weight: bold;">&#41;</span>?<span style="color: #7a0874; font-weight: bold;">&#40;</span>?<span style="color: #000000; font-weight: bold;">&lt;</span>domain_name<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>A-Za-z0-<span style="color: #000000;">9</span>\-<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000;">3</span><span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>A-Za-z0-<span style="color: #000000;">9</span>\-<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #000000; font-weight: bold;">*</span>\.<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>A-Za-z<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>\.<span style="color: #7a0874; font-weight: bold;">&#91;</span>A-Za-z<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">|</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>A-Za-z<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000;">2</span>,<span style="color: #000000;">3</span><span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #000000; font-weight: bold;">|</span><span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">0</span>-<span style="color: #000000;">9</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000;">1</span>,<span style="color: #000000;">3</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>\.<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">0</span>-<span style="color: #000000;">9</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000;">1</span>,<span style="color: #000000;">3</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>\.<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">0</span>-<span style="color: #000000;">9</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000;">1</span>,<span style="color: #000000;">3</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>\.<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">0</span>-<span style="color: #000000;">9</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000;">1</span>,<span style="color: #000000;">3</span><span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>You may be wondering what the ?<domain_name> is for.  That is just a way to assign the value of the 4th capture group a variable named “domain_name” in Splunk.  If you take out the ?<domain_name> capture group 4 will still contain the domain name.</p>
<p>I feel that learning and becoming comfortable with regular expressions is extremely important if you do any kind of programming.  At first they may seem a little daunting, but once you get the patterns down they are actually quite simple to write.  They allow you to parse almost any kind of data and nearly every programming language has some kind of implementation for them.  Using a tool like <a href="http://gskinner.com/RegExr/" target="_blank">RegExr</a> is a great way to learn to write regular expressions and also test them out once you get the hang of it.  You can also find a large library of regular expressions at <a href="http://regexlib.com/" target="_blank">regexlib.com</a>.</p>
<p><strong>Regular Expression Links:</strong></p>
<ul>
<li><a href="http://gskinner.com/RegExr/" target="_blank">RegExr</a> &#8211; Regular Expression Testing Tool</li>
<li><a href="http://regexlib.com/" target="_blank">RegExLib.com</a> &#8211; A collection of regular expressions</li>
<li><a href="http://www.aivosto.com/vbtips/regex.html" target="_blank">An Introduction to Regular Expressions</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.laneolson.ca/2010/02/09/advanced-regular-expressions-some-tools-and-an-example/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Critical Files on Dropbox: A Cautionary Tale</title>
		<link>http://www.laneolson.ca/2010/02/08/critical-files-on-dropbox-a-cautionary-tale/</link>
		<comments>http://www.laneolson.ca/2010/02/08/critical-files-on-dropbox-a-cautionary-tale/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 16:03:27 +0000</pubDate>
		<dc:creator>Lane</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Dropbox]]></category>
		<category><![CDATA[KeePass]]></category>

		<guid isPermaLink="false">http://www.laneolson.ca/?p=144</guid>
		<description><![CDATA[<p>This weekend I had somewhat of an unsettling experience with <a href="https://www.dropbox.com/" target="_blank">Dropbox</a>.  Typically I keep my <a href="http://keepass.info/" target="_blank">KeePass database</a> stored within Dropbox so that it is automatically synchronized between all of my computers.  I've felt quite confident that, because the file is synchronized to multiple computers, it is safe from being lost in the event of a hard drive failure or the like.  I do make backups of the file but only around every month or so.  I'm sure there are others that probably do the same thing as I do and I have a warning for those people... Backup your vital files (like password databases) somewhere else besides on the cloud.  Here's why:</p>
<p>I logged onto my computer late Friday night from my laptop.  I decided I was going to login to one of my blogs and start writing a new article.  Upon logging on I saw that faithful message from Dropbox in my notification area, “2 new files were synchronized successfully”.  I proceeded to fire up KeePassX and type in my password and was greeted with the following error:</p>
<p style="font-style: italic; padding-left: 1em; padding-right: 1em; font-size: 1.1em; margin-top: 1.5em; margin-bottom: 1.5em; border-left: 4px solid #333;">"The structure of the current database file is invalid. This can either happen if the user-supplied composite key  is invalid or if the file is corrupted."</p>
<p>At first, I had thought that I entered my password wrong.  So I tried again, typing more carefully this time.  <em>Same error.</em>  Then I thought maybe there was an issue with my key file, so I restored one from backup and tried again.  <em>Same error.</em>  I'm sitting in front of my laptop in disbelief, wondering what the hell I'm going to do if I can't access the hundreds of password in that file... some of which have no method of recovery...]]></description>
			<content:encoded><![CDATA[<p><i><strong>Note:</strong> Wow, I just realized that Dropbox has the ability to retrieve previous versions of files through the web interface.  This pretty much renders the post below useless, but nonetheless I&#8217;m going to leave it here because I believe the message is still important.  One backup is never enough!</i></p>
<p>This weekend I had somewhat of an unsettling experience with <a href="https://www.dropbox.com/" target="_blank">Dropbox</a>.  Typically I keep my <a href="http://keepass.info/" target="_blank">KeePass database</a> stored within Dropbox so that it is automatically synchronized between all of my computers.  I&#8217;ve felt quite confident that, because the file is synchronized to multiple computers, it is safe from being lost in the event of a hard drive failure or the like.  I do make backups of the file but only around every month or so.  I&#8217;m sure there are others that probably do the same thing as I do and I have a warning for those people&#8230; Backup your vital files (like password databases) somewhere else besides on the cloud.  Here&#8217;s why:</p>
<p>I logged onto my computer late Friday night from my laptop.  I decided I was going to login to one of my blogs and start writing a new article.  Upon logging on I saw that faithful message from Dropbox in my notification area, “2 new files were synchronized successfully”.  I proceeded to fire up KeePassX and type in my password and was greeted with the following error:</p>
<p style="font-style: italic; padding-left: 1em; padding-right: 1em; font-size: 1.1em; margin-top: 1.5em; margin-bottom: 1.5em; border-left: 4px solid #333;">&#8220;The structure of the current database file is invalid. This can either happen if the user-supplied composite key  is invalid or if the file is corrupted.&#8221;</p>
<p>At first, I had thought that I entered my password wrong.  So I tried again, typing more carefully this time.  <em>Same error.</em>  Then I thought maybe there was an issue with my key file, so I restored one from backup and tried again.  <em>Same error.</em>  I&#8217;m sitting in front of my laptop in disbelief, wondering what the hell I&#8217;m going to do if I can&#8217;t access the hundreds of password in that file&#8230; some of which have no method of recovery.  I ran downstairs and logged into my computer there only to see the same “2 new files were synchronized successfully” notification.  CRAP!  Had I been thinking I would have disconnected the network cable to make sure the files couldn&#8217;t synchronize.  Of course I was getting the same error on that computer.  I had only one other computer that my dropbox synchs to, and that computer is always on.  I knew that all of those files were going to give me the same error.  I still had a backup from a few weeks ago, but some critical passwords had changed that I would be unable to retrieve.</p>
<p>This story isn&#8217;t all bad though.  I was able to google the error and find a <a href="http://keepass.info/help/base/repair.html" target="_blank">Repair Instructions</a> for my KeePass database that got it back up and running.  However, this could&#8217;ve ended a lot worse.  I&#8217;d probably have a hard time explaining to my boss that I can&#8217;t do my job because I lost my passwords.  Lesson learned.  Everytime I make a critical password change in my database, I back it up <strong>twice</strong> to two different  <strong>secure</strong> locations where I&#8217;m confident that these files will be safe.  It is a little bit of a pain to do, but is absolutely worth it if I am ever faced with a similar situation where I cannot repair the database.</p>
<p>I really hope this brings light to anyone who keeps important data synchronized in the cloud via Dropbox or other services.  Just because your files are copied onto multiple computers does <strong>not</strong> mean that they are safe from corruption or data loss.  Make a backup.  Do it now.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.laneolson.ca/2010/02/08/critical-files-on-dropbox-a-cautionary-tale/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing OpenVAS 3 on Ubuntu 9.10</title>
		<link>http://www.laneolson.ca/2010/02/04/installing-openvas-3-on-ubuntu-9-10/</link>
		<comments>http://www.laneolson.ca/2010/02/04/installing-openvas-3-on-ubuntu-9-10/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 18:01:18 +0000</pubDate>
		<dc:creator>Lane</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[OpenVAS]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.laneolson.ca/?p=137</guid>
		<description><![CDATA[<img src="http://www.laneolson.ca/wp-content/uploads/2010/02/OpenVAS.png" alt="OpenVAS 3 on Ubuntu 9.10" />
<p>This is a minor update to my previous post on <a href="http://www.laneolson.ca/2009/05/26/how-to-install-openvas-vulnerability-scanner-on-ubuntu-904/">how to install OpenVAS 2 on Ubuntu 9.04</a>.  Since that post there have been some changes.  A new release of Ubuntu and a new version of OpenVAS.  If you still prefer to use OpenVAS 2 then my previous instructions should work fine with Ubuntu 9.10.  Those who would like to take advantage of OpenVAS 3 can expect the following new features:</p>
<ul>
<li>A new internal architecture of the modules
</li><li>NVT Meta Information that is free of arbitrary size limits
</li><li>IPv6 support
</li><li>WMI clients support
</li><li>Supports upcoming optional extensions:
<ul>
   <li>OpenVAS Manager for storing and organizing scans on a central server in a
       SQL database
   </li><li>OpenVAS Administrator for User-, Feed- and Settings-Management
   </li><li>Greenbone Security Assistent for a web-based Vulnerability Management
</li></ul>
</li></ul>
<p>You can read more about it on the <a href="http://www.openvas.org" target="_blank">official OpenVAS website</a>.  Now, lets get to the good stuff.  The instructions below should get you up and running with OpenVAS 3 on Ubuntu 9.10...</p>]]></description>
			<content:encoded><![CDATA[<p>This is a minor update to my previous post on <a href="http://www.laneolson.ca/2009/05/26/how-to-install-openvas-vulnerability-scanner-on-ubuntu-904/">how to install OpenVAS 2 on Ubuntu 9.04</a>.  Since that post there have been some changes.  A new release of Ubuntu and a new version of OpenVAS.  If you still prefer to use OpenVAS 2 then my previous instructions should work fine with Ubuntu 9.10.  Those who would like to take advantage of OpenVAS 3 can expect the following new features:</p>
<ul>
<li>A new internal architecture of the modules
</li>
<li>NVT Meta Information that is free of arbitrary size limits
</li>
<li>IPv6 support
</li>
<li>WMI clients support
</li>
<li>Supports upcoming optional extensions:
<ul>
<li>OpenVAS Manager for storing and organizing scans on a central server in a<br />
       SQL database
   </li>
<li>OpenVAS Administrator for User-, Feed- and Settings-Management
   </li>
<li>Greenbone Security Assistent for a web-based Vulnerability Management
</li>
</ul>
</li>
</ul>
<p>You can read more about it on the <a href="http://www.openvas.org" target="_blank">official OpenVAS website</a>.  Now, lets get to the good stuff.  The instructions below should get you up and running with OpenVAS 3 on Ubuntu 9.10:</p>
<h3>Prerequisites</h3>
<p>First we need to install all of the dependent packages:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> build-essential libgnutls-dev libpcap0.8-dev <span style="color: #c20cb9; font-weight: bold;">bison</span> 
libglib2.0-dev libgpgme11-dev libssl-dev cmake</pre></div></div>

<h3>Getting the Files</h3>
<p>Once those packages have installed we need to download the files required for OpenVAS.  The links below may be outdated, make sure you obtain the latest version.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>tmp
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>wald.intevation.org<span style="color: #000000; font-weight: bold;">/</span>frs<span style="color: #000000; font-weight: bold;">/</span>download.php<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">706</span><span style="color: #000000; font-weight: bold;">/</span>openvas-libraries-3.0.3.tar.gz
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>wald.intevation.org<span style="color: #000000; font-weight: bold;">/</span>frs<span style="color: #000000; font-weight: bold;">/</span>download.php<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">696</span><span style="color: #000000; font-weight: bold;">/</span>openvas-scanner-3.0.1.tar.gz</pre></div></div>

<p>Now that we have downloaded the required files we must compile and install the packages in the following order:</p>
<ol>
<li>openvas-libraries</li>
<li>openvas-scanner</li>
</ol>
<h3>Install OpenVAS Libraries</h3>
<p>
Start by untarring the openvas-libraries and compiling/installing it:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xvf</span> openvas-libraries-3.0.3.tar.gz
<span style="color: #7a0874; font-weight: bold;">cd</span> openvas-libraries-3.0.3<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> .<span style="color: #000000; font-weight: bold;">/</span>configure
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p>If all goes well here then you should get a message saying that the openvas-libraries have been installed.  If for some reason you get a message saying that gpgme is not installed, then try this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> libgpgme11-dev</pre></div></div>

<h3>Install OpenVAS Scanner</h3>
<p>Next untar the openvas-scanner and compile/install it:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> ..
<span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xvf</span> openvas-scanner-3.0.1.tar.gz
<span style="color: #7a0874; font-weight: bold;">cd</span> openvas-scanner-3.0.1<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> .<span style="color: #000000; font-weight: bold;">/</span>configure
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p>The OpenVAS libraries, and scanner should now be installed.  We now have to make sure that /usr/local/bin and /usr/local/sbin are in our PATH.  We can do that by typing in:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #800000;">${PATH}</span></pre></div></div>

<p>In the output from the above command you should see /usr/local/bin and /usr/local/sbin somewhere.  If you don&#8217;t you will have to add those entries to the <a href="https://help.ubuntu.com/community/EnvironmentVariables#Persistent%20environment%20variables">PATH environmental variable</a> manually.  If your PATH environmental variable is all good you can build the links to the new libraries:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> ldconfig</pre></div></div>

<h3>Generate a Certificate</h3>
<p>We are now ready to <a href="http://www.openvas.org/compendium/generating-a-server-certificate.html" target="blank">generate a certificate</a> for our OpenVAS Server, make sure to enter values relevant to your location.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> openvas-mkcert</pre></div></div>

<p>Follow the onscreen prompts and enter the appropriate information when asked.</p>
<h3>Create a User</h3>
<p>Now we need to <a href="http://www.openvas.org/compendium/adding-new-users.html" target="blank">add a user</a>:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> openvas-adduser</pre></div></div>

<p>Enter a username and choose your authentication method (choose &#8220;pass&#8221; to authenticate with a password).  Hit ctrl-d when you are prompted for rules if you don&#8217;t want any scanning restrictions.</p>
<p>Now everything that we need is setup for the OpenVAS scanner.  The next step is to sync the server with the NVT feed.  The NVT (Network Vulnerability Test) feed is a list of files that will be downloaded to your server.  I would recommend that you run the openvas-nvt-sync on regular intervals to ensure that your NVT files are up to date.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> openvas-nvt-sync</pre></div></div>

<p><em>Note: The first time you run this command it may take a while to download all the NVT&#8217;s.  Grab a coffee and a sandwich, some water and a piece of fruit, some beer and some pretzels&#8230; or whatever it is you eat/drink.</em></p>
<p>Once it&#8217;s done its thing you can start up the OpenVAS server daemon:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> openvassd</pre></div></div>

<p><em>Note: It might take a few minutes to load all the plug-ins.  A great opportunity to get some exercise and burn off the beer and pretzels from earlier.</em></p>
<p>If all went according to plan, you now have a running version of OpenVAS server.  The next step in the process is to setup a client to connect to the OpenVAS server.  You may opt to do this on a different computer, but you can just as easily install it on the same computer.</p>
<h3>Install the OpenVAS Client</h3>
<p>First we need to install the dependent packages for the client:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> libgtk2.0-dev htmldoc</pre></div></div>

<p>Now we can proceed to install the client:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>tmp
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>wald.intevation.org<span style="color: #000000; font-weight: bold;">/</span>frs<span style="color: #000000; font-weight: bold;">/</span>download.php<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">685</span><span style="color: #000000; font-weight: bold;">/</span>openvas-client-3.0.0.tar.gz
<span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xvf</span> openvas-client-3.0.0.tar.gz
<span style="color: #7a0874; font-weight: bold;">cd</span> openvas-client-3.0.0<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> .<span style="color: #000000; font-weight: bold;">/</span>configure
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p>If the above works for you, great!  However if you&#8217;re running a 64 bit OS like me, you might get an error when you run &#8220;sudo make&#8221;.  The error I received was:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">ld</span>: cannot <span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #660033;">-lcrypto</span>
collect2: <span style="color: #c20cb9; font-weight: bold;">ld</span> returned <span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">exit</span> status
<span style="color: #c20cb9; font-weight: bold;">make</span><span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #000000; font-weight: bold;">***</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>OpenVAS-Client<span style="color: #7a0874; font-weight: bold;">&#93;</span> Error <span style="color: #000000;">1</span>
<span style="color: #c20cb9; font-weight: bold;">make</span><span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: Leaving directory <span style="color: #000000; font-weight: bold;">`/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>openvas-client-3.0.0<span style="color: #000000; font-weight: bold;">/</span>openvas<span style="color: #ff0000;">'
make: *** [client] Error 2</span></pre></div></div>

<p>I ran the following command to see what the problem was:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">laneolson<span style="color: #000000; font-weight: bold;">@</span>system:<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>openvas-client-3.0.0$ ldconfig <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> crypto
	libcrypto.so.0.9.8 <span style="color: #7a0874; font-weight: bold;">&#40;</span>libc6,x86-<span style="color: #000000;">64</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>libcrypto.so.0.9.8
	libcrypto.so.0.9.8 <span style="color: #7a0874; font-weight: bold;">&#40;</span>libc6,x86-<span style="color: #000000;">64</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> =<span style="color: #000000; font-weight: bold;">&gt;</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>libcrypto.so.0.9.8
	libcrypto.so.0.9.8 <span style="color: #7a0874; font-weight: bold;">&#40;</span>libc6, hwcap: 0x0008000000008000<span style="color: #7a0874; font-weight: bold;">&#41;</span> =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>lib32<span style="color: #000000; font-weight: bold;">/</span>i686<span style="color: #000000; font-weight: bold;">/</span>cmov<span style="color: #000000; font-weight: bold;">/</span>libcrypto.so.0.9.8
	libcrypto.so.0.9.8 <span style="color: #7a0874; font-weight: bold;">&#40;</span>libc6, hwcap: 0x0004000000000000<span style="color: #7a0874; font-weight: bold;">&#41;</span> =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>lib32<span style="color: #000000; font-weight: bold;">/</span>i586<span style="color: #000000; font-weight: bold;">/</span>libcrypto.so.0.9.8
	libcrypto.so.0.9.8 <span style="color: #7a0874; font-weight: bold;">&#40;</span>libc6, hwcap: 0x0002000000000000<span style="color: #7a0874; font-weight: bold;">&#41;</span> =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>lib32<span style="color: #000000; font-weight: bold;">/</span>i486<span style="color: #000000; font-weight: bold;">/</span>libcrypto.so.0.9.8</pre></div></div>

<p>Creating a link in /usr/lib/ solved the problem:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</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>libcrypto.so.0.9.8 <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>libcrypto.so</pre></div></div>

<p>If you had to make the symbolic link make sure you do the following afterwards to complete the setup:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> ldconfig
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> clean
<span style="color: #c20cb9; font-weight: bold;">sudo</span> .<span style="color: #000000; font-weight: bold;">/</span>configure
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p>You should have a message saying that the Client was installed successfully.  You can run the client with:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> OpenVAS-Client</pre></div></div>

<p>The client can be installed on any computer that has access to the server.  Once it is installed you just have to connect, setup a scan and you&#8217;re done!  If you run into any hiccups along the way feel free to post in the comments and I will see if I can lend a hand.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.laneolson.ca/2010/02/04/installing-openvas-3-on-ubuntu-9-10/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Hyper-V Snapshots and Disk Space</title>
		<link>http://www.laneolson.ca/2009/10/09/hyper-v-snapshots-and-disk-space/</link>
		<comments>http://www.laneolson.ca/2009/10/09/hyper-v-snapshots-and-disk-space/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 19:55:09 +0000</pubDate>
		<dc:creator>Lane</dc:creator>
				<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[Hyper-V]]></category>

		<guid isPermaLink="false">http://www.laneolson.ca/?p=131</guid>
		<description><![CDATA[<p>I ran into a somewhat embarrassing problem the other day.  Upon turning on my computer I found that my virtual machine on a test server running under Hyper-V was in a Paused-Critical state.  A little further investigation showed that my disk space was critically low.  I tried to wrap my head around how that could have possibly happened.  After all, the only thing that was really on that machine was the Virtual Machine which I had allocated a large amount of disk space for.</p>
<p>The issue was with snapshots.  I had been taking snapshots of the VM prior to applying service packs or installing risky software.  After the procedure was successful I would delete the snapshot... or so I thought.  I'm no Hyper-V guru, but from past experience with VMware products once a snapshot is deleted, it's gone.  This isn't the case with Hyper-V.  If you want to delete a snapshot, you have to delete it in the Hyper-V manager, then turn off the VM with the deleted snapshot and wait for it to merge.</p>
<p>I shut down the VM and the merging process began.  However, I had created a few snapshots in the past that still hadn't been merged.  It looked like the merging process might take a while, so I let it run.  However, the merging process could not complete because I didn't have enough disk space!  I found this quite ironic.</p>
<p><em><strong>I am of disk space because I did not merge the snapshots into the vhd, but I cannot merge the snapshots because I am out of disk space.</strong></em>  Does that seem odd to anyone else?</p>
<p>In order to fix this problem I had to dive into the config file.  Luckily, I had another hard drive with around 30GB of freespace attached to the host.  To <a href="http://www.systemcentercentral.com/tabid/60/indexId/25255/tag/Forums+Hyper-V/Default.aspx" target="_blank">fix the problem</a> I shut down the VM and Hyper-V Services then went to the directory containing .avhd (snapshot) files.  I moved one of the snapshot files to a temporary directory on the drive with the free space, then updated the snapshot entry in the config xml file for the VM to point to the new directory where I placed the snapshot file.  After restarting the Hyper-V services and turning off the VM the merge was able to complete, albeit after 2 hours of waiting.</p>]]></description>
			<content:encoded><![CDATA[<p>I ran into a somewhat embarrassing problem the other day.  Upon turning on my computer I found that my virtual machine on a test server running under Hyper-V was in a Paused-Critical state.  A little further investigation showed that my disk space was critically low.  I tried to wrap my head around how that could have possibly happened.  After all, the only thing that was really on that machine was the Virtual Machine which I had allocated a large amount of disk space for.</p>
<p>The issue was with snapshots.  I had been taking snapshots of the VM prior to applying service packs or installing risky software.  After the procedure was successful I would delete the snapshot&#8230; or so I thought.  I&#8217;m no Hyper-V guru, but from past experience with VMware products once a snapshot is deleted, it&#8217;s gone.  This isn&#8217;t the case with Hyper-V.  If you want to delete a snapshot, you have to delete it in the Hyper-V manager, then turn off the VM with the deleted snapshot and wait for it to merge.</p>
<p>I shut down the VM and the merging process began.  However, I had created a few snapshots in the past that still hadn&#8217;t been merged.  It looked like the merging process might take a while, so I let it run.  However, the merging process could not complete because I didn&#8217;t have enough disk space!  I found this quite ironic.</p>
<p><em><strong>I am of disk space because I did not merge the snapshots into the vhd, but I cannot merge the snapshots because I am out of disk space.</strong></em>  Does that seem odd to anyone else?</p>
<p>In order to fix this problem I had to dive into the config file.  Luckily, I had another hard drive with around 30GB of freespace attached to the host.  To <a href="http://www.systemcentercentral.com/tabid/60/indexId/25255/tag/Forums+Hyper-V/Default.aspx" target="_blank">fix the problem</a> I shut down the VM and Hyper-V Services then went to the directory containing .avhd (snapshot) files.  I moved one of the snapshot files to a temporary directory on the drive with the free space, then updated the snapshot entry in the config xml file for the VM to point to the new directory where I placed the snapshot file.  After restarting the Hyper-V services and turning off the VM the merge was able to complete, albeit after 2 hours of waiting.</p>
<p>I realize that Hyper-V is a somewhat new contender in the Virtualization marketplace, but I think that something is completely out of whack with the way that snapshots work.  When you have systems that are required to be up and running 24/7 it basically throws away any use that snapshots have.  It seems somewhat ridiculous that you have to bring a system down to delete the snapshot when one of the reasons you created the snapshot was to help reduce downtime in case something goes wrong.  It is even more ridiculous that if you don&#8217;t power down your system and wait for the vhd to merge, the snapshot will continue to grow until the system comes crashing down due to a lack of disk space!</p>
<p>Anyways, that&#8217;s my rant.  Yes, I understand that Microsoft does not recommend snapshots for production environments&#8230; but I hope in the future they make some improvements so that snapshots <strong>are</strong> usable in production environments.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.laneolson.ca/2009/10/09/hyper-v-snapshots-and-disk-space/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

