<?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>My Wushu Blog &#187; PostgreSQL</title>
	<atom:link href="http://www.mywushublog.com/tag/postgresql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mywushublog.com</link>
	<description></description>
	<lastBuildDate>Tue, 31 Jan 2012 18:42:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Using Amazon&#8217;s S3 for Backups</title>
		<link>http://www.mywushublog.com/2009/04/using-amazon-s3-for-backups/</link>
		<comments>http://www.mywushublog.com/2009/04/using-amazon-s3-for-backups/#comments</comments>
		<pubDate>Sun, 26 Apr 2009 01:47:31 +0000</pubDate>
		<dc:creator>Mike Carlson</dc:creator>
				<category><![CDATA[Geekyness]]></category>
		<category><![CDATA[Backups]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[S3]]></category>

		<guid isPermaLink="false">http://www.mywushublog.com/?p=337</guid>
		<description><![CDATA[I don&#8217;t have a backup system for home (which is where this site, and others are located), and I have generally relied on duplicating enough of my important stuff between friends and other computers. That, and I have a RAID5 setup for my large storage, and then home directories and ...]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t have a backup system for home (which is where this site, and others are located), and I have generally relied on duplicating enough of my important stuff between friends and other computers. That, and I have a RAID5 setup for my large storage, and then home directories and website stuff is on a RAID1 ZFS volume. This doesn&#8217;t prevent accidental &#8220;oh-no&#8221;s, but it does protect me from some hardware failures.</p>
<p>Last year when I upgraded to the new server, I lost a lot of data because I forgot to backup all of my MySQL databases. I like to think I can learn from my mistakes, so a full year later I finally did something about it and signed up for Amazon&#8217;s S3 service.</p>
<p>The pricing is pretty nice, and I don&#8217;t have all that much data to backup. I figure, I&#8217;ll use up a few GB in total, and keep the monthly price around $1 &#8211; $2. That seems worth the price for off-site backup&#8217;s.</p>
<p>Now, I have 3 main websites that I need to backup, and one test site that I like to play around with:</p>
<ul>
<li><a href="http://www.m87-blackhole.org/">http://www.m87-blackhole.org/</a> &lt;- This is the first domain that I owned, and its the site where my family checks out new photos</li>
<li><a href="http://www.willowoakboarding.com/">http://www.willowoakboarding.com/</a> &lt;- My parent&#8217;s site for their boarding ranch. I&#8217;m glad they have no concept of a SLA, or that things need to be backed up :)</li>
<li><a href="http://www.mywushublog.com/">http://www.mywushublog.com/</a> &lt;- This site of course, where I claim my own identity on the internet</li>
<li><a href="http://www.evil-genius-network.com/">http://www.evil-genius-network.com/</a> &lt;- a test domain, but now I run a little OpenID service, For one&#8230;</li>
</ul>
<p>After a quick &#8220;FreeBSD s3 backup&#8221; Google search, I found Gary Dalton&#8217;s blog post: <a href="http://dvector.com/oracle/2008/10/18/backing-up-to-amazon-s3/">http://dvector.com/oracle/2008/10/18/backing-up-to-amazon-s3/</a>. After reading this post, I formulated my plan of attack:</p>
<ul>
<li>Sign up for S3, create a &#8220;bucket&#8221; for each site</li>
<li>Use something to interface with S3 ( <a href="http://duplicity.nongnu.org/">duplicity</a> )</li>
<li>Automate MySQL and PostgreSQL backups</li>
<li>Create a service account to run both s3 and db backup scripts as</li>
<li>Set up a cron job for backups</li>
</ul>
<p>So, after I signed up for S3, I had to create the buckets. I couldn&#8217;t find a way to do this though my Amazon account settings, so I created a little ruby script.<br />
<code><br />
$ sudo gem install aws-s3<br />
$ vim make-bucket.rb<br />
</code></p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;">#!/usr/local/bin/ruby</span>
&nbsp;
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'aws/s3'</span>
&nbsp;
<span style="color:#6666ff; font-weight:bold;">AWS::S3::Base</span>.<span style="color:#9900CC;">establish_connection</span>!<span style="color:#006600; font-weight:bold;">&#40;</span>
<span style="color:#ff3333; font-weight:bold;">:access_key_id</span>     <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'my-s3-key-id'</span>,
<span style="color:#ff3333; font-weight:bold;">:secret_access_key</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'my-s3-secret-access-key'</span>
<span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#6666ff; font-weight:bold;">AWS::S3::Bucket</span>.<span style="color:#9900CC;">create</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'mywushublog'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#6666ff; font-weight:bold;">AWS::S3::Bucket</span>.<span style="color:#9900CC;">create</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'willowoak'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#6666ff; font-weight:bold;">AWS::S3::Bucket</span>.<span style="color:#9900CC;">create</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'m87-blackhole'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#6666ff; font-weight:bold;">AWS::S3::Bucket</span>.<span style="color:#9900CC;">create</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'evil-genius-network'</span><span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div>

<p><code>$ ./make-bucket.rb</code><br />
Next, I had to install duplicity and py-boto<br />
<code>[root@server ~] cd /usr/ports/sysutils/duplicity<br />
[root@server duplicity] make install<br />
...<br />
[root@server duplicity] cd ../../devel/py-boto<br />
[root@server py-boto] make install clean<br />
...<br />
[root@server py-boto]</code><br />
Next step, create a user (with access to shared data, and website data) to run the backups with the adduser command&#8230;<br />
<code>[root@server py-boto] adduser -g shared-data -G www -s /bin/tcsh -w random s3backupuser<br />
...<br />
[roott@server py-boto] su - s3backupuser<br />
In tcsh, you can `set autolist' to have the shell automatically show<br />
all the possible matches when doing filename/directory expansion.<br />
%</code><br />
I&#8217;ll have to set my Access ID and Access Key in the s3backupuser&#8217;s environment, as well as a GnuPG passphrase so the backups are encrypted (and compressed). I mean, I trust Amazon, but not THAT much :)<br />
<code>% vim .cshrc<br />
setenv AWS_ACCESS_KEY_ID my-s3-key-id<br />
setenv AWS_SECRET_ACCESS_KEY my-s3-secrect-access-key<br />
setenv PASSPRASE AVeryRandonPassphraseForGnuPG</code><br />
Next, I copied the very useful automysqlbackup.sh script into a separate script for each website. I could have just dumped every database that was running, but I wanted to segregate each site&#8217;s databases into a different directory. So, I&#8217;m complicating my cron job by running multiple backup scripts, but I really want to make the end result easily readable and identifiable by me. So for each site, I create a directoy under /u01/backups:<br />
<code>%ll /u01/backups/<br />
total 8<br />
drwxr-x---  5 s3-backupuser  mysql  5 Apr 25 15:46 evil-genius-network<br />
drwxr-x---  5 s3-backupuser  mysql  5 Apr 25 15:47 m87-blackhole<br />
drwxr-x---  5 s3-backupuser  mysql  5 Apr 25 15:46 mywushublog<br />
drwxr-x---  5 s3-backupuser  mysql  5 Apr 25 15:47 willowoak</code><br />
Next was the s3-backups.sh script, which is very crude and simple. If I&#8217;m really motivated, I&#8217;ll make it nicer but I&#8217;m lazy and if I don&#8217;t need anymore functionality then I&#8217;ll just leave it. One thing I initially forgot was that I set my Amazon S3 variables in the users .cshrc profile. This is not a good place to have those things, it was just handy as I was running the duplicity commands manually. So I had to add those in, otherwise the cron job would fail.</p>
<p><strong>~/bin/s3-backups.sh</strong>:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #007800;">PATH</span>=<span style="color: #000000; font-weight: bold;">/</span>sbin:<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>games:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>sbin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>s3<span style="color: #000000; font-weight: bold;">/</span>bin
&nbsp;
<span style="color: #666666; font-style: italic;"># Amazon S3 keys, and GnuPG keys</span>
<span style="color: #007800;">AWS_ACCESS_KEY_ID</span>=
<span style="color: #007800;">AWS_SECRET_ACCESS_KEY</span>=
<span style="color: #007800;">PASSPHRASE</span>=
<span style="color: #7a0874; font-weight: bold;">export</span> AWS_ACCESS_KEY_ID
<span style="color: #7a0874; font-weight: bold;">export</span> AWS_SECRET_ACCESS_KEY
<span style="color: #7a0874; font-weight: bold;">export</span> PASSPHRASE
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;*************************************************&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;*   Backing up Website content....              *&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;*                                               *&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;*     www.willowoakboarding.com...              *&quot;</span>
duplicity <span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>www.willowoakboarding.com s3+http:<span style="color: #000000; font-weight: bold;">//</span>s3.amazon.com<span style="color: #000000; font-weight: bold;">/</span>willowoak<span style="color: #000000; font-weight: bold;">/</span>www
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;*     www.mywushublog.com...                    *&quot;</span>
duplicity <span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>www.mywushublog.com s3+http:<span style="color: #000000; font-weight: bold;">//</span>s3.amazon.com<span style="color: #000000; font-weight: bold;">/</span>mywushublog<span style="color: #000000; font-weight: bold;">/</span>www
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;*     www.m87-blackhole.org...                  *&quot;</span>
duplicity <span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>www.m87-blackhole.org s3+http:<span style="color: #000000; font-weight: bold;">//</span>s3.amazon.com<span style="color: #000000; font-weight: bold;">/</span>m87-blackhole<span style="color: #000000; font-weight: bold;">/</span>www
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;*************************************************&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;*   Backing up databases....                    *&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;*                                               *&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;*     www.willowoakboard.com...                 *&quot;</span>
duplicity <span style="color: #000000; font-weight: bold;">/</span>u01<span style="color: #000000; font-weight: bold;">/</span>backups<span style="color: #000000; font-weight: bold;">/</span>willowoak s3+http:<span style="color: #000000; font-weight: bold;">//</span>s3.amazon.com<span style="color: #000000; font-weight: bold;">/</span>willowoak<span style="color: #000000; font-weight: bold;">/</span>db
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;*     www.mywushublog.com...                    *&quot;</span>
duplicity <span style="color: #000000; font-weight: bold;">/</span>u01<span style="color: #000000; font-weight: bold;">/</span>backups<span style="color: #000000; font-weight: bold;">/</span>mywushublog s3+http:<span style="color: #000000; font-weight: bold;">//</span>s3.amazon.com<span style="color: #000000; font-weight: bold;">/</span>mywushublog<span style="color: #000000; font-weight: bold;">/</span>db
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;*     www.m87-blackhole.org...                  *&quot;</span>
duplicity <span style="color: #000000; font-weight: bold;">/</span>u01<span style="color: #000000; font-weight: bold;">/</span>backups<span style="color: #000000; font-weight: bold;">/</span>m87-blackhole s3+http:<span style="color: #000000; font-weight: bold;">//</span>s3.amazon.com<span style="color: #000000; font-weight: bold;">/</span>m87-blackhole<span style="color: #000000; font-weight: bold;">/</span>db
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;*************************************************&quot;</span></pre></div></div>

<p>And last but not least, a cronjob to tie it all together:<br />
<code>% crontab -e<br />
@weekly ~/bin/s3-backups.sh<br />
@weekly ~/bin/mywushublog-mysql-backup.sh<br />
@weekly ~/bin/willowoak-mysql-backup.sh<br />
@weekly ~/bin/m87-blackhole-mysql-backup.sh<br />
@weekly ~/bin/evil-genius-network-mysql-backup.sh</code><br />
I can check the status of a backup by running <strong>duplicity</strong> with the &#8216;<em>collection-status</em>&#8216; flag:<br />
<code>%duplicity collection-status s3+http://s3.amazon.com/mywushublog/db<br />
Last full backup date: Sat Apr 25 15:08:02 2009<br />
Collection Status<br />
-----------------<br />
Connecting with backend: BotoBackend<br />
Archive dir: None<br />
Found 0 backup chains without signatures.<br />
Found a complete backup chain with matching signature chain:<br />
-------------------------<br />
Chain start time: Sat Apr 25 15:08:02 2009<br />
Chain end time: Sat Apr 25 15:08:02 2009<br />
Number of contained backup sets: 1<br />
Total number of contained volumes: 1<br />
Type of backup set:                            Time:      Num volumes:<br />
Full         Sat Apr 25 15:08:02 2009                 1<br />
-------------------------<br />
No orphaned or incomplete backup sets found.</code><br />
I can also list the files:<br />
<code>%duplicity list-current-files s3+http://s3.amazon.com/mywushublog/db<br />
Last full backup date: Sat Apr 25 15:08:02 2009<br />
Sat Apr 25 15:05:11 2009 .<br />
Sat Apr 25 15:05:10 2009 daily<br />
Sat Apr 25 15:05:10 2009 daily/mywushublog<br />
Sat Apr 25 15:05:10 2009 monthly<br />
Sat Apr 25 15:05:10 2009 weekly<br />
Sat Apr 25 15:05:11 2009 weekly/mywushublog<br />
Sat Apr 25 15:05:11 2009 weekly/mywushublog/mywushublog_week.17.2009-04-25_15h05m.sql.gz</code><br />
Pretty sweet automated backup process. It is a lot cheaper than tapes or additional disk storage. With S3, I also don&#8217;t have to worry about buying additional hardware, the maintenance of a library or tape drive (which is what I had a few years ago, what a headache).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mywushublog.com/2009/04/using-amazon-s3-for-backups/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Setting up my own OpenID server</title>
		<link>http://www.mywushublog.com/2009/02/setting-up-my-own-openid-server/</link>
		<comments>http://www.mywushublog.com/2009/02/setting-up-my-own-openid-server/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 04:15:05 +0000</pubDate>
		<dc:creator>Mike Carlson</dc:creator>
				<category><![CDATA[Geekyness]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[OpenID]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Tomcat 6]]></category>

		<guid isPermaLink="false">http://www.mywushublog.com/?p=167</guid>
		<description><![CDATA[I&#8217;ve configured this blog to use my OpenID accounts. I have two (which totally goes against the single identity mindset of OpenID :) ) http://mcarlson.myopenid.com/ http://openid.evil-genius-network.com/mike The second one I just stood up today. I&#8217;m always concerned with who has my information, and if I can, I try to keep it all ...]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve configured this blog to use my OpenID accounts. I have two (which totally goes against the single identity mindset of OpenID :) )</p>
<ul>
<li><a href="http://mcarlson.myopenid.com/">http://mcarlson.myopenid.com/</a></li>
<li><a href="http://openid.evil-genius-network.com/mike">http://openid.evil-genius-network.com/mike</a></li>
</ul>
<p>The second one I just stood up today. I&#8217;m always concerned with who has my information, and if I can, I try to keep it all within the realm of my control. Also, the evil genius domain has absolutely no purpose besides a testing ground that I have no problems destroying :)</p>
<p>Using my own OpenID service is attractive, most of all its a fun exercise. Lets go through what I did (so one day I can remember).</p>
<p>The easiest part was finding an OpenID server. A quick google search brought me here:</p>
<p><a href="http://wiki.openid.net/Run_your_own_identity_server">http://wiki.openid.net/Run_your_own_identity_server</a></p>
<p>The hard part was deciding which one I should use. I actually tried out 4 of them, <a href="http://siege.org/projects/phpMyID">phpMyID</a>, <a href="http://dennisbloete.de/projects/masquerade/">Masquerade</a>, <a href="http://trac.nicolast.be/djangoid">DjangoID</a>, and finally, <a href="http://code.google.com/p/openid-server/">Java OpenID Server</a>. I got three of them running, and in the end I simply settled on JOS. For now. I had a lot of fun building a MCV app in both Ruby on Rails and Django. I&#8217;ve been on a MCV kick, as a month ago I got pretty excited about Ruby on Rails. The big part where I shy away from Django or RoR is integrating things into Apache. With Java, I have Tomcat, and I&#8217;ve used it before so I have an immediate comfort level with it. I did have to ask <a href="http://www.titan-project.org/">Chris</a> for a little bit of help when it came to the mod_jk stuff.</p>
<p>First thing was to go over the JOS documentation. I knew I would need the following:</p>
<ul>
<li>Java App Server &#8211; I decided to use Apache&#8217;s Tomcat 6.0</li>
<li>A database &#8211; PostgreSQL 8.3</li>
<li>JCalendar, this was simple, as the readme pointed me to one</li>
</ul>
<p>Over the years, I&#8217;ve always used MySQL. It&#8217;s simple, light, and all the new fancy &#8220;Web 2.0&#8243; site use it. I&#8217;m considering making the switch to PostgreSQL for two reasons. 1) Sun seems to be mishandling the QA and release engineering of MySQL . 2) Recent benchmarks with FreeBSD 7.1 and PostgreSQL have been phenomenally good, and even though I&#8217;m not running a big site with millions of visitors I do like to keep up with whats current and performs well.</p>
<p>Second, I built the required applications and enabled both tomcat and PostgreSQL in /etc/rc.conf. Think of rc.conf as a simple text-based chkconfig, except with rc.conf, you can specify additional command arguments, profile environment, and anything else the application might support. I like the ease of the chkconfig/service system works in Linux, but FreeBSD&#8217;s run command (rc) system is very flexible and easier to tune.</p>
<pre style="padding-left: 30px;">&gt; sudo su -
$ cd /usr/ports/databases/postgresql83-server
$ make install
$ echo 'postgresql_enable="YES"' >> /etc/rc.conf
$ cd /usr/ports/www/tomcat6
$ make install
$ echo 'tomcat60_enable="YES"' >> /etc/rc.conf
$ cd /usr/ports/databases/postgresql-jdbc
$ make install
</pre>
<p>I could have simply added pre-built packages with &#8220;pkg_add -r tomcat6 postgresql83-server postgresql-jdbc&#8221; but I like seeing what compile time options are available, and then setting those. Hurray for the flexibility of FreeBSD!</p>
<p>One thing that you have to do with PostgreSQL (that you don&#8217;t have to do with MySQL) is initialize the database/config:</p>
<pre style="padding-left: 30px;">$ initdb /usr/local/pgsql/data
$ su - pgsql
> createdb jos-openid
> makepasswd --chars=13
 a nice 13 character random string
> createuser josuser -P
> psql jos-openid 

Welcome to psql 8.3.6, the PostgreSQL interactive terminal. Type:
        \copyright for distribution terms
        \h for help with SQL commands
        \? for help with psql commands
        \g or terminate with semicolon to execute query
        \q to quit

jos-openid=# select * from pg_user;
  usename | usesysid | usecreatedb | usesuper | usecatupd |  passwd  | valuntil | useconfig
 ---------+----------+-------------+----------+-----------+----------+----------+-----------
  pgsql   |       10 | t           | t        | t         | ******** |          |
  josuser |    16386 | t           | f        | f         | ******** |          |
(2 rows)
jos-openid=#
</pre>
<p>Next, I had to unpack the war file and modify the jdbc.properties to use PostgreSQL</p>
<pre style="padding-left: 30px;">jar -xvf jos-webapp-1.2.0.war .
...
jar -cvf /usr/local/tomcat6/webapps/ROOT.war .
</pre>
<p>Yeah, after configuring the app and zipping it back up, I called it ROOT, it was a lot easier this way. I didn&#8217;t want to manage multiple java apps at this point. I can be a very lazy admin :)</p>
<p>After starting both Tomcat and PostgreSQL up, I now had a working web app running on my server at port 8180. The last part is to mount the java application inside of apache. For that, I needed to install mod_jk:</p>
<pre style="padding-left: 30px;">$ cd /usr/ports/www/mod_jk
$ make install
</pre>
<p>Thats the easy part of installing mod_jk, the next parts are the worker.properties file, modifying httpd.conf, and then modifying my virtualhost configuration for the domain evil-genius-network.com. I also added a record for openid.evil-genius-network.com. So, in that order, this is what I did:</p>
<p><strong>/usr/local/etc/apache2/worker.properties:</strong></p>
<pre style="padding-left: 30px;">
workers.tomcat_home=/usr/local/apache-tomcat6.0
workers.java_home=/usr/local/jdk1.6.0
ps=/
worker.list=localhost
worker.tomcat.type=lb
#worker.tomcat.balanced_workers=localhost
#worker.loadbalancer.local_worker_only=0
worker.localhost.port=8009
worker.localhost.host=localhost
worker.localhost.type=ajp13
worker.localhost.lbfactor=1</pre>
<p><strong>/usr/local/etc/apache2/httpd.conf:</strong></p>
<pre style="padding-left: 30px;">LoadModule jk_module libexec/apache22/mod_jk.so
# mod_jk
JkWorkersFile /usr/local/etc/apache22/workers.properties
JkLogFile  /var/log/jk.log
JkShmFile  /var/log/jk-runtime-status
JkLogLevel error
</pre>
<p><strong>/usr/local/etc/apache2/virtualhosts/evil-genius-network.com (in the openid.evil-genius-network.com VirtualHost section):</strong></p>
<pre style="padding-left: 30px;">JkMount /* localhost</pre>
<p>Then, I restarted apache:</p>
<pre style="padding-left: 30px;">$ /usr/local/etc/rc.d/apache2 restart</pre>
<p>Now, have my own little OpenID server running at <a href="http://openid.evil-genius-network.com/">http://openid.evil-genius-network.com/</a></p>
<p>BTW, I had to re-edit EVERY pre section of this page about 6 times, that was the least-fun part of all of this.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mywushublog.com/2009/02/setting-up-my-own-openid-server/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for (  www.mywushublog.com/tag/postgresql/feed/ ) in 0.24985 seconds, on Feb 7th, 2012 at 8:45 am UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Feb 7th, 2012 at 9:45 am UTC -->
