<?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>Nick125.com</title>
	<atom:link href="http://nick125.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://nick125.com</link>
	<description>The Official Interblag(R) of nick125</description>
	<lastBuildDate>Tue, 24 Aug 2010 02:16:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>New and Improved Nginx vhost Templates!</title>
		<link>http://nick125.com/2010/08/new-and-improved-nginx-vhost-templates/</link>
		<comments>http://nick125.com/2010/08/new-and-improved-nginx-vhost-templates/#comments</comments>
		<pubDate>Mon, 23 Aug 2010 04:42:45 +0000</pubDate>
		<dc:creator>nick</dc:creator>
				<category><![CDATA[Nginx]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://nick125.com/?p=39</guid>
		<description><![CDATA[Following my previous article on the subject, I was inspired to make it even easier to add vhosts. Since the previous configuration template had several generic blocks of code in it that wouldn&#8217;t change between vhosts, I decided to move that into includes. This improves the maintainability of the Nginx setup &#8212; rather than modifying [...]]]></description>
			<content:encoded><![CDATA[<p>Following my <a href="http://nick125.com/2010/08/nginx-vhost-template/">previous article</a> on the subject, I was inspired to make it even easier to add vhosts. Since the previous configuration template had several generic blocks of code in it that wouldn&#8217;t change between vhosts, I decided to move that into includes. This improves the maintainability of the Nginx setup &#8212; rather than modifying each vhost, you can easily modify the included file! <span id="more-39"></span></p>
<h2>The Files</h2>
<h3>templates/main:</h3>
<p><script src="http://gist.github.com/544782.js?file=templates_main"></script> This is the main &#8220;meat&#8221; of the entire vhost system. It sets the root directory, the indexes, the access log path, as well as some sane defaults for static files. You can modify this file as you might need, but I would recommend leaving it barebones.</p>
<h3>templates/php5:</h3>
<p><script src="http://gist.github.com/544782.js?file=templates_php5"></script><br />
This allows you to easily enable FastCGI&#8217;ed PHP on a host-by-host basis. For instance, you might not want your static media vhost to have PHP access. You may need to modify this file, depending on how you have PHP setup on your server. This exceeds the scope of this article, but I do plan to write on it in the future.</p>
<p><strong>NOTE:</strong> It came to my attention that there was a security vulnerability in my configuration. As such, I&#8217;ve added the <code>if (!-f $request_filename)</code> portion to my php5 block above. This prevents PHP from executing arbitrary files, such as /image.jpg/index.php. Without this fix, php would execute /image.jpg as a PHP file, allowing for arbitrary code execution. If you don&#8217;t like using an if block, you can also modify the <code>cgi.fix_pathinfo</code> setting in php.ini, setting it to 0. Just remember to uncomment it as well <img src='http://nick125.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  Thanks to <a href="http://blog.martinfjordvald.com/">Seph</a> on the #nginx IRC channel! <img src='http://nick125.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>templates/clean-urls:</h3>
<p><script src="http://gist.github.com/544782.js?file=templates_clean-url"></script> This script allows you to easily setup Drupal/Wordpress Clean URLs. If you use these web applications, this template will be useful to you!</p>
<h3>templates/vhost-template:</h3>
<p><script src="http://gist.github.com/544782.js?file=templates_vhost-template"></script><br />
This is the &#8220;template&#8221; that you&#8217;ll create vhosts from. You can enable PHP5 and Clean URLs by simply uncommenting the respective lines. Just replace &#8220;DOMAIN&#8221; with your domain name.</p>
<h2>Using the templates</h2>
<p>You may need to tweak the templates to fit your system configuration. For instance, if your web root directory isn&#8217;t <code>/srv/www</code>, you&#8217;ll need to modify the templates with the correct paths. Also, you may wish to change the directory names (i.e., <code>/srv/www/DOMAIN/www</code>) to something else (i.e., <code>/srv/www/DOMAIN/public_html</code>). Depending on your configuration and requirements, you may want to add additional variables. For instance, if you&#8217;re hosting sites for multiple users, you may change the $user variable to become the username (as in, /home/$user/) and then add another variable to signify the domain.</p>
<p>If you&#8217;re deploying many instances of the same application (i.e., WordPress, Drupal, etc), you can also create a separate template for those applications.<br />
I&#8217;ll leave those modifications as an exercise for the reader..moving on.</p>
<p>Generally, my workflow for using the templates looks like such:<br />
<script src="http://gist.github.com/544782.js?file=workflow"></script></p>
<p>I am planning on writing a few &#8220;helper&#8221; scripts to automate this even further, so stay tuned! In the mean time, enjoy!</p>
<p>Thanks to <a href="http://profarius.com/">MTecknology</a> on the #nginx IRC channel for the idea! <img src='http://nick125.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://nick125.com/2010/08/new-and-improved-nginx-vhost-templates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MariaDB on Ubuntu Server, and WordPress</title>
		<link>http://nick125.com/2010/08/mariadb-on-ubuntu-server-and-wordpress/</link>
		<comments>http://nick125.com/2010/08/mariadb-on-ubuntu-server-and-wordpress/#comments</comments>
		<pubDate>Sun, 22 Aug 2010 08:51:55 +0000</pubDate>
		<dc:creator>nick</dc:creator>
				<category><![CDATA[MariaDB]]></category>
		<category><![CDATA[Site]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://nick125.com/?p=32</guid>
		<description><![CDATA[MariaDB is a drop-in replacement for MySQL that offers to be faster, as well as other differences. The biggest difference is the XtraDB engine, a drop-in replacement for InnoDB that offers some performance tweaks and features. Here&#8217;s a simple guide that&#8217;ll tell you how to install MariaDB on Ubuntu Server (10.04, although the guide should [...]]]></description>
			<content:encoded><![CDATA[<p>MariaDB is a drop-in replacement for MySQL that offers to be faster, as well as <a href="http://kb.askmonty.org/v/mariadb-versus-mysql">other differences.</a> The biggest difference is the XtraDB engine, a drop-in replacement for InnoDB that offers some performance tweaks and features. Here&#8217;s a simple guide that&#8217;ll tell you how to install MariaDB on Ubuntu Server (10.04, although the guide should apply to other versions with a few minor changes) and get WordPress to run properly. <span id="more-32"></span></p>
<h2>Installing MariaDB</h2>
<p><a href="http://ourdelta.org">OurDelta</a> provides <a href="http://ourdelta.org/debian">Debian</a> and <a href="http://ourdelta.org/ubuntu">Ubuntu</a> packages of MariaDB, making it simple to install on these distributions. If you&#8217;re running something else, there are likely to be packages somewhere.</p>
<p>At the time of this writing, OurDelta&#8217;s <a href="http://ourdelta.org/ubuntu">Ubuntu</a> does not mention a build available for Lucid Lynx, but there is one available <a href="http://mirror.ourdelta.org/deb/dists/lucid/mariadb-ourdelta/">here.</a> To setup the repository, you can follow the instructions on OurDelta&#8217;s mirror page. For your convenience, here they are:</p>
<p><script src="http://gist.github.com/543539.js?file=OurDelta-Lucid-AddRepo"></script></p>
<p>Once you&#8217;ve added the repository, you can install the -server and -client package:<br />
 <script src="http://gist.github.com/543539.js?file=OurDelta-Lucid-InstallPkgs"></script></p>
<p>It&#8217;ll prompt you to set a root password, just like the MySQL packages. After that, you&#8217;re almost good to go!</p>
<h2>Configuring MariaDB for WordPress</h2>
<p>As it turns out, the default configuration file included with OurDelta&#8217;s will run the SQL server in &#8220;Strict,&#8221; also known as &#8220;Traditional,&#8221; mode. We&#8217;ll need to disable this in order for WordPress (and other applications) to work properly without spewing SQL errors. In your /etc/mysql/my.cnf file, you will look for the <code>sql_mode</code> line. By default, it looks something like <code>sql_mode = NO_ENGINE_SUBSTITUTION,TRADITIONAL</code> . You&#8217;ll want to remove the TRADITIONAL part, as well as the preceding comma. Following the changes, your sql_mode line should look something like this:<br />
<script src="http://gist.github.com/543539.js?file=sqlmodeline"></script></p>
<p>Once the MariaDB packages are installed, you should be able to install any packages that require MySQL, such as php5-mysql. The OurDelta packages will provide the mysql-server and mysql-client packages, providing compatibility for packages that aren&#8217;t aware of MariaDB.</p>
<p>After that, WordPress should install and operate as you would expect it to. Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://nick125.com/2010/08/mariadb-on-ubuntu-server-and-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nginx Vhost Template</title>
		<link>http://nick125.com/2010/08/nginx-vhost-template/</link>
		<comments>http://nick125.com/2010/08/nginx-vhost-template/#comments</comments>
		<pubDate>Sun, 22 Aug 2010 04:43:39 +0000</pubDate>
		<dc:creator>nick</dc:creator>
				<category><![CDATA[Nginx]]></category>
		<category><![CDATA[Site]]></category>

		<guid isPermaLink="false">http://nick125.com/?p=23</guid>
		<description><![CDATA[When setting up vhosts on my new Nginx install, I found it useful to create a &#8220;template&#8221; in my /etc/nginx/sites-available/ directory (yes, it&#8217;s the Debian/Ubuntu install) and just copy it when setting up a new vhost. I figured someone else might use it.  Without further ado, here it is: Hope this will help someone. UPDATE: I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>When setting up vhosts on my new Nginx install, I found it useful to create a &#8220;template&#8221; in my /etc/nginx/sites-available/ directory (yes, it&#8217;s the Debian/Ubuntu install) and just copy it when setting up a new vhost. I figured someone else might use it. <span id="more-23"></span></p>
<p>Without further ado, here it is:</p>
<p><script src="http://gist.github.com/543312.js"> </script></p>
<p>Hope this will help someone.</p>
<p><strong>UPDATE:</strong> I&#8217;ve updated the template with some of the Nginx best practices, as per their <a href="http://wiki.nginx.org/Pitfalls">pitfalls</a> page. Enjoy.</p>
<p><strong>UPDATE:</strong> It came to my attention that there was a security vulnerability in my configuration. As such, I&#8217;ve added the <code>if (!-f $request_filename)</code> portion to my php5 block above. This prevents PHP from executing arbitrary files, such as /image.jpg/index.php. Without this fix, php would execute /image.jpg as a PHP file, allowing for arbitrary code execution. Bad stuff! Thanks to <a href="http://blog.martinfjordvald.com/">Seph</a> on the #nginx IRC channel! <img src='http://nick125.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://nick125.com/2010/08/nginx-vhost-template/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>nginx, php5-fpm, and WordPress Clean URLs</title>
		<link>http://nick125.com/2010/08/nginx-php5-fpm-and-wordpress-clean-urls/</link>
		<comments>http://nick125.com/2010/08/nginx-php5-fpm-and-wordpress-clean-urls/#comments</comments>
		<pubDate>Sun, 22 Aug 2010 04:25:04 +0000</pubDate>
		<dc:creator>nick</dc:creator>
				<category><![CDATA[Linode]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[Site]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nick125.com/?p=10</guid>
		<description><![CDATA[I recently moved to Linode and I decided to try out nginx (pronounced &#8220;engine-x&#8221;). It has some nice features that Lighttpd doesn&#8217;t..maybe I&#8217;ll write up some of the new features sometime. One of these features is called &#8220;try_files,&#8221; which reduces some of the hacks that are needed to enable Clean URLs while still allowing access [...]]]></description>
			<content:encoded><![CDATA[<p>I recently moved to <a href="http://linode.com">Linode</a> and I decided to try out nginx (pronounced &#8220;engine-x&#8221;). It has some nice features that Lighttpd doesn&#8217;t..maybe I&#8217;ll write up some of the new features sometime. One of these features is called &#8220;try_files,&#8221; which reduces some of the hacks that are needed to enable Clean URLs while still allowing access to static files. It allows you to suggest multiple paths that nginx could use to try to handle the request. Useful, if you ask me. <span id="more-10"></span></p>
<p>Here&#8217;s some of my configuration that I used to enable Clean URLs while not breaking the SCRIPT_FILENAME (and php5-fpm):<br />
<script src="http://gist.github.com/543298.js"> </script></p>
<h6>Note: yes, it&#8217;s Gist&#8230;Wordpress cannot handle code blocks worth a damn. If you run a WordPress blog, please, for the love of God, use Gist or something else that can do code blocks.</h6>
<p>It uses try_files to handle static files and if that fails, sends it to the @wordpress location, which rewrites the URL for WordPress. Just add it to your existing server directive and you&#8217;ll be good to go!</p>
<p>Although this <strong>is</strong> for WordPress, it <strong>should</strong> work in many other CMSes and blogs that use the same setup for handling Clean URLs.</p>
<p>Cheers!</p>
<p><strong>UPDATE:</strong> I&#8217;ve updated this configuration snippet to follow nginx best practices, as outlined on their <a href="http://wiki.nginx.org/Pitfalls">Pitfalls</a> page. Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://nick125.com/2010/08/nginx-php5-fpm-and-wordpress-clean-urls/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.151 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2010-09-06 12:13:46 -->
