<?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>blog.khax.net &#187; Uncategorized</title>
	<atom:link href="http://blog.khax.net/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.khax.net</link>
	<description>Webdev &#38; Devops Blog</description>
	<lastBuildDate>Wed, 16 Nov 2011 23:18:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Setup notes: nginx + wordpress multi site</title>
		<link>http://blog.khax.net/2011/09/22/setup-notes-nginx-wordpress-multi-site/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=setup-notes-nginx-wordpress-multi-site</link>
		<comments>http://blog.khax.net/2011/09/22/setup-notes-nginx-wordpress-multi-site/#comments</comments>
		<pubDate>Thu, 22 Sep 2011 05:24:35 +0000</pubDate>
		<dc:creator>Karl Bowden</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://kh4x.com/?p=37</guid>
		<description><![CDATA[Substitute domain_name1.com: Your domain name extra_domain_name.com: Extra domains if your also using extra domain mapping in wordpress file_root: Path to your wordpress install Files /etc/nginx/sites-available/domain_name1.com # WordPress Multi Site Domain server { listen 80 ; server_name .domain_name1.com .extra_domain_name.com; root /file_root/wordpress; index index.php index.html index.htm; # Rewrite for multi site files rewrite /files/(.+)$ /wp-includes/ms-files.php?file=$1 last; # [...]]]></description>
			<content:encoded><![CDATA[<h3>Substitute</h3>
<ul>
<li>domain_name1.com: Your domain name</li>
<li>extra_domain_name.com: Extra domains if your also using extra domain mapping in wordpress</li>
<li>file_root: Path to your wordpress install</li>
</ul>
<p><span id="more-37"></span></p>
<h3>Files</h3>
<h4>/etc/nginx/sites-available/domain_name1.com</h4>
<pre>
# WordPress Multi Site Domain
server {
    listen 80 ;
    server_name .domain_name1.com .extra_domain_name.com;

    root /file_root/wordpress;
    index index.php index.html index.htm;

    # Rewrite for multi site files
    rewrite /files/(.+)$ /wp-includes/ms-files.php?file=$1 last;

    # Rewrite for wordpress
    if (!-e $request_filename) {
        rewrite ^(.+)$ /index.php?q=$1 last;
    }

    location ~ \.php$ {
        fastcgi_pass    unix:/tmp/php-fastcgi.socket; # or port like 127.0.0.1:9000
        fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include         fastcgi_params;
    }
}
</pre>
<h3>Finish</h3>
<pre>
sudo ln -s /etc/nginx/sites-available/domain_name.com /etc/nginx/sites-enabled/domain_name.com
sudo service nginx restart
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.khax.net/2011/09/22/setup-notes-nginx-wordpress-multi-site/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>nginx + mongrel + redmine &#8211; quick setup notes</title>
		<link>http://blog.khax.net/2010/04/01/nginx-mongrel-redmine-quick-setup-notes/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=nginx-mongrel-redmine-quick-setup-notes</link>
		<comments>http://blog.khax.net/2010/04/01/nginx-mongrel-redmine-quick-setup-notes/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 06:12:43 +0000</pubDate>
		<dc:creator>Karl Bowden</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.khax.net/?p=173</guid>
		<description><![CDATA[My quick setup notes for nginx as a frontend to a mongrel redmine server. This is intended for situations where redmine needs to be served in a subdirectory via a nginx that is also used for other serving needs. Some basic prerequisite knowledge of nginx and redmine will likely be needed. Instructions are tested on [...]]]></description>
			<content:encoded><![CDATA[<p>My quick setup notes for nginx as a frontend to a mongrel redmine server.</p>
<p>This is intended for situations where redmine needs to be served in a subdirectory via a nginx that is also used for other serving needs.</p>
<p>Some basic prerequisite knowledge of nginx and redmine will likely be needed.</p>
<p>Instructions are tested on redmine-svn and Ubuntu-9.10.<br />
<span id="more-173"></span></p>
<ul>
<li class="level1">
<div class="li">Install dependencies</div>
<ul>
<li class="level2">
<div class="li">
<pre>sudo apt-get install subversion libmysql-ruby rake rubygems mongrel nginx</pre>
</div>
</li>
</ul>
</li>
<li class="level1">
<div class="li">Setup directory structure</div>
<ul>
<li class="level2">
<div class="li">
<pre>sudo adduser --system --group redmine
sudo mkdir /opt/redmine
sudo chown redmine:redmine /opt/redmine
sudo -Hu redmine svn checkout http://redmine.rubyforge.org/svn/trunk /opt/redmine</pre>
</div>
</li>
</ul>
</li>
<li class="level1">
<div class="li">Create the MySQL database for redmine</div>
<ul>
<li class="level2">
<div class="li">Example for mysql-server on localhost:</p>
<pre>sudo apt-get install mysql-server
mysql -u root -p
create user 'redmine'@'localhost' identified by 'password';
grant all privileges on  `redmine_%` . * to  'redmine'@'localhost';
create database redmine_production character set utf8;
quit;</pre>
</div>
</li>
<li class="level2">
<div class="li">(or use phpmyadmin)</div>
</li>
</ul>
</li>
<li class="level1">
<div class="li">Copy config/database.yml.example to config/database.yml and edit the database configuration</div>
<ul>
<li class="level2">
<div class="li">
<pre>sudo -Hu redmine cp /opt/redmine/config/database.yml.example /opt/redmine/config/database.yml
sudo -Hu redmine vim /opt/redmine/config/database.yml</pre>
</div>
</li>
<li class="level2">
<div class="li">Example database <acronym title="specification">spec</acronym>:</div>
<ul>
<li class="level3">
<div class="li">
<pre>production:
  adapter: mysql
  database: redmine_production
  host: localhost
  username: redmine
  password: password
  encoding: utf8</pre>
</div>
</li>
</ul>
</li>
</ul>
</li>
<li class="level1">
<div class="li">Generate redmine session store secret</div>
<ul>
<li class="level2">
<div class="li">
<pre>cd /opt/redmine
sudo -Hu redmine gem install -v=2.3.5 rails
sudo -Hu redmine rake generate_session_store</pre>
</div>
</li>
</ul>
</li>
<li class="level1">
<div class="li">Create the database structure and insert the default data</div>
<ul>
<li class="level2">
<div class="li">
<pre>sudo -Hu redmine RAILS_ENV=production rake db:migrate
sudo -Hu redmine RAILS_ENV=production rake redmine:load_default_data</pre>
</div>
</li>
</ul>
</li>
<li class="level1">
<div class="li">Setup redmine to be served from /redmine/</div>
<ul>
<li class="level2">
<div class="li">
<pre>cd /opt/redmine/config
sudo -Hu redmine cp additional_environment.rb.example additional_environment.rb
echo 'config.action_controller.relative_url_root = "/redmine"' | sudo -Hu redmine tee -a additional_environment.rb</pre>
</div>
</li>
</ul>
</li>
<li class="level1">
<div class="li">Setup email delivery as desired</div>
<ul>
<li class="level2">
<div class="li">
<pre>cd /opt/redmine/config
sudo -Hu redmine cp email.yml.example email.yml</pre>
</div>
<ul>
<li class="level3">
<div class="li">Example smtp <acronym title="specification">spec</acronym></div>
<ul>
<li class="level4">
<div class="li">
<pre>sudo -Hu redmine vim email.yml</pre>
<pre>production:
  delivery_method: :smtp
  smtp_settings:
    address: smtp.example.com
    port: 25
    domain: example.com</pre>
</div>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li class="level1">
<div class="li">Start the mongrel server</div>
<ul>
<li class="level2">
<div class="li">
<pre>cd /opt/redmine; sudo -Hu redmine mongrel_rails start -e production -p 9001 -d</pre>
</div>
</li>
</ul>
</li>
<li class="level1">
<div class="li">Edit /etc/nginx/sites-enabled/default</div>
<ul>
<li class="level2">
<div class="li">
<pre>sudo vim /etc/nginx/sites-enabled/default</pre>
</div>
</li>
<li class="level2">
<div class="li">Add to the active server section:</div>
<ul>
<li class="level3">
<div class="li">
<pre>        location /redmine {
                alias /opt/redmine/public/;
                try_files  $uri/index.html $uri.html $uri @mongrel;
        }
        location @mongrel {
                proxy_set_header  X-Real-IP        $remote_addr;
                proxy_set_header  X-Forwarded-For  $proxy_add_x_forwarded_for;
                proxy_set_header  Host             $http_host;
                proxy_redirect    off;
                proxy_pass        http://127.0.0.1:9001;
        }</pre>
</div>
</li>
</ul>
</li>
</ul>
</li>
<li class="level1">
<div class="li">Restart nginx:</p>
<pre>sudo service nginx restart</pre>
</div>
</li>
<li class="level1">
<div class="li">Test the website. eg: <a class="urlextern" title="http://localhost/redmine/" rel="nofollow" href="http://localhost/redmine/">http://localhost/redmine/</a></div>
</li>
<li class="level1">
<div class="li">If successful, set mongrel to start on boot</div>
<ul>
<li class="level2">
<div class="li">
<pre>sudo vim /etc/rc.local</pre>
</div>
<ul>
<li class="level3">
<div class="li">
<pre>cd /opt/redmine; sudo -Hu redmine mongrel_rails start -e production -p 9001 -d</pre>
</div>
</li>
</ul>
</li>
</ul>
</li>
<li class="level1">
<div class="li">Retest site after a reboot</div>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.khax.net/2010/04/01/nginx-mongrel-redmine-quick-setup-notes/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Iptables packet flow diagram</title>
		<link>http://blog.khax.net/2009/12/07/iptables-packet-flow-diagram/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=iptables-packet-flow-diagram</link>
		<comments>http://blog.khax.net/2009/12/07/iptables-packet-flow-diagram/#comments</comments>
		<pubDate>Sun, 06 Dec 2009 23:39:18 +0000</pubDate>
		<dc:creator>Karl Bowden</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[iproute2]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.khax.net/?p=167</guid>
		<description><![CDATA[Here is the diagram I keep stuck to my wall for reference when dealing with iptables. I cannot remember what site I used as a reference when creating the diagram. The original was an ascii chart though. This is created in dia and exported to pdf too. Both attached for convenience. CC licensed as long as the original [...]]]></description>
			<content:encoded><![CDATA[<p>Here is the diagram I keep stuck to my wall for reference when dealing with iptables.</p>
<p>I cannot remember what site I used as a reference when creating the diagram. The original was an ascii chart though. This is created in dia and exported to pdf too. Both attached for convenience. CC licensed as long as the original chart I copied allows it.</p>
<h2>Packet flow examples:</h2>
<h3>All packets to or from localhost travel down the left side of the chart.</h3>
<p>From external destination localhost: PREROUTING -&gt; INPUT -&gt; [Local Process] -&gt; OUTPUT -&gt; POSTROUTING.</p>
<p>From localhost destination external: OUTPUT -&gt; POSTROUTING -&gt; [External Host] -&gt; PREROUTING -&gt; INPUT.</p>
<h3>All forwarded packets travel the right side of the chart and travel all three tables coming in and then again going out.</h3>
<p>From external dest internal: PREROUTING -&gt; FORWARD -&gt; POSTROUTING.</p>
<p>Internal response to external: PREROUTING -&gt; FORWARD -&gt; POSTROUTING.</p>
<p>and so forth.</p>
<p>This is what caught me for a while. Forwarded packet travel the right side route and get out of (or in to) the network. The response then gets generated and does not start from FORWARD or POSTROUTING, but from PREROUTING again. So all NEW forwarded packets need to be marked in PREROUTING and the mark saved. Not new packets need that mark restored in PREROUTING, and all packets need that mark restored in POSTROUTING. (As demonstrated by my previous post).</p>
<p>Locally generated traffic only sees OUTPUT and POSTROUTING before hitting the network and needs to be marked before hitting POSTROUTING, hence the OUTPUT chain rules in my previous post.</p>
<p>I will accept changes to the chart too if anybody wants modifications made.</p>
<p><a href="http://dl.dropbox.com/u/173699/iptables%20routing.dia">iptables routing.dia</a></p>
<p><a href="http://dl.dropbox.com/u/173699/iptables%20routing.pdf">iptables routing.pdf</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.khax.net/2009/12/07/iptables-packet-flow-diagram/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Installing Debian Lenny on my DNS-323</title>
		<link>http://blog.khax.net/2009/09/02/installing-debian-lenny-on-my-dns-323/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=installing-debian-lenny-on-my-dns-323</link>
		<comments>http://blog.khax.net/2009/09/02/installing-debian-lenny-on-my-dns-323/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 04:23:37 +0000</pubDate>
		<dc:creator>Karl Bowden</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[dlink]]></category>
		<category><![CDATA[dns-323]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://blog.khax.net/?p=153</guid>
		<description><![CDATA[I finished upgrading my Dlink DNS-323 to Debian Lenny today. I followed the instruction at: http://www.cyrius.com/debian/orion/d-link/dns-323/install.html The install took quite a while, I selected the standard package list. Then because it gets quit hot here in Griffith I really wanted to have fan control back, so instruction here were also followed. As I wanted to [...]]]></description>
			<content:encoded><![CDATA[<p>I finished upgrading my Dlink DNS-323 to Debian Lenny today. I followed the instruction at:</p>
<p><a href="http://www.cyrius.com/debian/orion/d-link/dns-323/install.html">http://www.cyrius.com/debian/orion/d-link/dns-323/install.html</a></p>
<p>The install took quite a while, I selected the standard package list. Then because it gets quit hot here in Griffith I really wanted to have fan control back, so instruction <a href="http://www.cyrius.com/journal/debian/orion/d-link/dns-323/dns-323-fan-control">here</a> were also followed.</p>
<p>As I wanted to install to an 8GB Flash drive I had handy I first uploaded the netboot.img firmware, turned off the DNS-323, removed the hard drives and left only the flash drive inserted, then powered up and followed the installation instructions.</p>
<p>I like keeping root on the flash drive as the hard drives can be stopped all day when not in use to save temp and power.</p>
<p>Fans are also controlled by lm-sensors and the unit seems to run about 47degC most of the day.</p>
<p>I use the unit mostly for irc (screen/weechat), rsync backup target and samba media server. It handles all that pretty well but I do notice it bog a fair bit with only 64mb ram and hard drive transfer rates are not as good as I am used to, but on the whole a great little unit (now that it runs debian).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.khax.net/2009/09/02/installing-debian-lenny-on-my-dns-323/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Review: Liferay Portal 5.2 Systems Development</title>
		<link>http://blog.khax.net/2009/06/17/review-liferay-portal-5-2-systems-development/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=review-liferay-portal-5-2-systems-development</link>
		<comments>http://blog.khax.net/2009/06/17/review-liferay-portal-5-2-systems-development/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 13:48:16 +0000</pubDate>
		<dc:creator>Karl Bowden</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.khax.net/?p=146</guid>
		<description><![CDATA[Life Portal 5.2 Systems Development Author: Jonas X. Yuan Pages: 552 Publisher: Packt Publishing Rating: 9/10 ISBN: 1847194702 Summary: A Java developer&#8217;s guide to developing custom intranet systems, based on Liferay&#8217;s platform As one of only a few books on advanced Liferay Portal development Jonas had a LOT of material to cover. My two weeks [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.packtpub.com/liferay-portal-5-2-systems-development/book/mid/100609gh3aoe"><img class="size-full wp-image-147 alignright" src="http://blog.khax.net/files/2009/06/1847194702.png" alt="Liferay Portal 5.2 Systems Development" width="100" height="123" /></a></p>
<p><a href="http://www.packtpub.com/liferay-portal-5-2-systems-development/book/mid/100609gh3aoe" target="_blank">Life Portal 5.2 Systems Development</a></p>
<ul>
<li>Author: <a href="http://www.packtpub.com/author_view_profile/id/198">Jonas X. Yuan </a></li>
<li>Pages: 552</li>
<li>Publisher: Packt Publishing</li>
<li>Rating: 9/10</li>
<li>ISBN: 1847194702</li>
<li>Summary: A Java developer&#8217;s guide to developing custom intranet systems, based on Liferay&#8217;s platform</li>
</ul>
<p>As one of only a few books on advanced Liferay Portal development Jonas had a LOT of material to cover. My two weeks of experience with Liferay up to this point had only involved deployment, configuration and theme development. After been impressed with the results so far my next three aims were customising the WYSIWYG editor with styles more specific to the site, adding layout templates to support quick deployment of content and some custom portals for integrating our other information management systems. A week later with the book and I have the first two knocked over and am on my way with the portals.<span id="more-146"></span></p>
<p>I have no experience with Java programming, but luckily there was enough detail to get me started. Because of the lack of knowledge I started right from the beginning and read thoroughly all of the background information on Liferay Portal and the JSR-286 specs. This was quite a laborious experience. Not a lot of the JSR-286 specs made any sense until further on in portal development, but helped as a good reference on the portal boundaries later on.</p>
<p>A very progressive structure is taken in this guide. So much that I found it hard to dive into later chapters out of order. Even just the theme development chapter made more sense once I read the previous chapters. Once I had completed a few chapters I found myself using it a lot as a reference. Especially when developing Struts Portlets.</p>
<p>With the latter chapters on workflow, CMS, WYSIWYG editors, communities and templates and themes I was using code from the book directly in my deployment. The examples applied well to customising Liferay for an intranet CMS environment (luckly for me).</p>
<p>There are little quirks in the code examples where more proof reading would have helped, but these were easily ignored by downloading the example code archive.</p>
<p>This book is not for you if you only want to change the database backend or create a basic theme. Nor if you dislike getting your hands dirty in XML. If on the other hand though you are deploying a Liferay based intranet and want to tie in existing content services or want a unique and flexible public site, then the book is right up your alley.</p>
<p>Overall I am impressed with the depth of the book and will probably be spending a few more weeks working through it as I get time. And I will be sure to post updates about the portals if I start developing any applicable to use outside the company.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.khax.net/2009/06/17/review-liferay-portal-5-2-systems-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

