<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>Tech Titbits</title>
	
	<link>http://techtitbits.com</link>
	<description>Titbits of technology, with extra sauce</description>
	<lastBuildDate>Sun, 22 Aug 2010 07:02:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/TechTitbits" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="techtitbits" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">TechTitbits</feedburner:emailServiceId><feedburner:feedburnerHostname xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>WordPress permalinks in nginx</title>
		<link>http://techtitbits.com/2010/08/wordpress-permalinks-in-nginx/</link>
		<comments>http://techtitbits.com/2010/08/wordpress-permalinks-in-nginx/#comments</comments>
		<pubDate>Sun, 22 Aug 2010 06:53:59 +0000</pubDate>
		<dc:creator>Ellimist</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[permalinks]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://techtitbits.com/?p=562</guid>
		<description><![CDATA[WordPress generally works out-of-the box on nginx. The posts load fine, the functions in the dashboard work pretty well, until you come to the permalinks. If you are on Apache, with mod_rewrite, WordPress will automatically add the required rewrite rules to your .htaccess file for permalinks to work. But for nginx, you have to add [...]


Related posts:<ol><li><a href='http://techtitbits.com/2010/07/enable-directory-listing-in-nginx/' rel='bookmark' title='Permanent Link: Enable directory listing in nginx'>Enable directory listing in nginx</a></li>
<li><a href='http://techtitbits.com/2010/07/nginx-resolving-no-input-file-specified-error/' rel='bookmark' title='Permanent Link: Nginx: Resolving &#8220;No input file specified&#8221; error'>Nginx: Resolving &#8220;No input file specified&#8221; error</a></li>
<li><a href='http://techtitbits.com/2010/08/ipv6-support-in-nginx/' rel='bookmark' title='Permanent Link: IPv6 support in nginx'>IPv6 support in nginx</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://techtitbits.com/wp-content/uploads/2010/07/nginx.gif"><img class="alignright size-full wp-image-512" title="nginx" src="http://techtitbits.com/wp-content/uploads/2010/07/nginx.gif" alt="nginx logo" width="121" height="32" /></a>WordPress generally works out-of-the box on nginx. The posts load fine, the functions in the dashboard work pretty well, until you come to the permalinks. If you are on Apache, with mod_rewrite, WordPress will automatically add the required rewrite rules to your <code>.htaccess</code> file for permalinks to work. But for nginx, you have to add the rules manually.</p>
<p>Moreover, when WordPress detects that mod_rewrite is not loaded (which is the case with nginx), it falls back to using <a href="http://codex.wordpress.org/Using_Permalinks#PATHINFO:_.22Almost_Pretty.22" target="_self"><code>PATHINFO</code></a> permalinks, which inserts an extra &#8216;index.php&#8217; in front. This hasn&#8217;t been much of a problem for me as I have been using the custom structure option to remove the index.php. It has been working fine for me. (Screenshot below)</p>
<p><a href="http://techtitbits.com/wp-content/uploads/2010/08/nginx_wordpress_permalinks.jpg"><img class="aligncenter size-full wp-image-564" title="nginx wordpress permalinks" src="http://techtitbits.com/wp-content/uploads/2010/08/nginx_wordpress_permalinks.jpg" alt="" width="673" height="244" /></a></p>
<p>Apart from that, you will also need to edit your nginx configuration file to make the permalinks work. We will use the <a href="http://wiki.nginx.org/NginxHttpCoreModule#try_files" target="_blank"><code>try_files</code> directive</a> to pass URLs to WordPress&#8217;s index.php for them to be internally handled. This will also work for 404 requests.</p>
<ul>
<li>If your blog is at the root of the domain (something like <code>http://www.myblog.com</code>), find the &#8220;<code>location /</code>&#8221; block inside the configuration file, and add the following line to it.
<pre class="brush: bash;">try_files $uri $uri/ /index.php?q=$uri&amp;amp;$args;</pre>
<p>It should look like this after the edits :</p>
<pre class="brush: bash;">        location / {
                root   /var/www/nginx-default;
                index  index.php index.html index.htm;
                try_files $uri $uri/ /index.php?q=$uri&amp;$args;
        }</pre>
</li>
<li>If your blog is in a subfolder (say /blog), you&#8217;ll have to add an extra &#8220;<code>location /blog/</code>&#8221; block to your configuration file :
<pre class="brush: bash;">        location /blog/ {
                try_files $uri $uri/ /blog/index.php?q=$uri&amp;$args;
        }</pre>
</li>
</ul>
<p>After you have finished making the changes in the configuration file, reload the nginx configuration by :</p>
<pre class="brush: bash;">nginx -s reload</pre>
<p>WordPress&#8217; pretty permalinks should work fine now.</p>


<p>Related posts:<ol><li><a href='http://techtitbits.com/2010/07/enable-directory-listing-in-nginx/' rel='bookmark' title='Permanent Link: Enable directory listing in nginx'>Enable directory listing in nginx</a></li>
<li><a href='http://techtitbits.com/2010/07/nginx-resolving-no-input-file-specified-error/' rel='bookmark' title='Permanent Link: Nginx: Resolving &#8220;No input file specified&#8221; error'>Nginx: Resolving &#8220;No input file specified&#8221; error</a></li>
<li><a href='http://techtitbits.com/2010/08/ipv6-support-in-nginx/' rel='bookmark' title='Permanent Link: IPv6 support in nginx'>IPv6 support in nginx</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://techtitbits.com/2010/08/wordpress-permalinks-in-nginx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IPv6 support in nginx</title>
		<link>http://techtitbits.com/2010/08/ipv6-support-in-nginx/</link>
		<comments>http://techtitbits.com/2010/08/ipv6-support-in-nginx/#comments</comments>
		<pubDate>Wed, 18 Aug 2010 07:59:53 +0000</pubDate>
		<dc:creator>Ellimist</dc:creator>
				<category><![CDATA[nginx]]></category>

		<guid isPermaLink="false">http://techtitbits.com/?p=548</guid>
		<description><![CDATA[To enable IPv6 support in nginx, we need to check whether it has been compiled with --with-ipv6 flag. To check, fire up the terminal and type in this command : nginx -V The results should be something like this : nginx version: nginx/0.7.65 TLS SNI support enabled configure arguments: --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/body [...]


Related posts:<ol><li><a href='http://techtitbits.com/2010/07/nginx-resolving-no-input-file-specified-error/' rel='bookmark' title='Permanent Link: Nginx: Resolving &#8220;No input file specified&#8221; error'>Nginx: Resolving &#8220;No input file specified&#8221; error</a></li>
<li><a href='http://techtitbits.com/2010/07/enable-directory-listing-in-nginx/' rel='bookmark' title='Permanent Link: Enable directory listing in nginx'>Enable directory listing in nginx</a></li>
<li><a href='http://techtitbits.com/2010/07/wwwno-www-rewrite-rules-for-nginx/' rel='bookmark' title='Permanent Link: Www/no-www rewrite rules for nginx'>Www/no-www rewrite rules for nginx</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://techtitbits.com/wp-content/uploads/2010/07/nginx.gif"><img src="http://techtitbits.com/wp-content/uploads/2010/07/nginx.gif" alt="nginx logo" title="nginx" width="121" height="32" class="alignright size-full wp-image-512" /></a>To enable IPv6 support in nginx, we need to check whether  it has been compiled with <code>--with-ipv6</code> flag. To check, fire up the terminal and type in this command :</p>
<pre class="brush: bash;">nginx -V</pre>
<p>The results should be something like this :</p>
<pre class="brush: bash;">nginx version: nginx/0.7.65
TLS SNI support enabled
configure arguments: --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/body --http-proxy-temp-path=/var/lib/nginx/proxy --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --with-debug --with-http_stub_status_module --with-http_flv_module --with-http_ssl_module --with-http_dav_module --with-http_gzip_static_module --with-http_realip_module --with-mail --with-mail_ssl_module --with-ipv6 --add-module=/build/buildd/nginx-0.7.65/modules/nginx-upstream-fair</pre>
<p>Pre-compiled Debian/Ubuntu packages already has IPv6 support built-in.</p>
<p>Now we need to edit the configuration file to tell nginx to bind to IPv6 addresses(as well as IPv4 addresses).</p>
<pre class="brush: bash;">sudo nano /etc/nginx/sites-available/default</pre>
<p>Depending on your configuration, this file might be located somewhere else. (Check <code>/usr/local/nginx/conf/nginx.conf</code> if you compiled nginx manually)</p>
<p>Search for listen directives and change them as follows:</p>
<pre class="brush: plain;">listen [::]:80;</pre>
<p>This will make nginx bind to both IPv6 and IPv4 addresses.</p>
<p>In order to bind to IPv6 addresses only (no IPv4), use the following:</p>
<pre class="brush: plain;">listen [::]:80 default ipv6only=on;</pre>
<p>In order to bind to a specific IPv6 address:</p>
<pre class="brush: plain;">listen [2001:6f8:1c00:16d::2]:80;</pre>
<p>When you are done, reload the nginx configuration file by typing in :</p>
<pre class="brush: bash;">nginx -s reload</pre>
<p>Now we have to check whether nginx is listening to both IPv6 and IPv4 requests:</p>
<pre class="brush: bash;">netstat -tulpna | grep nginx</pre>
<p>You&#8217;ll get something like this :</p>
<pre class="brush: plain;">tcp6       0      0 :::80                   :::*                    LISTEN      1891/nginx</pre>
<p>You have successfully configured nginx to respond to IPv6 requests.</p>


<p>Related posts:<ol><li><a href='http://techtitbits.com/2010/07/nginx-resolving-no-input-file-specified-error/' rel='bookmark' title='Permanent Link: Nginx: Resolving &#8220;No input file specified&#8221; error'>Nginx: Resolving &#8220;No input file specified&#8221; error</a></li>
<li><a href='http://techtitbits.com/2010/07/enable-directory-listing-in-nginx/' rel='bookmark' title='Permanent Link: Enable directory listing in nginx'>Enable directory listing in nginx</a></li>
<li><a href='http://techtitbits.com/2010/07/wwwno-www-rewrite-rules-for-nginx/' rel='bookmark' title='Permanent Link: Www/no-www rewrite rules for nginx'>Www/no-www rewrite rules for nginx</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://techtitbits.com/2010/08/ipv6-support-in-nginx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nginx reduces page load time, increases Googlebot activity</title>
		<link>http://techtitbits.com/2010/08/nginx-reduces-page-load-time-increases-googlebot-activity/</link>
		<comments>http://techtitbits.com/2010/08/nginx-reduces-page-load-time-increases-googlebot-activity/#comments</comments>
		<pubDate>Thu, 12 Aug 2010 18:02:21 +0000</pubDate>
		<dc:creator>Ellimist</dc:creator>
				<category><![CDATA[Web Hosting]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[page speed]]></category>

		<guid isPermaLink="false">http://techtitbits.com/?p=538</guid>
		<description><![CDATA[After a small incident with a shared host, I moved my phpBB forum and a few other static sites to a VPS running on nginx. Nginx is a small, lightweight but very efficient web server created by Igor Sysoev, originally developed for www.rambler.ru, Russia&#8217;s second-largest web site. Due to it&#8217;s light-weightedness and efficiency, it is [...]


Related posts:<ol><li><a href='http://techtitbits.com/2010/08/wordpress-permalinks-in-nginx/' rel='bookmark' title='Permanent Link: WordPress permalinks in nginx'>WordPress permalinks in nginx</a></li>
<li><a href='http://techtitbits.com/2010/07/nginx-resolving-no-input-file-specified-error/' rel='bookmark' title='Permanent Link: Nginx: Resolving &#8220;No input file specified&#8221; error'>Nginx: Resolving &#8220;No input file specified&#8221; error</a></li>
<li><a href='http://techtitbits.com/2009/01/www-or-no-www/' rel='bookmark' title='Permanent Link: WWW or no-WWW?'>WWW or no-WWW?</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://techtitbits.com/wp-content/uploads/2010/07/nginx.gif"><img src="http://techtitbits.com/wp-content/uploads/2010/07/nginx.gif" alt="nginx logo" title="nginx" width="121" height="32" class="alignright size-full wp-image-512" /></a>After a small incident with a shared host, I moved my phpBB forum and a few other static sites to a VPS running on nginx. <a href="http://nginx.net/" target="_blank">Nginx</a> is a small, lightweight but very efficient web server created by Igor Sysoev, originally developed for <a href="http://www.rambler.ru/">www.rambler.ru</a>, Russia&#8217;s second-largest web site. Due to it&#8217;s light-weightedness and efficiency, it is used by a lot of high traffic sites like <a href="http://www.wordpress.com" target="_blank" class="external text" title="http://www.wordpress.com" rel="nofollow">WordPress</a>, <a href="http://www.hulu.com" target="_blank" class="external text" title="http://www.hulu.com" rel="nofollow">Hulu</a>, <a href="http://www.github.com/" target="_blank" class="external text" title="http://www.github.com/" rel="nofollow">Github</a>, <a href="http://www.ohloh.net/" target="_blank" class="external text" title="http://www.ohloh.net/" rel="nofollow">Ohloh</a>, <a href="http://www.sourceforge.net" target="_blank" class="external text" title="http://www.sourceforge.net" rel="nofollow">SourceForge</a>, <a href="http://torrentreactor.net/" target="_blank" class="external text" title="http://torrentreactor.net/" rel="nofollow">TorrentReactor</a>, etc. After moving to Nginx, I noticed a significant improvement in page load times. The pages on the site load in around 0.0X seconds now, as reported by the phpBB&#8217;s measurement system. The pages also seem to be snappier as compared to the time when I was on Litespeed.</p>
<p>I recently noticed that apart for the decrease in page loading time, the activity of Googlebot has increased manyfold. Here&#8217;s a screen-shot of the report from Google Webmaster Tools :</p>
<p><a href="http://techtitbits.com/wp-content/uploads/2010/08/google_web_tools_nginx.png"><img class="aligncenter size-full wp-image-540" title="Google Webmaster Tools Nginx" src="http://techtitbits.com/wp-content/uploads/2010/08/google_web_tools_nginx.png" alt="Google Webmaster Tools Nginx" width="1024" height="768" /></a>Not bad, eh?</p>
<p>More recently, I moved this blog to the VPS running on Nginx, and I have not been disappointed. This blog is running on WordPress 3.0.1, with no caching plugins. The posts seem to load faster than ever, as evident from this Google Webmaster Tools report :</p>
<p><a href="http://techtitbits.com/wp-content/uploads/2010/08/google_webmaster_tools_nginx.png"><img class="aligncenter size-full wp-image-542" title="google webmaster tools nginx techtitbits" src="http://techtitbits.com/wp-content/uploads/2010/08/google_webmaster_tools_nginx.png" alt="google webmaster tools nginx techtitbits" width="1024" height="768" /></a></p>
<p>I couldn&#8217;t be more happy.</p>
<p>PS: Of course, some of the speed improvement can be attributed to the fact that I moved from a shared server to a VPS, but that doesn&#8217;t undermine the awesomeness that is Nginx.</p>
<p>PPS: Just in case anyone&#8217;s interested, I&#8217;m providing limited slots for hosting your site on this VPS. If you are interested, <a href="http://animorphsfanforum.com/hosting/">visit the page</a>.</p>


<p>Related posts:<ol><li><a href='http://techtitbits.com/2010/08/wordpress-permalinks-in-nginx/' rel='bookmark' title='Permanent Link: WordPress permalinks in nginx'>WordPress permalinks in nginx</a></li>
<li><a href='http://techtitbits.com/2010/07/nginx-resolving-no-input-file-specified-error/' rel='bookmark' title='Permanent Link: Nginx: Resolving &#8220;No input file specified&#8221; error'>Nginx: Resolving &#8220;No input file specified&#8221; error</a></li>
<li><a href='http://techtitbits.com/2009/01/www-or-no-www/' rel='bookmark' title='Permanent Link: WWW or no-WWW?'>WWW or no-WWW?</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://techtitbits.com/2010/08/nginx-reduces-page-load-time-increases-googlebot-activity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enable directory listing in nginx</title>
		<link>http://techtitbits.com/2010/07/enable-directory-listing-in-nginx/</link>
		<comments>http://techtitbits.com/2010/07/enable-directory-listing-in-nginx/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 13:49:56 +0000</pubDate>
		<dc:creator>Ellimist</dc:creator>
				<category><![CDATA[nginx]]></category>
		<category><![CDATA[directory listing]]></category>

		<guid isPermaLink="false">http://techtitbits.com/?p=530</guid>
		<description><![CDATA[Enabling directory listing in a folder in nginx seems simple enough with just an autoindex on; directive inside the location directive. However, for some reason, it didn&#8217;t work for me. I finally got it to work by moving the root directive out of location. So, if you have something like this : server { listen [...]


Related posts:<ol><li><a href='http://techtitbits.com/2010/07/wwwno-www-rewrite-rules-for-nginx/' rel='bookmark' title='Permanent Link: Www/no-www rewrite rules for nginx'>Www/no-www rewrite rules for nginx</a></li>
<li><a href='http://techtitbits.com/2010/08/wordpress-permalinks-in-nginx/' rel='bookmark' title='Permanent Link: WordPress permalinks in nginx'>WordPress permalinks in nginx</a></li>
<li><a href='http://techtitbits.com/2010/07/nginx-resolving-no-input-file-specified-error/' rel='bookmark' title='Permanent Link: Nginx: Resolving &#8220;No input file specified&#8221; error'>Nginx: Resolving &#8220;No input file specified&#8221; error</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://techtitbits.com/wp-content/uploads/2010/07/nginx.gif"><img class="alignright size-full wp-image-512" title="nginx" src="http://techtitbits.com/wp-content/uploads/2010/07/nginx.gif" alt="nginx logo" width="121" height="32" /></a>Enabling directory listing in a folder in nginx seems simple enough with just an <code>autoindex on;</code> directive inside the location directive. However, for some reason, it didn&#8217;t work for me.</p>
<p>I finally got it to work by moving the root directive out of location.<br />
So, if you have something like this :</p>
<pre class="brush: plain;">server {
        listen   80;
        server_name  domain.com www.domain.com;
        access_log  /var/...........................;
        location / {
                root   /path/to/root;
                index  index.php index.html index.htm;
        }
        location /somedir {
               autoindex on;
        }
}</pre>
<p>Change it to :</p>
<pre class="brush: plain;">server {
        listen   80;
        server_name  domain.com www.domain.com;
        access_log  /var/...........................;
        root   /path/to/root;
        location / {
                index  index.php index.html index.htm;
        }
        location /somedir {
               autoindex on;
        }
}</pre>
<p>Directory indices should show flawlessly now.<br />
(A live example can be found <a href="http://animorphsfanforum.com/fanart/2064/" target="_blank">here</a>.)</p>


<p>Related posts:<ol><li><a href='http://techtitbits.com/2010/07/wwwno-www-rewrite-rules-for-nginx/' rel='bookmark' title='Permanent Link: Www/no-www rewrite rules for nginx'>Www/no-www rewrite rules for nginx</a></li>
<li><a href='http://techtitbits.com/2010/08/wordpress-permalinks-in-nginx/' rel='bookmark' title='Permanent Link: WordPress permalinks in nginx'>WordPress permalinks in nginx</a></li>
<li><a href='http://techtitbits.com/2010/07/nginx-resolving-no-input-file-specified-error/' rel='bookmark' title='Permanent Link: Nginx: Resolving &#8220;No input file specified&#8221; error'>Nginx: Resolving &#8220;No input file specified&#8221; error</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://techtitbits.com/2010/07/enable-directory-listing-in-nginx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Www/no-www rewrite rules for nginx</title>
		<link>http://techtitbits.com/2010/07/wwwno-www-rewrite-rules-for-nginx/</link>
		<comments>http://techtitbits.com/2010/07/wwwno-www-rewrite-rules-for-nginx/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 04:14:37 +0000</pubDate>
		<dc:creator>Ellimist</dc:creator>
				<category><![CDATA[nginx]]></category>
		<category><![CDATA[non-www]]></category>
		<category><![CDATA[rewrite]]></category>

		<guid isPermaLink="false">http://techtitbits.com/?p=525</guid>
		<description><![CDATA[There are many ways to rewrite www urls to their non-www versions in nginx. Here one that&#8217;s Igor-approved and works well on my setup : WWW to Non-WWW: #301 redirect www to non-www server { listen 80; server_name www.domain.com; rewrite ^ http://domain.com$request_uri? permanent; } server { listen 80; server_name domain.com; ......................................... ......................................... } Non-WWW to [...]


Related posts:<ol><li><a href='http://techtitbits.com/2010/07/enable-directory-listing-in-nginx/' rel='bookmark' title='Permanent Link: Enable directory listing in nginx'>Enable directory listing in nginx</a></li>
<li><a href='http://techtitbits.com/2010/08/ipv6-support-in-nginx/' rel='bookmark' title='Permanent Link: IPv6 support in nginx'>IPv6 support in nginx</a></li>
<li><a href='http://techtitbits.com/2010/07/nginx-resolving-no-input-file-specified-error/' rel='bookmark' title='Permanent Link: Nginx: Resolving &#8220;No input file specified&#8221; error'>Nginx: Resolving &#8220;No input file specified&#8221; error</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://techtitbits.com/wp-content/uploads/2010/07/nginx.gif"><img class="alignright size-full wp-image-512" title="nginx" src="http://techtitbits.com/wp-content/uploads/2010/07/nginx.gif" alt="nginx logo" width="121" height="32" /></a>There are many ways to rewrite www urls to their non-www versions in nginx. Here one that&#8217;s Igor-approved and works well on my setup :</p>
<p><span style="text-decoration: underline;">WWW to Non-WWW:</span></p>
<pre class="brush: plain;">#301 redirect www to non-www
server {
        listen   80;
        server_name  www.domain.com;
        rewrite   ^  http://domain.com$request_uri? permanent;
}
server {
        listen   80;
        server_name  domain.com;
        .........................................
        .........................................
}</pre>
<p><span style="text-decoration: underline;">Non-WWW to WWW:<br />
</span></p>
<pre class="brush: plain;">#301 redirect non-www to www
server {
        listen   80;
        server_name  domain.com;
        rewrite   ^  http://www.domain.com$request_uri? permanent;
}
server {
        listen   80;
        server_name  www.domain.com;
        .........................................
        .........................................
}</pre>


<p>Related posts:<ol><li><a href='http://techtitbits.com/2010/07/enable-directory-listing-in-nginx/' rel='bookmark' title='Permanent Link: Enable directory listing in nginx'>Enable directory listing in nginx</a></li>
<li><a href='http://techtitbits.com/2010/08/ipv6-support-in-nginx/' rel='bookmark' title='Permanent Link: IPv6 support in nginx'>IPv6 support in nginx</a></li>
<li><a href='http://techtitbits.com/2010/07/nginx-resolving-no-input-file-specified-error/' rel='bookmark' title='Permanent Link: Nginx: Resolving &#8220;No input file specified&#8221; error'>Nginx: Resolving &#8220;No input file specified&#8221; error</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://techtitbits.com/2010/07/wwwno-www-rewrite-rules-for-nginx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unexpected email and Alexa bot</title>
		<link>http://techtitbits.com/2010/07/unexpected-email-and-alexa-bot/</link>
		<comments>http://techtitbits.com/2010/07/unexpected-email-and-alexa-bot/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 06:35:30 +0000</pubDate>
		<dc:creator>Ellimist</dc:creator>
				<category><![CDATA[Web Hosting]]></category>
		<category><![CDATA[alexa]]></category>
		<category><![CDATA[email]]></category>

		<guid isPermaLink="false">http://techtitbits.com/?p=517</guid>
		<description><![CDATA[I got a surprise today when I found that I have an email in my inbox from webmaster@animorphsfanforum.com. The email had subject &#8220;Subject&#8221; and has content &#8220;Content&#8221;. My first instinct was that someone has hacked into my VPS. After a few minutes of mind-racking, I remembered that I had created a PHP file on the [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>I got a surprise today when I found that I have an email in my inbox from webmaster@animorphsfanforum.com. The email had subject &#8220;Subject&#8221; and has content &#8220;Content&#8221;. My first instinct was that someone has hacked into my VPS. After a few minutes of mind-racking, I remembered that I had created a PHP file on the VPS named &#8216;mail.php&#8217; to test whether emails were being sent. But, no one knew of it&#8217;s existence except me. Someone must&#8217;ve stumbled upon it my chance. </p>
<p>I logged into my VPS and checked the access logs.</p>
<pre class="brush: bash;">cat animorphsfanforum.access.log | grep 'mail.php'</pre>
<pre class="brush: plain;">174.129.237.157 - - [20/Jul/2010:05:32:40 +0000] &quot;GET /mail.php HTTP/1.0&quot; 200 0 &quot;-&quot; &quot;ia_archiver (+http://www.alexa.com/site/help/webmasters; crawler@alexa.com)&quot;</pre>
<p>I have a Firefox plugin to check the Alexa rank, and the URL must&#8217;ve been sent to Alexa when I executed that script for the first time. The Alexa bot sent the email while crawling the URL.</p>
<p>Much ado about nothing?</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://techtitbits.com/2010/07/unexpected-email-and-alexa-bot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nginx: Resolving “No input file specified” error</title>
		<link>http://techtitbits.com/2010/07/nginx-resolving-no-input-file-specified-error/</link>
		<comments>http://techtitbits.com/2010/07/nginx-resolving-no-input-file-specified-error/#comments</comments>
		<pubDate>Sat, 17 Jul 2010 04:59:45 +0000</pubDate>
		<dc:creator>Ellimist</dc:creator>
				<category><![CDATA[nginx]]></category>
		<category><![CDATA[404]]></category>
		<category><![CDATA[php-cgi]]></category>

		<guid isPermaLink="false">http://techtitbits.com/?p=511</guid>
		<description><![CDATA[If you are using nginx with php-cgi and have followed the standard procedure to set it up, you might often get the &#8220;No input file specified.&#8221; error. What happens here is that, when nginx receives the request to serve a non-existent php file, it passes the request to php-cgi. Php-cgi, while trying to processs the [...]


Related posts:<ol><li><a href='http://techtitbits.com/2010/07/enable-directory-listing-in-nginx/' rel='bookmark' title='Permanent Link: Enable directory listing in nginx'>Enable directory listing in nginx</a></li>
<li><a href='http://techtitbits.com/2010/08/ipv6-support-in-nginx/' rel='bookmark' title='Permanent Link: IPv6 support in nginx'>IPv6 support in nginx</a></li>
<li><a href='http://techtitbits.com/2010/08/wordpress-permalinks-in-nginx/' rel='bookmark' title='Permanent Link: WordPress permalinks in nginx'>WordPress permalinks in nginx</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://techtitbits.com/wp-content/uploads/2010/07/nginx.gif"><img class="alignright size-full wp-image-512" title="nginx" src="http://techtitbits.com/wp-content/uploads/2010/07/nginx.gif" alt="nginx logo" width="121" height="32" /></a>If you are using nginx with php-cgi and have followed the standard procedure to set it up, you might often get the &#8220;No input file specified.&#8221; <em>error</em>. What happens here is that, when nginx receives the request to serve a <strong>non-existent</strong> php file, it passes the request to php-cgi. Php-cgi, while trying to processs the request, finds that the php file does not exist at all. Hence it sends a &#8220;No input file specified.&#8221; message with a &#8220;404 Not Found&#8221; header.</p>
<p>Although, it&#8217;s not technically an error, we can catch the request for the non-existent php file and show a custom 404 page.</p>
<p>First, find out the version of nginx you are using.</p>
<pre class="brush: bash;">nginx -V</pre>
<p>You&#8217;ll get an output like this :</p>
<pre class="brush: bash;">nginx version: nginx/0.7.65
TLS SNI support enabled
configure arguments: --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/body --http-proxy-temp-path=/var/lib/nginx/proxy --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --with-debug --with-http_stub_status_module --with-http_flv_module --with-http_ssl_module --with-http_dav_module --with-http_gzip_static_module --with-http_realip_module --with-mail --with-mail_ssl_module --with-ipv6 --add-module=/build/buildd-nginx_0.7.65-2~bpo50+1-i386-1taiV6/nginx-0.7.65/modules/nginx-upstream-fair</pre>
<p>If php-cgi is running on port 9000, you&#8217;ll have something like this in your vhosts file :</p>
<pre class="brush: plain;">location ~ \.php$ {
fastcgi_pass   127.0.0.1:9000;
fastcgi_index  index.php;
fastcgi_param  SCRIPT_FILENAME ....
...................................
...................................
}</pre>
<p>Since nginx versions less than 0.6.36 doesn&#8217;t have the try_files directive, we&#8217;ll have two versions of the code.</p>
<p><span style="text-decoration: underline;"><strong>For nginx 0.6.36+</strong></span><br />
We&#8217;ll use try_files here to catch and display an error page.</p>
<pre class="brush: plain;">location ~ \.php$ {
try_files  $uri  /path/to/404.htm;
fastcgi_pass   127.0.0.1:9000;
fastcgi_index  index.php;
fastcgi_param  SCRIPT_FILENAME ....
...................................
...................................
}</pre>
<p><span style="text-decoration: underline;"><strong>For older versions :</strong></span></p>
<pre class="brush: bash;">location ~ \.php$ {
fastcgi_intercept_errors on;
error_page  404  /path/to/404.htm;
fastcgi_pass   127.0.0.1:9000;
fastcgi_index  index.php;
fastcgi_param  SCRIPT_FILENAME ....
...................................
...................................
}</pre>
<p>This will display the chosen 404 page for non-existent php files instead of the unhelpful &#8220;No input file specified.&#8221; message.</p>


<p>Related posts:<ol><li><a href='http://techtitbits.com/2010/07/enable-directory-listing-in-nginx/' rel='bookmark' title='Permanent Link: Enable directory listing in nginx'>Enable directory listing in nginx</a></li>
<li><a href='http://techtitbits.com/2010/08/ipv6-support-in-nginx/' rel='bookmark' title='Permanent Link: IPv6 support in nginx'>IPv6 support in nginx</a></li>
<li><a href='http://techtitbits.com/2010/08/wordpress-permalinks-in-nginx/' rel='bookmark' title='Permanent Link: WordPress permalinks in nginx'>WordPress permalinks in nginx</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://techtitbits.com/2010/07/nginx-resolving-no-input-file-specified-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Finding the Lubuntu 10.04 torrent</title>
		<link>http://techtitbits.com/2010/06/finding-the-lubuntu-10-04-torrent/</link>
		<comments>http://techtitbits.com/2010/06/finding-the-lubuntu-10-04-torrent/#comments</comments>
		<pubDate>Sun, 13 Jun 2010 01:52:01 +0000</pubDate>
		<dc:creator>Ellimist</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[lubuntu]]></category>
		<category><![CDATA[lxde]]></category>

		<guid isPermaLink="false">http://techtitbits.com/?p=499</guid>
		<description><![CDATA[I&#8217;ve been meaning to try out Lubuntu for quite some time, but was thwarted by the lack of a torrent. If you didn&#8217;t know, Lubuntu is an Ubuntu variant using the lightweight LXDE desktop environment, like Kubuntu uses KDE or Xubuntu uses XFCE. It hasn&#8217;t been officially approved as a part of the Ubuntu family [...]


Related posts:<ol><li><a href='http://techtitbits.com/2010/04/loving-the-penguin/' rel='bookmark' title='Permanent Link: Loving the Penguin'>Loving the Penguin</a></li>
<li><a href='http://techtitbits.com/2010/05/how-to-download-a-file-concurrentlysimultaneously-from-different-sources-in-ubuntu/' rel='bookmark' title='Permanent Link: How to download a file concurrently/simultaneously from different sources in Ubuntu'>How to download a file concurrently/simultaneously from different sources in Ubuntu</a></li>
<li><a href='http://techtitbits.com/2010/04/resolving-the-network-manager-bug-in-ubuntu-9-10/' rel='bookmark' title='Permanent Link: Resolving the Network Manager bug in Ubuntu 9.10'>Resolving the Network Manager bug in Ubuntu 9.10</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://techtitbits.com/wp-content/uploads/2010/06/lubuntu_logo.png"><img class="size-full wp-image-500 aligncenter" title="lubuntu_logo" src="http://techtitbits.com/wp-content/uploads/2010/06/lubuntu_logo.png" alt="" width="277" height="55" /></a></p>
<p>I&#8217;ve been meaning to try out Lubuntu for quite some time, but was thwarted by the lack of a torrent. If you didn&#8217;t know, Lubuntu is an Ubuntu variant using the lightweight LXDE desktop environment, like Kubuntu uses KDE or Xubuntu uses XFCE. It hasn&#8217;t been officially approved as a part of the Ubuntu family yet, but judging from the <a href="http://www.linux-mag.com/cache/7520/1.html" target="_blank">favourable</a> <a href="http://www.omgubuntu.co.uk/2010/01/lubuntu-1004-alpha-new.html" target="_blank">reviews</a> it <a href="http://www.linuxcritic.com/lubuntu-linux-distribution-lxde-fans/" target="_blank">has been getting</a>, that day might not be far away. Lubuntu is supposed to be much lighter than Xubuntu, which I&#8217;m currently using and seems like it is all that.</p>
<p>Anyway, the official <a href="http://lubuntu.net" target="_blank">Lubuntu.net</a> page doesn&#8217;t show a torrent or metalink download option. Search for a torrent serves up the Lubuntu beta2 torrent or custom Lubuntu distributions created by enthuciasts. I finally got the official torrent from the <a href="https://lists.launchpad.net/lubuntu-desktop/msg01319.html" target="_blank">mailing list archive</a>.</p>
<p>Without further ado, here&#8217;s the torrent downlad link :</p>
<p><a href="http://people.ubuntu.com/~gilir/lubuntu-10.04.iso.torrent">http://people.ubuntu.com/~gilir/lubuntu-10.04.iso.torrent</a></p>
<p>Hope this saves you a little frustration.</p>


<p>Related posts:<ol><li><a href='http://techtitbits.com/2010/04/loving-the-penguin/' rel='bookmark' title='Permanent Link: Loving the Penguin'>Loving the Penguin</a></li>
<li><a href='http://techtitbits.com/2010/05/how-to-download-a-file-concurrentlysimultaneously-from-different-sources-in-ubuntu/' rel='bookmark' title='Permanent Link: How to download a file concurrently/simultaneously from different sources in Ubuntu'>How to download a file concurrently/simultaneously from different sources in Ubuntu</a></li>
<li><a href='http://techtitbits.com/2010/04/resolving-the-network-manager-bug-in-ubuntu-9-10/' rel='bookmark' title='Permanent Link: Resolving the Network Manager bug in Ubuntu 9.10'>Resolving the Network Manager bug in Ubuntu 9.10</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://techtitbits.com/2010/06/finding-the-lubuntu-10-04-torrent/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Storing and reusing Ubuntu updates</title>
		<link>http://techtitbits.com/2010/05/storing-and-reusing-ubuntu-updates/</link>
		<comments>http://techtitbits.com/2010/05/storing-and-reusing-ubuntu-updates/#comments</comments>
		<pubDate>Sun, 30 May 2010 02:25:29 +0000</pubDate>
		<dc:creator>Ellimist</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[/var/cache/apt/archives/]]></category>
		<category><![CDATA[apt-get]]></category>
		<category><![CDATA[aptitude]]></category>
		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">http://techtitbits.com/?p=488</guid>
		<description><![CDATA[Suppose you have two computers running the same version of Ubuntu and you have downloaded and installed the updates on one of the computers. Since you are having a rather expensive or maybe, a limited internet connection, you do not wish to download the updates again for the other computer. Updates downloaded by aptitude are [...]


Related posts:<ol><li><a href='http://techtitbits.com/2010/04/get-rid-of-freeze-ups-during-disk-io-activity-in-ubuntu/' rel='bookmark' title='Permanent Link: Get rid of freeze-ups during disk I/O activity in Ubuntu'>Get rid of freeze-ups during disk I/O activity in Ubuntu</a></li>
<li><a href='http://techtitbits.com/2010/04/resolving-the-network-manager-bug-in-ubuntu-9-10/' rel='bookmark' title='Permanent Link: Resolving the Network Manager bug in Ubuntu 9.10'>Resolving the Network Manager bug in Ubuntu 9.10</a></li>
<li><a href='http://techtitbits.com/2010/04/stop-applications-from-auto-starting-in-ubuntu/' rel='bookmark' title='Permanent Link: Stop applications from auto starting in Ubuntu'>Stop applications from auto starting in Ubuntu</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Suppose you have two computers running the same version of Ubuntu and you have downloaded and installed the updates on one of the computers. Since you are having a rather expensive or maybe, a limited internet connection, you do not wish to download the updates again for the other computer.</p>
<p>Updates downloaded by aptitude are stored in the directory <code>/var/cache/apt/archives</code>. You&#8217;ll find the package files in .deb format(Debian software package format). If these updates are copied to the same directory on the other computer, aptitude will automatically recognise those files and use them as necessary while updating. You can copy the files using a flash drive or write them to a CD if you wish to.<br />
You can copy the packages using this command :</p>
<pre class="brush: bash;">sudo cp /var/cache/apt/archives/* /path/to/flash/drive</pre>
<p>Now connect the flash drive to the other computer and copy the files to the <code>/var/cache/apt/archives/</code> directory there.<br />
After this, you need to update your package information and install the updates found.<br />
Run :</p>
<pre class="brush: bash;">sudo apt-get update &amp;&amp; sudo apt-get upgrade</pre>
<p>All the required updates will be installed from the <code>/var/cache/apt/archives/</code> directory(if available). You can also install new packages, and they will not be downloaded if they are available locally.</p>


<p>Related posts:<ol><li><a href='http://techtitbits.com/2010/04/get-rid-of-freeze-ups-during-disk-io-activity-in-ubuntu/' rel='bookmark' title='Permanent Link: Get rid of freeze-ups during disk I/O activity in Ubuntu'>Get rid of freeze-ups during disk I/O activity in Ubuntu</a></li>
<li><a href='http://techtitbits.com/2010/04/resolving-the-network-manager-bug-in-ubuntu-9-10/' rel='bookmark' title='Permanent Link: Resolving the Network Manager bug in Ubuntu 9.10'>Resolving the Network Manager bug in Ubuntu 9.10</a></li>
<li><a href='http://techtitbits.com/2010/04/stop-applications-from-auto-starting-in-ubuntu/' rel='bookmark' title='Permanent Link: Stop applications from auto starting in Ubuntu'>Stop applications from auto starting in Ubuntu</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://techtitbits.com/2010/05/storing-and-reusing-ubuntu-updates/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Mounting ext4 partitions in Debian</title>
		<link>http://techtitbits.com/2010/05/mounting-ext4-partitions-on-debian/</link>
		<comments>http://techtitbits.com/2010/05/mounting-ext4-partitions-on-debian/#comments</comments>
		<pubDate>Wed, 19 May 2010 14:58:10 +0000</pubDate>
		<dc:creator>Ellimist</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[ext4]]></category>
		<category><![CDATA[test_fs]]></category>
		<category><![CDATA[tune2fs]]></category>

		<guid isPermaLink="false">http://techtitbits.com/?p=476</guid>
		<description><![CDATA[As of Debian 5.04 (Lenny), Debian doesn&#8217;t support mounting ext4 partitions out of the box, or rather, we should say, using conventional methods. Trying to mount an ext4 partition using the mount directive yields the error : mount: unknown filesystem type 'ext4' The roundabout way of doing it is setting a test_fs flag on the [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>As of Debian 5.04 (Lenny), Debian doesn&#8217;t support mounting ext4 partitions out of the box, or rather, we should say, using conventional methods.</p>
<p>Trying to mount an ext4 partition using the mount directive yields the error :</p>
<pre class="brush: plain;">mount: unknown filesystem type 'ext4'</pre>
<p>The roundabout way of doing it is setting a test_fs flag on the partition using the tune2fs utility.</p>
<pre class="brush: bash;">su -
tune2fs -E test_fs /dev/hda1
mount -t ext4dev /dev/hda1 /place/to/mount/</pre>
<p>Replace hda1 with the name of the ext4 partition you want to mount.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://techtitbits.com/2010/05/mounting-ext4-partitions-on-debian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
