<?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>Viktor Petersson.com</title>
	<atom:link href="http://viktorpetersson.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://viktorpetersson.com</link>
	<description>Hello my name is Viktor, and I&#039;m a startup-oholic.</description>
	<lastBuildDate>Fri, 23 Jul 2010 11:25:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>How to backup to S3 with GnuPG (PGP) without having to store the passphrase locally</title>
		<link>http://viktorpetersson.com/2010/07/23/how-to-backup-to-s3-with-gnupg-pgp-without-having-to-store-the-passphrase-locally/</link>
		<comments>http://viktorpetersson.com/2010/07/23/how-to-backup-to-s3-with-gnupg-pgp-without-having-to-store-the-passphrase-locally/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 11:25:23 +0000</pubDate>
		<dc:creator>Viktor Petersson</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[AWS]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[GnuPG]]></category>
		<category><![CDATA[PGP]]></category>
		<category><![CDATA[S3]]></category>
		<category><![CDATA[s3cmd]]></category>

		<guid isPermaLink="false">http://viktorpetersson.com/?p=378</guid>
		<description><![CDATA[To increase the reliability of our backups at WireLoad, we wanted to utilize S3. Obviously we couldn&#8217;t just send our backups to S3 without encrypting them, so GnuPG was part of the equation from the beginning. As I started my research, I found a ton guides on how to utilize a variety of backup tools [...]]]></description>
			<content:encoded><![CDATA[<p>To increase the reliability of our backups at WireLoad, we wanted to utilize S3. Obviously we couldn&#8217;t just send our backups to S3 without encrypting them, so GnuPG was part of the equation from the beginning. As I started my research, I found a ton guides on how to utilize a variety of backup tools to get your backups delivered to S3. Some of the tools looked really promising. After reading the specs, <a href="http://duplicity.nongnu.org/">Duplicity</a> stood out as the winner. It supported S3, encryption and the whole shebang. It even supported incremental backups. Bingo I thought. That&#8217;s perfect.</p>
<p>That said, I installed Duplicity on a test-server and started experimenting with it. As I&#8217;m fairly familiar with GnuPG and PGP encryption, I reckoned that the ideal setup would be the standard public/private key structure and only have the public key installed on the server. The private key would be stored elsewhere. So far so good, Duplicity asked for the public key in its configure, but it still asked for the passphrase when running. Surely, you could store the passphrase in plain text and parse it to Duplicity, but that&#8217;s kind of pointless, as it defeats the purpose of a passphrase.<br />
<span id="more-378"></span><br />
Now you may say &#8216;Hey! you probably already store the backups without encryption anyways, so what&#8217;s the point?&#8217; The point is that there could be backups from other servers stored in the S3 bucket. If you save the passphrase (and somehow gets your hand on the private key), these are all compromised too. If you were instead able to encrypt the backup just using the public key, without the passphrase, these backups would be a lot more secure. </p>
<p>As it turns out, that is possible with GnuPG &#8212; just not with Duplicity (AFAIK). The key is to encrypt the backups with the public key as the &#8216;recipient.&#8217; I&#8217;m not going to tell you how to get up and running with GnuPG (see <a href="http://www.gnupg.org/gph/en/manual/c14.html">this page instead</a>).</p>
<p>Assuming you&#8217;ve installed the public key (gpg &#8211;import your-public-key), all you need to for encrypting a file without entering the passphrase is as follows:</p>
<blockquote><p>
gpg &#8211;encrypt &#8211;recipient &#8216;the-email-in@your-key.net&#8217; filename
</p></blockquote>
<p>Pretty easy, right?</p>
<p>If we want to pull that into a script, we just need <a href="http://s3tools.org/s3cmd">s3cmd</a> to the mix, and we&#8217;re pretty much all set. You will also need to configure s3cmd (s3cmd &#8211;configure) with your AWS information.</p>
<p>Here&#8217;s the script I ended up with. Please note that the path I backup only includes achieves generated from another backup script. Also, the archive only includes files with the extension tbz, bz2 and tar. I&#8217;m sure you could play with s3cmd&#8217;s &#8216;rexclude&#8217; feature to write a pretty RegEx, but it wasn&#8217;t worth the time for me.</p>
<blockquote><p>
#!/bin/sh</p>
<p># Path to backup<br />
BACKUP=/path/to/backup/archive</p>
<p>for i in `find $BACKUP -type f | grep -v .gpg`<br />
        do gpg &#8211;batch &#8211;encrypt &#8211;recipient &#8216;the-email-in@your-key.net&#8217; $i<br />
done</p>
<p>s3cmd sync -r $BACKUP &#8211;exclude=&#8217;.tbz&#8217; &#8211;exclude=&#8217;.bz2&#8242; &#8211;exclude=&#8217;.gz&#8217; s3://your-bucket/`hostname -s`/
</p></blockquote>
<p>Enjoy. If you have any comments, please let me know. </p>
]]></content:encoded>
			<wfw:commentRss>http://viktorpetersson.com/2010/07/23/how-to-backup-to-s3-with-gnupg-pgp-without-having-to-store-the-passphrase-locally/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chronicle.IM is almost ready&#8230;</title>
		<link>http://viktorpetersson.com/2010/07/17/chronicle-im-is-almost-ready/</link>
		<comments>http://viktorpetersson.com/2010/07/17/chronicle-im-is-almost-ready/#comments</comments>
		<pubDate>Sat, 17 Jul 2010 12:34:22 +0000</pubDate>
		<dc:creator>Viktor Petersson</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Chronicle.IM]]></category>

		<guid isPermaLink="false">http://viktorpetersson.com/?p=370</guid>
		<description><![CDATA[Last night we rolled out a new version of Chronicle.IM to the production servers. The product is not quite ready yet, but you can sign up with your email address if you want to be invited to the beta-version. Over the next few weeks we will start letting a few beta-testers in. If everything goes [...]]]></description>
			<content:encoded><![CDATA[<p>Last night we rolled out a new version of <a href="http://www.chronicle.im">Chronicle.IM</a> to the production servers. The product is not quite ready yet, but you can sign up with your email address if you want to be invited to the beta-version. Over the next few weeks we will start letting a few beta-testers in. If everything goes well, we will invite more. </p>
<p>So what is <a href="http://www.chronicle.im">Chronicle.IM</a>? The slogan for the product is &#8216;Write the story of your life.&#8217; That sums it up pretty well. It is an online journaling/diary app that allows you to keep track of your life in with ease and style. While I don&#8217;t want to reveal all the details now, let&#8217;s just say that we&#8217;ve focused on simplicity and usability. You won&#8217;t be disappointed. </p>
]]></content:encoded>
			<wfw:commentRss>http://viktorpetersson.com/2010/07/17/chronicle-im-is-almost-ready/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Monitor Nginx and disk-usage with Monit</title>
		<link>http://viktorpetersson.com/2010/07/12/monitor-nginx-and-disk-usage-with-monit/</link>
		<comments>http://viktorpetersson.com/2010/07/12/monitor-nginx-and-disk-usage-with-monit/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 10:19:58 +0000</pubDate>
		<dc:creator>Viktor Petersson</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Monit]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://viktorpetersson.com/?p=355</guid>
		<description><![CDATA[Yesterday I posted an article on how to monitor Apache and PostgreSQL with Monit. After setting that up I was amazed how simple and flexible Monit was, so I moved on with two more tasks: monitor Nginx and disk usage. This article assumes that you&#8217;ve set up Monit in accordance with the previous article. It [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I posted an article on <a href="http://viktorpetersson.com/2010/07/09/setting-up-monit-to-monitor-apache-and-postgresql-on-ubuntu/">how to monitor Apache and PostgreSQL with Monit</a>. After setting that up I was amazed how simple and flexible Monit was, so I moved on with two more tasks: monitor Nginx and disk usage.<br />
<span id="more-355"></span><br />
This article assumes that you&#8217;ve set up Monit in accordance with the previous article. It also assumes that you&#8217;re on Ubuntu 9.10 or 10.04. If you use a different Linux or Unix flavor, you will probably need to modify a few paths. </p>
<h4>Nginx</h4>
<p>(/etc/monit/conf.d/nginx.conf)</p>
<blockquote><p>
check process nginx with pidfile /var/run/nginx.pid<br />
	group www<br />
	start program = &#8220;/etc/init.d/nginx start&#8221;<br />
	stop program = &#8220;/etc/init.d/nginx stop&#8221;<br />
	if children > 250 then restart<br />
	if loadavg(5min) greater than 10 for 8 cycles then stop<br />
	if 3 restarts within 5 cycles then timeout
</p></blockquote>
<p><a href="http://viktorpetersson.com/upload/monit/nginx.conf">Download</a></p>
<h4>Disk usage</h4>
<p>(/etc/monit/conf.d/diskusage.conf)</p>
<blockquote><p>
check filesystem md3 with path /dev/md3<br />
	group server<br />
	if failed permission 660 then unmonitor<br />
	if failed uid root then unmonitor<br />
	if failed gid disk then unmonitor<br />
	if space usage > 80 % then alert<br />
	if inode usage > 80 % then alert
</p></blockquote>
<p><a href="http://viktorpetersson.com/upload/monit/diskusage.conf">Download</a></p>
<p>Please note that the above script monitors &#8216;/dev/md3.&#8217; You can replace this with the path to the file system you want to monitor, such as /dev/sda1 or /dev/hda1. You can also configure Monit to take actions based on certain criterions, but I left that part out as I didn&#8217;t find any need for it. You can read more about that <a href="http://mmonit.com/monit/documentation/monit.html">here</a>. If you want to monitor more file systems, simply repeat the above config with a different &#8216;path.&#8217;</p>
<p>Once you&#8217;ve added you new configs, you need to restart Monit (/etc/init.d/monit restart).</p>
]]></content:encoded>
			<wfw:commentRss>http://viktorpetersson.com/2010/07/12/monitor-nginx-and-disk-usage-with-monit/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Setting up Monit to monitor Apache and PostgreSQL on Ubuntu</title>
		<link>http://viktorpetersson.com/2010/07/09/setting-up-monit-to-monitor-apache-and-postgresql-on-ubuntu/</link>
		<comments>http://viktorpetersson.com/2010/07/09/setting-up-monit-to-monitor-apache-and-postgresql-on-ubuntu/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 16:05:32 +0000</pubDate>
		<dc:creator>Viktor Petersson</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Monit]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://viktorpetersson.com/?p=333</guid>
		<description><![CDATA[Monit is a great little utility that monitors your daemons. If a daemon fails, Monit will start the daemon it will automatically restart the process. It comes in very handy if for web-servers, such as Apache. For Red iGone we use Apache as the web-server, and PostgreSQL as the database. I wanted to configure Monit [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://mmonit.com/monit/">Monit</a> is a great little utility that monitors your daemons. If a daemon fails, Monit will start the daemon it will automatically restart the process. It comes in very handy if for web-servers, such as Apache. </p>
<p>For <a href="http://www.redigone.com">Red iGone</a> we use Apache as the web-server, and PostgreSQL as the database. I wanted to configure Monit to keep an eye on these processes. As it turns out, setting up Monit was really straight-forward. </p>
<p>I tried this on Ubuntu 9.10 and 10.04. If you try this on a different Ubuntu version (or other distribution), it is likely that you will need to make changes to apache.conf and postgresql.conf.<br />
<span id="more-333"></span><br />
						<div class="flickr-gallery image none"><a href="http://www.flickr.com/photos/vpetersson/4777587884"><img class="flickr medium" title="Monit" alt="Monit" src="http://farm5.static.flickr.com/4082/4777587884_23d7aa9958.jpg" /></a></div>
					<br />
<em>Monit in action.</em></p>
<h3>Install Monit</h3>
<p>Installing Monit on Ubuntu is dead simple. Just run:<br />
<code><br />
sudo apt-get install monit<br />
</code></p>
<h3>Configure Monit</h3>
<p>Now let&#8217;s configure Monit. We start with the generic config-file. Open <strong>/etc/monit/monitrc</strong> in your favorite editor and add the following line:<br />
<code><br />
include /etc/monit/conf.d/*<br />
</code></p>
<p><strong>Important</strong>: Change permission on the folder /etc/monit/conf.d as it will include your email password stored in plain text.<br />
<code><br />
sudo chmod a-rwx,u=rwX -R /etc/monit/conf.d/<br />
</code></p>
<p>Next we need to edit <strong>/etc/default/monit</strong> and change  &#8220;startup=0&#8243; to &#8220;startup=1&#8243;.</p>
<p>Now we&#8217;re ready to really start configuring Monit. Just to keep things, organized, I&#8217;ve broken down the Monit&#8217;s settings into three files: </p>
<ul>
<li>basic.conf</li>
<li>apache.conf</li>
<li>postgresql.conf</li>
</ul>
<p>In basic.conf I&#8217;ve put the generic Monit-configs, and then broken out Apache&#8217;s and PosgreSQL&#8217;s configs into their own files. </p>
<h4>basic.conf</h4>
<p> (/etc/monit/conf.d/basic.conf)</p>
<blockquote><p>
set daemon 60<br />
set logfile syslog facility log_daemon</p>
<p>set mailserver smtp.gmail.com port 587<br />
        username &#8220;user@domain.com&#8221; password &#8220;password&#8221;<br />
        using tlsv1<br />
        with timeout 30 seconds</p>
<p>set alert admin@domain.com</p>
<p>set httpd port 2812 and<br />
        use address localhost<br />
        allow localhost<br />
        allow admin:monit</p>
<p>check system localhost<br />
        if loadavg (1min) > 4 then alert<br />
        if loadavg (5min) > 2 then alert<br />
        if memory usage > 75% then alert<br />
        if cpu usage (user) > 70% then alert<br />
        if cpu usage (system) > 30% then alert<br />
        if cpu usage (wait) > 20% then alert
</p></blockquote>
<p><a href="http://viktorpetersson.com/upload/monit/basic.conf">Download</a></p>
<p>The above file is configured to send email using Google Apps or Gmail. Just change your username and password according to your needs. I&#8217;ve also enabled Monit&#8217;s webserver that allows you to view Monit&#8217;s status directly in your browser. Access is restricted to localhost and you need to login with the username &#8216;admin&#8217; and password &#8216;monit. </p>
<p>I prefer to restrict access to just localhost, and then use a SSH-tunnel to gain access. </p>
<h4>apache.conf</h4>
<p> (/etc/monit/conf.d/apache.conf)</p>
<blockquote><p>
check process apache2 with pidfile /var/run/apache2.pid<br />
        group www<br />
        start program = &#8220;/etc/init.d/apache2 start&#8221;<br />
        stop program  = &#8220;/etc/init.d/apache2 stop&#8221;<br />
        if children > 250 then restart<br />
        if loadavg(5min) greater than 10 for 8 cycles then stop<br />
        if 3 restarts within 5 cycles then timeout
</p></blockquote>
<p><a href="http://viktorpetersson.com/upload/monit/apache.conf">Download</a></p>
<p>This is pretty straight forward. Assuming you use the Apache-distribution that came with Ubuntu, you shouldn&#8217;t need to modify anything. </p>
<h4>postgresql.conf</h4>
<p>(/etc/monit/conf.d/posgresql.conf)</p>
<blockquote><p>
check process postgresql with pidfile /var/run/postgresql/8.4-main.pid<br />
        group database<br />
        start program = &#8220;/etc/init.d/postgresql-8.4 start&#8221;<br />
        stop  program = &#8220;/etc/init.d/postgresql-8.4 stop&#8221;<br />
if failed unixsocket /var/run/postgresql/.s.PGSQL.5432 protocol pgsql then restart<br />
if failed unixsocket /var/run/postgresql/.s.PGSQL.5432 protocol pgsql then alert<br />
if failed host localhost port 5432 protocol pgsql then restart<br />
if failed host localhost port 5432 protocol pgsql then alert<br />
if 5 restarts within 5 cycles then timeout
</p></blockquote>
<p><a href="http://viktorpetersson.com/upload/monit/postgresql.conf">Download</a></p>
<p>The same thing applies here. Assuming you used the PosgreSQL-version (8.4) that came with Ubuntu, you shouldn&#8217;t need to modify anything here. </p>
<h2>Final steps</h2>
<p>Now that you have configured all the files, all that needs to be done is to fire up Monit and make verify that it is running. To launch Monit, simply run:<br />
<code><br />
sudo /etc/init.d/monit start<br />
</code></p>
<p>You can verify that Monit is running either by browsing to the webserver or checking /var/log/syslog. You should also receive an email that says that Monit is now running.</p>
<p>Assuming everything went well, you also want to make sure that Monit actually starts a daemon if it is failing. A simple way to do that is to run:<br />
<code><br />
sudo killall apache2<br />
</code></p>
<p>That should kill Apache. Monit should be able to detect that and fire it back up shortly. Again, you should be able to monitor Monit&#8217;s process either by email, the web-interface, or in /var/log/syslog.</p>
<p>That&#8217;s it. Good luck!</p>
<p><strong>Update:</strong> I decided to extend this guide and wrote another article on <a href="http://viktorpetersson.com/2010/07/12/monitor-nginx-and-disk-usage-with-monit/">how to monitor Nginx and disk-usage</a> with Monit.</p>
]]></content:encoded>
			<wfw:commentRss>http://viktorpetersson.com/2010/07/09/setting-up-monit-to-monitor-apache-and-postgresql-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Website review session from Google I/O</title>
		<link>http://viktorpetersson.com/2010/06/04/website-review-session-from-google-io/</link>
		<comments>http://viktorpetersson.com/2010/06/04/website-review-session-from-google-io/#comments</comments>
		<pubDate>Fri, 04 Jun 2010 22:27:01 +0000</pubDate>
		<dc:creator>Viktor Petersson</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://viktorpetersson.com/?p=327</guid>
		<description><![CDATA[If you are new to SEO, or just want to learn more about SEO, Matt Cutts and a few colleagues did a really good presentation on Google I/O where they went through several websites and reviewd them from an SEO perspective. The whole presentation is about an hour long, but well worth watching.]]></description>
			<content:encoded><![CDATA[<p>If you are new to SEO, or just want to learn more about SEO, Matt Cutts and a few colleagues did a really good presentation on Google I/O where they went through several websites and reviewd them from an SEO perspective. The whole presentation is about an hour long, but well worth watching.</p>
<p><object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/7Hk5uVv8JpM&#038;hl=en_US&#038;fs=1&#038;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/7Hk5uVv8JpM&#038;hl=en_US&#038;fs=1&#038;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://viktorpetersson.com/2010/06/04/website-review-session-from-google-io/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to install ZoneMinder 1.24.2 on Ubuntu 10.04 LTS Server</title>
		<link>http://viktorpetersson.com/2010/05/23/how-to-install-zoneminder-1-24-2-on-ubuntu-10-04-lts-server/</link>
		<comments>http://viktorpetersson.com/2010/05/23/how-to-install-zoneminder-1-24-2-on-ubuntu-10-04-lts-server/#comments</comments>
		<pubDate>Sun, 23 May 2010 15:18:32 +0000</pubDate>
		<dc:creator>Viktor Petersson</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[ZoneMinder]]></category>

		<guid isPermaLink="false">http://viktorpetersson.com/?p=298</guid>
		<description><![CDATA[Last week I published a new version of my ZoneMinder Virtual Appliance. The virtual appliance is great if you want to easily deploy ZoneMinder without having to spend time setting it up. However, in some situations, you want to run ZoneMinder directly on the hardware. Perhaps you need better performance or simply need to capture [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I published a new version of my <a href="http://viktorpetersson.com/open-source/zoneminder-virtual-appliance">ZoneMinder Virtual Appliance</a>. The virtual appliance is great if you want to easily deploy ZoneMinder without having to spend time setting it up. However, in some situations, you want to run ZoneMinder directly on the hardware. Perhaps you need better performance or simply need to capture video streams from V4L-devices.</p>
<p>Since I already spent the time getting it running, I thought I&#8217;d share the instructions for getting it running. It&#8217;s pretty straight forward, but there are a few minor things that took me some time to get around.<br />
 <span id="more-298"></span><br />
				<div id="gallery-3e394d51" class="flickr-gallery photoset">
													<div class="flickr-thumb">
									<a href="http://flickr.com/photo.gne?id=4632354270"><img class="photo" title="'Minimal' install mode. Hit F4 at boot." src="http://farm4.static.flickr.com/3338/4632354270_dab3ed557f_s.jpg" alt="'Minimal' install mode. Hit F4 at boot." /></a>
								</div>
															<div class="flickr-thumb">
									<a href="http://flickr.com/photo.gne?id=4632354374"><img class="photo" title="Software Selection" src="http://farm5.static.flickr.com/4045/4632354374_58060abf16_s.jpg" alt="Software Selection" /></a>
								</div>
															<div class="flickr-thumb">
									<a href="http://flickr.com/photo.gne?id=4631754687"><img class="photo" title="ZoneMinder in Action" src="http://farm5.static.flickr.com/4022/4631754687_c32b4342ca_s.jpg" alt="ZoneMinder in Action" /></a>
								</div>
												<div class="fg-clear"></div>
				</div>
												<div class="fg-clear"></div>
							<script type="text/javascript">
											jQuery(document).ready(function(){
							jQuery("#gallery-3e394d51 .flickr-thumb img").flightbox({size_callback: get_sizes});
						});
										
										//-->
				</script>
			</p>
<h1>Installation</h1>
<p><strong>Optional:</strong> I personally prefer to install the do &#8216;minimal&#8217; version of Ubuntu. You can install this mode by simply hitting F4 right at boot.</p>
<p>Other than the installing the &#8216;minimal&#8217; system, the only things you would need to keep in mind are to install &#8220;LAMP&#8221; and &#8220;OpenSSH&#8221; under the Software selection. You will also need to pick a MySQL password, which will be used later.</p>
<h1>Configuration</h1>
<p>Upgrade the package repository:<br />
<code>sudo apt-get update &#038;&#038; sudo apt-get upgrade</code></p>
<p>Install all required dependencies:<br />
<code>sudo apt-get install build-essential ffmpeg libmysqlclient-dev libjpeg-dev libssl-dev libdate-manip-perl wget liblwp-useragent-determined-perl libavformat-dev libphp-serialization-perl libswscale-dev joe</code></p>
<p>Get Zoneminder:<br />
<code>wget http://www.zoneminder.com/downloads/ZoneMinder-1.24.2.tar.gz</code></p>
<p>Extract Zoneminder and change permission:<br />
<code>sudo tar xvfz ZoneMinder-1.24.2.tar.gz -C /usr/local/<br />
sudo chown -R `whoami` /usr/local/ZoneMinder-1.24.2</code></p>
<p>Configure Zoneminder:<br />
<code>cd /usr/local/ZoneMinder-1.24.2<br />
./configure --with-webdir=/var/www/zm --with-cgidir=/usr/lib/cgi-bin/ --with-webuser=www-data --with-webgroup=www-data ZM_DB_USER=zm ZM_DB_NAME=zm ZM_DB_PASS=yourpassword ZM_SSL_LIB=openssl<br />
</code></p>
<p>Resolve a bug (discussed more <a href="http://www.zoneminder.com/forums/viewtopic.php?p=55152">here</a>):<br />
<code>joe src/zm_utils.cpp</code> (or your favorite editor)<br />
Add the line &#8216;#include <cstdio>&#8216; on row 22 (or somewhere in that general area). To exit and save with Joe, press <em>ctrl+k x</em>.</p>
<p>Build and install Zoneminder<br />
<code>make<br />
sudo make install</code></p>
<p>Configure the database:<br />
<code>mysql -uroot -p < db/zm_create.sql<br />
echo "GRANT ALL PRIVILEGES ON zm.* TO 'zm'@'localhost' IDENTIFIED BY 'yourpassword'; FLUSH PRIVILEGES;" | mysql -uroot -p</code></p>
<p>Install Cambozola:<br />
<code>cd<br />
wget http://www.charliemouse.com:8080/code/cambozola/cambozola-latest.tar.gz<br />
tar xvfz cambozola-latest.tar.gz<br />
sudo cp cambozola-0.76/dist/cambozola.jar /var/www/zm/</code></p>
<p>Make Zoneminder the root-page in Apache:<br />
<code>sudo joe /etc/apache2/sites-enabled/000-default </code></p>
<p>Change "DocumentRoot /var/www" to "DocumentRoot /var/www/zm" and "Directory /var/www/" to "Directory /var/www/zm/"</p>
<p>Restart Apache:<br />
<code>sudo /etc/init.d/apache2 restart</code></p>
<p>Change some system parameters:<br />
<code>sudo sysctl kernel.shmall=134217728<br />
sudo sysctl kernel.shmmax=134217728 </code></p>
<p>Make the system parameters permanent:<br />
<code>sudo joe /etc/sysctl.conf</code></p>
<p>Add the following lines at the end:<br />
<code>kernel.shmall=134217728<br />
kernel.shmmax=134217728 </code></p>
<p>Install the startup-script (from the <a href="http://www.zoneminder.com/wiki/index.php/Debian_init.d">official site</a>):<br />
<code>sudo wget http://viktorpetersson.com/upload/zm -O /etc/init.d/zm<br />
sudo chmod +x /etc/init.d/zm<br />
sudo update-rc.d zm defaults<br />
sudo /etc/init.d/zm start</code></p>
<p>That's it. You should now have a fully working version of ZoneMinder. All you need to do now is to point your browser to the IP address of the server. </p>
]]></content:encoded>
			<wfw:commentRss>http://viktorpetersson.com/2010/05/23/how-to-install-zoneminder-1-24-2-on-ubuntu-10-04-lts-server/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Trouble with ZoneMinder VA 0.2 and VMware Server 2</title>
		<link>http://viktorpetersson.com/2010/05/17/trouble-with-zoneminder-va-0-2-and-vmware-server-2/</link>
		<comments>http://viktorpetersson.com/2010/05/17/trouble-with-zoneminder-va-0-2-and-vmware-server-2/#comments</comments>
		<pubDate>Mon, 17 May 2010 11:53:57 +0000</pubDate>
		<dc:creator>Viktor Petersson</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[ZoneMinder]]></category>

		<guid isPermaLink="false">http://viktorpetersson.com/?p=296</guid>
		<description><![CDATA[Last week I launched ZoneMinder VA 0.2. Unfortunately there is an issue with the image that prevents it from loading properly into VMware Server 2. The root of the problem is actually an incompatibility issue between VMware Fusion and VMware Server, but that doesn&#8217;t matter. Fortunately the workaround is pretty simple. - Delete any vmdk.lck [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I launched <a href="http://viktorpetersson.com/open-source/zoneminder-virtual-appliance/">ZoneMinder VA 0.2</a>. Unfortunately there is an issue with the image that prevents it from loading properly into VMware Server 2. The root of the problem is actually an incompatibility issue between VMware Fusion and VMware Server, but that doesn&#8217;t matter. Fortunately the workaround is pretty simple. </p>
<p>- Delete any vmdk.lck directries<br />
- Delete any vmem.lck directories<br />
- Delete the quicklook-cache.png file<br />
- Edit the .vmx file and set to FALSE entries for USB, SOUND and SERIAL.</p>
]]></content:encoded>
			<wfw:commentRss>http://viktorpetersson.com/2010/05/17/trouble-with-zoneminder-va-0-2-and-vmware-server-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Red iGone screencast/demo</title>
		<link>http://viktorpetersson.com/2010/05/15/red-igone-screencastdemo/</link>
		<comments>http://viktorpetersson.com/2010/05/15/red-igone-screencastdemo/#comments</comments>
		<pubDate>Sat, 15 May 2010 20:43:44 +0000</pubDate>
		<dc:creator>Viktor Petersson</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Red iGone]]></category>

		<guid isPermaLink="false">http://viktorpetersson.com/?p=286</guid>
		<description><![CDATA[I just recorded a screencast of Red iGone in action. The video is a bit rough (in particular the audio), but I hope it gets the message across. Enjoy.]]></description>
			<content:encoded><![CDATA[<p>I just recorded a screencast of <a href="http://www.redigone.com">Red iGone</a> in action. The video is a bit rough (in particular the audio), but I hope it gets the message across. Enjoy.</p>
<p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/f0vwjg9XOI4&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/f0vwjg9XOI4&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://viktorpetersson.com/2010/05/15/red-igone-screencastdemo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hello Grub, you suck!</title>
		<link>http://viktorpetersson.com/2010/05/14/hello-grub-you-suck/</link>
		<comments>http://viktorpetersson.com/2010/05/14/hello-grub-you-suck/#comments</comments>
		<pubDate>Fri, 14 May 2010 13:59:43 +0000</pubDate>
		<dc:creator>Viktor Petersson</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Grub]]></category>
		<category><![CDATA[Lilo]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://viktorpetersson.com/?p=283</guid>
		<description><![CDATA[In the last few weeks I had to set up a few new Linux servers. Since Ubuntu is my preferred Linux dist in recent years, 10.04 LTS was a natural choice. Ubuntu 10.04 LTS is a great Linux distribution, with one exception: Grub. I really mean it. Grub is probably the worst boot loader to [...]]]></description>
			<content:encoded><![CDATA[<p>In the last few weeks I had to set up a few new Linux servers. Since Ubuntu is my preferred Linux dist in recent years, 10.04 LTS was a natural choice. </p>
<p>Ubuntu 10.04 LTS is a great Linux distribution, with one exception: Grub. I really mean it. Grub is probably the worst boot loader to date. Is so bad that it could equally well be replaced with the following shell script:</p>
<p><code><br />
echo ""<br />
sleep 10<br />
</code></p>
<p>The better alternative to Grub is obviously Lilo. While it may be obsolete, poorly updated and 20 years old, it does one thing that Grub doesn&#8217;t: it works. Personally I couldn&#8217;t care less about fancy splash screens and all the bells and whistles that Grub can put on it&#8217;s repertoire. It&#8217; doesn&#8217;t matter when it cannot boot the system. Please Ubuntu, just ditch Grub and make Lilo the default boot loader. </p>
]]></content:encoded>
			<wfw:commentRss>http://viktorpetersson.com/2010/05/14/hello-grub-you-suck/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ZoneMinder Virtual Appliance 0.2 Released</title>
		<link>http://viktorpetersson.com/2010/05/09/zoneminder-virtual-appliance-0-2-released/</link>
		<comments>http://viktorpetersson.com/2010/05/09/zoneminder-virtual-appliance-0-2-released/#comments</comments>
		<pubDate>Sun, 09 May 2010 20:54:34 +0000</pubDate>
		<dc:creator>Viktor Petersson</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[ZoneMinder]]></category>

		<guid isPermaLink="false">http://viktorpetersson.com/?p=276</guid>
		<description><![CDATA[ZoneMinder is a great piece software. It is a very powerful video surveillance tool that can be configured with both IP cameras and regular cameras (via V4L). Unfortunately it is a bit difficult to get up and running with. A while back I needed to deploy ZoneMinder myself for a client. One thing lead to [...]]]></description>
			<content:encoded><![CDATA[<p>ZoneMinder is a great piece software. It is a very powerful video surveillance tool that can be configured with both IP cameras and regular cameras (via V4L). Unfortunately it is a bit difficult to get up and running with. A while back I needed to deploy ZoneMinder myself for a client. One thing lead to another, and I ended up with a fully working Virtual Machine for ZoneMinder. I uploaded it here just for fun, but it didn&#8217;t take long before I had was linked to from the official ZoneMinder project and the visitors started to pour in. </p>
<p>Today I just released version 0.2. It is using the latest LTS version of Ubuntu (10.04) and ZoneMinder 1.24.2. I&#8217;ve also reduced the size of the VM significantly. The new version is about 1GB extracted and around 350MB compressed. </p>
<p>For more information about the VM and how to download it, please visit <a href="http://viktorpetersson.com/open-source/zoneminder-virtual-appliance">this page</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://viktorpetersson.com/2010/05/09/zoneminder-virtual-appliance-0-2-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
