<?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/"
	xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Handbook's Kornpong</title>
	<atom:link href="http://kornpong.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://kornpong.wordpress.com</link>
	<description>Just another weblog</description>
	<lastBuildDate>Mon, 19 May 2008 17:54:33 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>th</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='kornpong.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/e13a8f9ce4ff874dc47e49773e6b543d?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Handbook's Kornpong</title>
		<link>http://kornpong.wordpress.com</link>
	</image>
			<item>
		<title>Wildcard DNS and Sub Domains</title>
		<link>http://kornpong.wordpress.com/2008/05/18/wildcard-dns-and-sub-domains/</link>
		<comments>http://kornpong.wordpress.com/2008/05/18/wildcard-dns-and-sub-domains/#comments</comments>
		<pubDate>Sun, 18 May 2008 09:39:27 +0000</pubDate>
		<dc:creator>gossippc</dc:creator>
				<category><![CDATA[WordPress MU]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://kornpong.wordpress.com/?p=7</guid>
		<description><![CDATA[What follows is what I consider to be best practice for my personal sites and a guide for those who wish to do the same. Months ago I dropped the www. prefix from my domain in part because I think it’s redundant and also because I wanted to experiment with how Google treated valid HTTP [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kornpong.wordpress.com&blog=2184334&post=7&subd=kornpong&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>What follows is what I consider to be best practice for my personal sites and a guide for those who wish to do the same. Months ago I <a title="Reset Links" href="/p430">dropped the <code>www.</code> prefix</a> from my domain in part because I think it’s redundant and also because I wanted to experiment with how Google treated valid HTTP redirect codes. The experiment has been a great success. Google seems to fully respect 301 Permanent Redirects and the change has taken my previously split PageRank has been combined and now I am at 7. There are other factors that have contributed to this, of course, and people still continue to link to my site and posts with a <code>www.</code> (or worse) in front of it, but overall it just feels so much <em>cleaner</em> to have one URI for one resource, all the time. I’m sure that’s the wrong way to say that, but the feeling is there nonetheless.</p>
<p><span id="more-7"></span></p>
<p>Now for the meat. What’s a good way to do this? Let’s look at our goals:</p>
<ul>
<li>No links should break.</li>
<li>Visitors should be redirected using a <em>permanent</em> redirect, HTTP code 301, meaning that the address bar should update and intelligent user agents may change a stored URI</li>
<li>It should be transparent to the user.</li>
<li>It should also work for mistyped “sub domains” such as <code>ww.</code> or <code>wwww.</code> (I still get hits from <a href="http://www.roguelibrarian.com/diary/267/">Carrie’s bad link</a>)</li>
</ul>
<p>So we need a little magic in DNS and in our web server. In my case these are <a href="http://www.isc.org/products/BIND/">Bind</a> and <a href="http://httpd.apache.org/">Apache</a>. I am writing about this because at some point the code I put in to catch any subdomain stopped working and while I reimplemented it I decided to write about what I was doing. This method also works with virtual hosts on shared IPs where my previous method did not.</p>
<p>In Bind you need to set up a wildcard entry to catch anything that a misguided user or bad typist might enter in front of your domain name. Just like when searching or using regular expressions you use an asterisk (or splat) to match any number of any characters the same thing applies in Bind. So at the end of my zone DB file (<code>/var/named/photomatt.net.db</code>) I added the following line:</p>
<p><code>*.photomatt.net. 14400 IN A 64.246.62.114</code></p>
<p>Note the period after my domain. The IP is my shared IP address. That’s all you need, now restart bind. (For me <code>/etc/init.d/named restart</code>.)</p>
<p>Now you need to set up Apache to respond to requests on any hostname under photomatt.net. Before I just used the convinence of having a dedicated IP for this site and having the redirect VirtualHost entry occur first in my <code>httpd.conf</code> file. That works, but I have a better solution now. So we want to tell Apache to respond to any request on any subdomain (that does not already have an existing subdomain entry) and redirect it to photomatt.net. Here’s what I have:</p>
<p><code>&lt;VirtualHost 64.246.62.114&gt;<br />
DocumentRoot /home/photomat/public_html<br />
BytesLog domlogs/photomatt.net-bytes_log<br />
User photomat<br />
Group photomat<br />
ServerAlias *.photomatt.net</code></p>
<p>ServerName www.photomatt.net<br />
CustomLog domlogs/photomatt.net combined<br />
RedirectMatch 301 (.*) http://photomatt.net$1<br />
&lt;/VirtualHost&gt;</p>
<p>The two magic lines are the <code>ServerAlias</code> directive which is self explanitory and the <code>RedirectMatch</code> line which redirects all requests to photomatt.net in a permanent manner.</p>
<p>There is a catch though. The redirecting <code>VirtualHost</code> entry must come after any valid subdomain <code>VirtualHost</code> entries you may have, for example I have one for <code>cvs.photomatt.net</code> and I had to move that entry up in the <code>httpd.conf</code> because Apache just moves down that file and uses the first one it comes to that matches, so the wildcard should be last.</p>
<p>That is it, I’m open to comments and suggestions for improvement.</p>
<p><strong>From: <a href="http://ma.tt/2003/10/wildcard-dns-and-sub-domains/">Matthew Mullenweg</a></strong></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/kornpong.wordpress.com/7/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/kornpong.wordpress.com/7/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kornpong.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kornpong.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kornpong.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kornpong.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kornpong.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kornpong.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kornpong.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kornpong.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kornpong.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kornpong.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kornpong.wordpress.com&blog=2184334&post=7&subd=kornpong&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://kornpong.wordpress.com/2008/05/18/wildcard-dns-and-sub-domains/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/901cc04b07772e0fa0e9e4eb06273f0b?s=96&#38;d=identicon" medium="image">
			<media:title type="html">gossippc</media:title>
		</media:content>
	</item>
		<item>
		<title>การคอนฟิก Apache สำหรับ WordPress MU</title>
		<link>http://kornpong.wordpress.com/2008/05/18/apache-%e0%b8%aa%e0%b8%b3%e0%b8%ab%e0%b8%a3%e0%b8%b1%e0%b8%9a-wordpess-mu/</link>
		<comments>http://kornpong.wordpress.com/2008/05/18/apache-%e0%b8%aa%e0%b8%b3%e0%b8%ab%e0%b8%a3%e0%b8%b1%e0%b8%9a-wordpess-mu/#comments</comments>
		<pubDate>Sun, 18 May 2008 09:16:45 +0000</pubDate>
		<dc:creator>gossippc</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[WordPress MU]]></category>

		<guid isPermaLink="false">http://kornpong.wordpress.com/?p=6</guid>
		<description><![CDATA[Apache
Apache must be configured so that mod_rewrite works. Here are instructions for Apache 2. Apache 1.3 is very similar.


 Make sure a line like the following appears in your httpd.conf
LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so
 In the &#60;Directory&#62; directive of your virtual host, look for this
line
&#8220;AllowOverride None&#8221;
and change it to
&#8220;AllowOverride FileInfo Options&#8221;.
In the &#60;VirtualHost&#62; section of the config [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kornpong.wordpress.com&blog=2184334&post=6&subd=kornpong&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><strong>Apache</strong></p>
<p>Apache must be configured so that mod_rewrite works. Here are instructions for Apache 2. Apache 1.3 is very similar.</p>
<p><span id="more-6"></span></p>
<ol>
<li> Make sure a line like the following appears in your httpd.conf<br />
LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so</li>
<li> In the &lt;Directory&gt; directive of your virtual host, look for this<br />
line<br />
&#8220;AllowOverride None&#8221;<br />
and change it to<br />
&#8220;AllowOverride FileInfo Options&#8221;.</li>
<li>In the &lt;VirtualHost&gt; section of the config file for your host there<br />
will be a line defining the hostname. You need to add the following<br />
if you want virtual hosts to work properly:<br />
&#8220;ServerAlias *.domain.tld&#8221;<br />
Replace domain.tld with whatever your one is, and remove the quotes.</li>
</ol>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/kornpong.wordpress.com/6/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/kornpong.wordpress.com/6/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kornpong.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kornpong.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kornpong.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kornpong.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kornpong.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kornpong.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kornpong.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kornpong.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kornpong.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kornpong.wordpress.com/6/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kornpong.wordpress.com&blog=2184334&post=6&subd=kornpong&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://kornpong.wordpress.com/2008/05/18/apache-%e0%b8%aa%e0%b8%b3%e0%b8%ab%e0%b8%a3%e0%b8%b1%e0%b8%9a-wordpess-mu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/901cc04b07772e0fa0e9e4eb06273f0b?s=96&#38;d=identicon" medium="image">
			<media:title type="html">gossippc</media:title>
		</media:content>
	</item>
		<item>
		<title>WordPress MU คืออะไร?</title>
		<link>http://kornpong.wordpress.com/2008/05/12/wordpress-mu-%e0%b8%84%e0%b8%b7%e0%b8%ad%e0%b8%ad%e0%b8%b0%e0%b9%84%e0%b8%a3/</link>
		<comments>http://kornpong.wordpress.com/2008/05/12/wordpress-mu-%e0%b8%84%e0%b8%b7%e0%b8%ad%e0%b8%ad%e0%b8%b0%e0%b9%84%e0%b8%a3/#comments</comments>
		<pubDate>Mon, 12 May 2008 17:47:51 +0000</pubDate>
		<dc:creator>gossippc</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress MU]]></category>
		<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://kornpong.wordpress.com/?p=8</guid>
		<description><![CDATA[WordPress MU is a multi user version of WordPress.
If you&#8217;re not comfortable editing PHP code, taking care of a complex
webserver and database system and being pro-active about following
developments of this project then run, don&#8217;t walk, to
http://wordpress.com/ and sign yourself and your friends up to free blogs.
It&#8217;s easier in the long run and you&#8217;ll save yourself [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kornpong.wordpress.com&blog=2184334&post=8&subd=kornpong&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><strong>WordPress MU</strong> is a multi user version of<strong> WordPress</strong>.</p>
<p>If you&#8217;re not comfortable editing <strong>PHP</strong> code, taking care of a complex<br />
webserver and database system and being pro-active about following<br />
developments of this project then run, don&#8217;t walk, to<br />
http://wordpress.com/ and sign yourself and your friends up to free blogs.<br />
It&#8217;s easier in the long run and you&#8217;ll save yourself a lot of pain<br />
and angst.</p>
<p><span id="more-8"></span></p>
<h3>WordPress MU features</h3>
<ul>
<li>Everything WordPress does</li>
<li>Scaling to tens of millions of pageviews per day.</li>
<li>Unlimited users and blogs.</li>
<li>Different permissions on different blogs.</li>
<li>Ambiguity about how to pronounce its name</li>
</ul>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/kornpong.wordpress.com/8/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/kornpong.wordpress.com/8/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kornpong.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kornpong.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kornpong.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kornpong.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kornpong.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kornpong.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kornpong.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kornpong.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kornpong.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kornpong.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kornpong.wordpress.com&blog=2184334&post=8&subd=kornpong&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://kornpong.wordpress.com/2008/05/12/wordpress-mu-%e0%b8%84%e0%b8%b7%e0%b8%ad%e0%b8%ad%e0%b8%b0%e0%b9%84%e0%b8%a3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/901cc04b07772e0fa0e9e4eb06273f0b?s=96&#38;d=identicon" medium="image">
			<media:title type="html">gossippc</media:title>
		</media:content>
	</item>
		<item>
		<title>Hello world!</title>
		<link>http://kornpong.wordpress.com/2007/11/23/hello-world/</link>
		<comments>http://kornpong.wordpress.com/2007/11/23/hello-world/#comments</comments>
		<pubDate>Fri, 23 Nov 2007 08:41:26 +0000</pubDate>
		<dc:creator>gossippc</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kornpong.wordpress.com&blog=2184334&post=1&subd=kornpong&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Welcome to <a href="http://wordpress.com/">WordPress.com</a>. This is your first post. Edit or delete it and start blogging!</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/kornpong.wordpress.com/1/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/kornpong.wordpress.com/1/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kornpong.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kornpong.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kornpong.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kornpong.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kornpong.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kornpong.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kornpong.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kornpong.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kornpong.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kornpong.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kornpong.wordpress.com&blog=2184334&post=1&subd=kornpong&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://kornpong.wordpress.com/2007/11/23/hello-world/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/901cc04b07772e0fa0e9e4eb06273f0b?s=96&#38;d=identicon" medium="image">
			<media:title type="html">gossippc</media:title>
		</media:content>
	</item>
	</channel>
</rss>