<?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>Thoughtless Banter - John Bellone &#187; Technology</title>
	<atom:link href="http://thoughtlessbanter.com/category/technology/feed/" rel="self" type="application/rss+xml" />
	<link>http://thoughtlessbanter.com</link>
	<description>Musings from an east coast software developer, writer and reader.</description>
	<lastBuildDate>Fri, 04 May 2012 02:35:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Towards A Better Code Editor</title>
		<link>http://thoughtlessbanter.com/2012/05/03/towards-a-better-code-editor/</link>
		<comments>http://thoughtlessbanter.com/2012/05/03/towards-a-better-code-editor/#comments</comments>
		<pubDate>Fri, 04 May 2012 02:35:13 +0000</pubDate>
		<dc:creator>JB</dc:creator>
				<category><![CDATA[Dreams and Thoughts]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Text Editor]]></category>

		<guid isPermaLink="false">http://thoughtlessbanter.com/?p=903</guid>
		<description><![CDATA[Most of my day is spent staring at the blinking cursor of my text editor. This is true for many people nowadays as most office work happens on the computer, but for programmers &#8211; the very same individuals whose creativeness are the building blocks for software &#8211; can&#8217;t seem to find a workflow that feels [...]]]></description>
			<content:encoded><![CDATA[<p>Most of my day is spent staring at the blinking cursor of my text editor. This is true for many people nowadays as most office work happens on the computer, but for programmers &#8211; the very same individuals whose creativeness are the building blocks for software &#8211; can&#8217;t seem to find a workflow that feels right. As a developer I find myself getting frustrated every time that I have to reach across my desk for a mouse, switch to a separate application to look up some documentation, or drop into a terminal window for some quick bash kung-fu. I am a firm believer of using the proper tool for the job, but I have been writing code for over ten years now and have yet to find something that fits the purpose.</p>
<p>Most web and application developers that I know are using proficient in many text editors. The editor that they are using is either a result of the product that they are working on, or past experience using a particular piece of technology (extension, script, plugin, etc) that makes the daily grind a little better. I rarely find a developer who doesn&#8217;t have a problem with some facet of the text editor that they are using, and many of which feel that they are stuck for one reason or another with a particular editor because of the feature set it offers.</p>
<p>One thing that seems to be a common theme among these editors is that they sit somewhere between a simple text editor, providing only basic functionality of text formatting, and a full-blown suite of tools which is offered by enterprise packages such as Microsoft&#8217;s Visual Studio which costs thousands of dollars and only works on the Windows platform. Each has its specific use case, and I would never suggest creating a Visual Studio project file to edit a<em> README</em> file using the Markdown syntax, but every time that I have the opportunity to use Visual Studio I always walk away feeling let down the next time I drop into Emacs.</p>
<p>A key feature that I think is necessary in a development environment is the ability for the software package to support live documentation. This means that I want to be able pull up a quick blurb about a particular API call that I am about to make, either be it in a standard library that ships with the language of my choice, or the application project that I am working on. The discoverability of documentation needs to be in depth, but not something which clutters my code window.</p>
<p>The editor software needs to be able to be extended on a per project basis. There are often cases where a particular set of tools is necessary for one web project, let&#8217;s say something like <a href="http://codeigniter.com/">CodeIgniter </a>which uses the <a href="http://getsparks.org/">Sparks package management system</a>, and another application that is written with <a href="http://rubyonrails.org/">Ruby on Rails</a> and using the <a href="http://rubygems.org/">RubyGems</a> system for extensions. And it is not merely easy just to say that all PHP applications will use the <em>mode for PHP</em>, and all the Rails projects will use the <em>mode for Ruby</em>, because often there is a frontend component which shares context between the two and is written in a language such as JavaScript (or more recently, <a href="http://clojure.org/">Clojure</a>).</p>
<p>Testing each project now becomes an absolute pain in the ass. I may need to manage the version of Ruby that I am running, or perhaps bounce the Apache instances so that my new configuration is picked up, or even worse the web application needs to be executed from a browser, I need to tail a log file, and pray that the browser debugging software is updated. That&#8217;s way too many context switches.</p>
<p>I believe that there can be a much better way of handling the day to day workflow of software development. There is a simple solution to this problem that seems to have been overlooked with fancy editors designed to be visually pleasing on the Mac. What do you think your ideal development environment would be? All developers hate writing documentation, but it is the first that we reach for when we want to understand how to work with a library or call a standard API. We cry out aloud when our text editor doesn&#8217;t index the code that I am writing and provide autocomplete. And we bitch when extending the editor becomes a chore which sometimes rivals the problems we&#8217;re trying to solve.</p>
<p>There is a better way to handle this.</p>
]]></content:encoded>
			<wfw:commentRss>http://thoughtlessbanter.com/2012/05/03/towards-a-better-code-editor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why Android Pisses Me Off</title>
		<link>http://thoughtlessbanter.com/2012/01/29/why-android-pisses-me-off/</link>
		<comments>http://thoughtlessbanter.com/2012/01/29/why-android-pisses-me-off/#comments</comments>
		<pubDate>Sun, 29 Jan 2012 16:16:56 +0000</pubDate>
		<dc:creator>JB</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://thoughtlessbanter.com/?p=892</guid>
		<description><![CDATA[After a few years of iPhone ownership I made the mistake that has become signature of clumsy Apple owners as of late. The seemingly innocent mishap where your phone slides out of your hands and contacts with a surface, creating a spider-like hairlike crack across the glass screen, but rendering your phone still usable until [...]]]></description>
			<content:encoded><![CDATA[<p>After a few years of iPhone ownership I made the mistake that has become signature of clumsy Apple owners as of late. The seemingly innocent mishap where your phone slides out of your hands and contacts with a surface, creating a spider-like hairlike crack across the glass screen, but rendering your phone still usable until you poney up the benjamins to replace the screen. At the point that this happened my phone was already two years old, I was eligible for another contract extension, but I refused to sign my life away to the behemoth that is AT&amp;T for another two years. I got a <em>really</em> good deal on an Android phone, off contract, so I went down that route and for the first few months fought many battles that, I thought, were eventually won.</p>
<p>Most smart phones nowadays have battery problems. Even the brand new iPhone is plagued with issues regarding the battery life draining away that Apple is trying to solve with software patches. But I feel that because of the large differences in software stacks that are shipped with phones it is much harder for Google, and the device manufacturers, to solve these problems across the board. Every single Android device that I have ever seen has <em>some</em> kind of battery issue. Luckily this is solved quite well with the <a href="https://market.android.com/details?id=com.latedroid.juicedefender&amp;hl=en"><em>JuiceDefender</em> application</a> that is available from the market place.</p>
<p>Another issue that I&#8217;ve run into is that some of these standard, &#8220;best of the breed&#8221; Google applications, just plain old fucking suck. There are at least three different mapping applications that shipped with my phone that I can count. This may be a result of the bundled software that HTC installed, but from what I&#8217;ve been able to ascertain Google owns at least two of them. What the hell is the difference between <em>Locations</em> and <a href="https://market.android.com/details?id=com.google.android.apps.maps&amp;feature=search_result#?t=W251bGwsMSwxLDEsImNvbS5nb29nbGUuYW5kcm9pZC5hcHBzLm1hcHMiXQ.."><em>Maps</em></a>? I have never had an instance when I wanted a map where I did not want to find the fucking location of a business and get walking, subway or driving directions.</p>
<p>My phone came with a <a href="http://www.google.com/mobile/navigation/"><em>Navigation</em> application</a> that Google maintains. In my opinion this has to be the best navigation software that ships standard with a phone that I have ever seen. <em>When</em> it works it is much more accurate than any GPS navigation unit that I have ever owned. The turn by turn directions are almost aways spot on, and the features that come out of the box work as advertised. There <em>is</em> one catch. Often it can take five to ten minutes to pick up a signal with the GPS satellite, and by that time you&#8217;ve probably turned around several times because you lost your fucking way. Often rebooting the phone and launching the application again will solve this problem.</p>
<p>By far my largest complaint is the fact that Google can&#8217;t seem to hire proper employees that can actually design a framework to make these generic applications flow. It feels like the workflow of the applications were all thrown together without any foresight into the context of where I may have been before it launched. The speed of launching new applications is generally slower than the iPhone counterpart, and responsiveness of the system needs to be beefed up. My phone is by far not a slug, but why am I waiting for Google&#8217;s own applications to chug along, hang, and finally open up another application because the mapping application doesn&#8217;t actually incorporate the navigation software?</p>
<p>Google needs to work on the cohesiveness of the user experience across the whole system. The software is top notch. I love being able to synchronize my contacts, calendar, and e-mail between all of my Google services seamlessly. But I can&#8217;t turn a blind eye to the fact that someone over there doesn&#8217;t seem to understand that we <strong>need</strong> to have synergy between the workflow and the interface. The fact that this doesn&#8217;t exist and the software is plain old fucking slow is making me want to go back to Apple.</p>
<p>I purchased a screen replacement for my iPhone 3GS and plan on spending some time this week to bring it back to working order. I think my experiment with Android is done for now. You can release hundreds of phones a year with your software, get thousands of activations every day, but if you can&#8217;t make the software and the hardware work seamlessly what is the fucking point?</p>
]]></content:encoded>
			<wfw:commentRss>http://thoughtlessbanter.com/2012/01/29/why-android-pisses-me-off/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Got Code To Paste In A Haste?</title>
		<link>http://thoughtlessbanter.com/2011/11/30/got-code-to-paste-in-a-haste/</link>
		<comments>http://thoughtlessbanter.com/2011/11/30/got-code-to-paste-in-a-haste/#comments</comments>
		<pubDate>Wed, 30 Nov 2011 16:34:13 +0000</pubDate>
		<dc:creator>JB</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Haste]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://thoughtlessbanter.com/?p=862</guid>
		<description><![CDATA[A very close friend of mine released a new type of pastebin that has some very fancy features that really make it shine over any other interpretation on this type of idea. The client, which is written in Ruby and open source, is quickly installed through the use of the standard Ruby Gem installation approach. [...]]]></description>
			<content:encoded><![CDATA[<p>A <a href="http://twitter.com/seejohnrun">very close friend of mine</a> released a <a href="http://hastebin.com">new type of pastebin</a> that has some very fancy features that really make it shine over any other interpretation on this type of idea. The client, which is <a href="http://github.com/seejohnrun/haste-client">written in Ruby and open source</a>, is quickly installed through the use of the standard Ruby Gem installation approach. At this point you can immediately echo any code that you wish into the <em>haste</em> command on the terminal and it will be pushed up to a <a href="http://github.com/seejohnrun.com/haste-server">node.js powered backend</a> which stores it, syntax highlighted, and returns a URL back down to you.</p>
<p>The <a href="http://hastebin.com">web interface</a> is simplistic, yet beautifully crafted to allow for inline text editing right in your web browser. Shortcut commands exist to create a new piece of code, save one, and tweet it immediately. In a single day it has climbed among <a href="">the top spot on Hacker News</a>, and is already getting some very constructive feedback. The fact that both the server and the client are open source allow for internal implementations to be rolled out without any worry to proprietary code being leaked to the outside.</p>
<p>I know he&#8217;ll be reading this post so I&#8217;ll gripe a little, and give my wish list:</p>
<li>It&#8217;d be nice to allow for a quick shortcut for tab spacing. I work in C/C++ every day, and like to have a little bit more tab that you have there by default. <em>More tab please!</em></li>
<li>In the future when the Gist API becomes public it&#8217;d be really awesome to allow for forking, and pushing back up to your Gist.</li>
<li>An emacs plugin would be nice, but since I know <a href="http://twitter.com/seejohnrun</a>John</a> doesn&#8217;t use Emacs I&#8217;ll probably be writing one myself.</li>
<p>More information can be found <a href="http://www.hastebin.com/about.md">at the main site itself</a>, and of course, go download <a href="http://github.com/seejohnrun/haste-client">the client</a> and <a href="http://github.com/seejohnrun/haste-server">the server</a> and deploy it at your nine-to-five today!</p>
]]></content:encoded>
			<wfw:commentRss>http://thoughtlessbanter.com/2011/11/30/got-code-to-paste-in-a-haste/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Learning to Rock: Video Game Style</title>
		<link>http://thoughtlessbanter.com/2011/11/28/learning-to-rock-video-game-style/</link>
		<comments>http://thoughtlessbanter.com/2011/11/28/learning-to-rock-video-game-style/#comments</comments>
		<pubDate>Mon, 28 Nov 2011 16:30:03 +0000</pubDate>
		<dc:creator>JB</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[guitar]]></category>
		<category><![CDATA[ps3]]></category>
		<category><![CDATA[rocksmith]]></category>
		<category><![CDATA[video games]]></category>
		<category><![CDATA[xbox]]></category>

		<guid isPermaLink="false">http://thoughtlessbanter.com/?p=827</guid>
		<description><![CDATA[When I was younger I spent a year or so not-so-admirably trying to learn how to play the saxophone. Like many people at that ripe age there were many other things on our mind: playing with friends outside, video games, and basically anything other than the prescribed homework-esque music. I can&#8217;t remember actually ever understanding [...]]]></description>
			<content:encoded><![CDATA[<p>When I was younger I spent a year or so not-so-admirably trying to learn how to play the saxophone. Like many people at that ripe age there were many other things on our mind: playing with friends outside, video games, and basically anything other than the prescribed homework-esque music. I can&#8217;t remember actually ever understanding music, like most things in my life I think I probably guessed and slid through the class, but for some time I have always wanted to learn how to play music. I don&#8217;t want to study music, in fact, I hate looking at it. It hurts my brain much in the same way that mathematics does, but that does not mean that I lack respect for music (and mathematics, for that matter).</p>
<p>When I first touched <a href="http://www.amazon.com/gp/search/ref=as_li_qf_sp_sr_il_tl?ie=UTF8&#038;keywords=guitar%20hero&#038;tag=thoughbanter-20&#038;index=aps&#038;linkCode=as2&#038;camp=1789&#038;creative=9325">Guitar Hero</a> I thought it was very fun. My roommate and I spent hours upon hours staying up, not doing our class work, and battling each other with the game rifts. But it wasn&#8217;t like playing a real guitar. I&#8217;ve strummed my digits, fumbled with the frets, but was never able to spend the time to actually learn how to play. This is where <a href="http://www.amazon.com/gp/search/ref=as_li_qf_sp_sr_il_tl?ie=UTF8&#038;keywords=rocksmith&#038;tag=thoughbanter-20&#038;index=aps&#038;linkCode=as2&#038;camp=1789&#038;creative=9325">Rocksmith</a> enters the picture.</p>
<p><div id="attachment_831" class="wp-caption alignleft" style="width: 249px"><a href="http://thoughtlessbanter.com/wp-content/uploads/2011/11/guitar.jpg"><img src="http://thoughtlessbanter.com/wp-content/uploads/2011/11/guitar.jpg" alt="" title="Guitar" width="239" height="400" class="size-full wp-image-831" /></a><p class="wp-caption-text">My axe.</p></div>
<p>This past Thanksgiving I drove down to Virgina to spend it with an old friend. We headed out that night and checked out Best Buy in hopes to figure out if we wanted to spend our hard earned money on some Black Friday swag when we first ran across Rocksmith. If that store in Reston, VA wasn&#8217;t able to find an Xbox 360 controller I probably wouldn&#8217;t have taken the red pill. My buddy, Drew, has been a guitar player for years and he was quite impressed with the game. Rocksmith <em>is</em> what Guitar Hero <strong>should have been</strong>. You plug in your guitar to the console, and strum along to the song with the actual notes, thereby learning how to play the song on the guitar. It is genius. Futhermore, Rocksmith includes video tutorials, a digital amp, and downloadable content to keep you rocking along for perpetually.</p>
<p>The game tracks your progress and will dynamically make the songs harder when your skill level increases (or easier when it decreases). This means that you will always be challenged, but not enough to get discouraged and put the instrument down when you can&#8217;t feel that you accomplished something. Additional game modes allow you to master individual verses of the song, replay them at a slower speed, and even rock out to a friend that has purchased the game. Unfortunately, as far as we were able to tell, it does not include Xbox 360 (or Playstation Network) support for multiplayer, so your buddy has to actually come over to jam.</p>
<p>I&#8217;ve only been playing the game for a few days but I already know much, much more about playing the guitar than a did a few days ago. The obvious initial cost is a bit more steep than your normal video game if you don&#8217;t own a guitar, but there are two avenues you can go: <a href="http://www.amazon.com/gp/product/B0050SYWGU/ref=as_li_qf_sp_asin_il_tl?ie=UTF8&#038;tag=thoughbanter-20&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=B0050SYWGU">the bundle that includes a guitar</a> (<a href="http://www.amazon.com/gp/product/B005JQW4HM/ref=as_li_qf_sp_asin_il_tl?ie=UTF8&#038;tag=thoughbanter-20&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=B005JQW4HM">PS3</a>) [~$200]; <a href="http://www.amazon.com/gp/product/B004S5PBM0/ref=as_li_qf_sp_asin_il_tl?ie=UTF8&#038;tag=thoughbanter-20&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=B004S5PBM0">just the game if you already have your axe</a> (<a href="http://www.amazon.com/gp/product/B004S5TDL0/ref=as_li_qf_sp_asin_il_tl?ie=UTF8&#038;tag=thoughbanter-20&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=B004S5TDL0">PS3</a>).</p>
<p>Since Drew and I stumbled upon an awesome Gamestop sale on the game, we were able to get it for about $25 dollars off the retail price, which allowed me to save about $40 off the price of the bundle when I went to Guitar Center to buy the instrument. But obviously if you already have a guitar, or are able to purchase one second hand, it would still be cheaper just to get the game in the box. It should work with any six string guitar, and future downloadable content to the game promise a setting for bass rifts. This was my late birthday present to myself, and I&#8217;ve been enjoying it for a few days now. I hope you&#8217;re able to enjoy it, too!</p>
]]></content:encoded>
			<wfw:commentRss>http://thoughtlessbanter.com/2011/11/28/learning-to-rock-video-game-style/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Speeding Up With Apache With Nginx</title>
		<link>http://thoughtlessbanter.com/2011/11/27/speeding-up-apache-with-nginx/</link>
		<comments>http://thoughtlessbanter.com/2011/11/27/speeding-up-apache-with-nginx/#comments</comments>
		<pubDate>Mon, 28 Nov 2011 04:30:08 +0000</pubDate>
		<dc:creator>JB</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[Performance Tuning]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://thoughtlessbanter.com/?p=842</guid>
		<description><![CDATA[For the past year or so I have been using nginx as a proxy in front of my Apache instances on the server that runs this blog, and a few other websites that I manage. The virtual machine itself is running an older LTS version of Ubuntu, and most of the applications on here are [...]]]></description>
			<content:encoded><![CDATA[<p>For the past year or so I have been using <a href="http://nginx.org/">nginx</a> as a proxy in front of my <a href="http://httpd.apache.org/docs/2.0/">Apache</a> instances on the server that runs this blog, and a few other websites that I manage. The virtual machine itself is running an older LTS version of <a href="https://wiki.ubuntu.com/LTS">Ubuntu</a>, and most of the applications on here are a traditional <a href="http://en.wikipedia.org/wiki/LAMP_(software_bundle)">LAMP setup</a> with a few C/C++ testing tools scattered around. For the most part it is operating as web server with a small work load. But as I&#8217;ve been adding a few more services running in the background I have noticed a little slowdown with <a href="http://wordpress.org">WordPress</a>.</p>
<p>There are some obvious advantages to this set up: Nginx can serve up all of the static content very, very quickly without having to send it down to the Apache instances to process. This frees up those daemons to only serve application logic, which in this case is the WordPress PHP application, but would work for nearly anything that you have set up with it. I will give you a quick example of the configuration that I have set up for this site.</p>
<p>This is the main configuration file for the Nginx application. Most of the commands here I have plucked from various tutorials across the internet, specifically dealing with the gzip settings, and as you can see there are a few connection and process related settings. These can all be tweaked at your desire, but I find that they work best on my low load cloud virtual server. The information to note here is the location of the proxy server (127.0.0.1:8080) that the requests will be sent to, as well as some folders for errors, logs, etc. These are all standard with the Nginx installation from aptitude and should be modified to suite you. Note the section where we include any scripts that are in /etc/nginx/sites-enabled/* which is similar to the set up of the Apache portion of the LAMP stack.</p>
<p><strong>/etc/nginx/nginx.conf</strong></p>

<div class="wp_syntax"><div class="code"><pre class="xorg_conf" style="font-family:monospace;">user  op;
worker_processes  <span style="color: #cc66cc;">2</span>;
&nbsp;
error_log  logs/error.log warn;
<span style="color: #adadad; font-style: italic;">#error_log  logs/error.log  notice;</span>
<span style="color: #adadad; font-style: italic;">#error_log  logs/error.log  info;</span>
&nbsp;
pid        logs/nginx.pid;
&nbsp;
events <span class="br0">&#123;</span>
    worker_connections  <span style="color: #cc66cc;">1024</span>;
<span class="br0">&#125;</span>
&nbsp;
http <span class="br0">&#123;</span>
    include       mime.types;
    default_type  application/octet-stream;
&nbsp;
    log_format  main  '$remote_addr - $remote_user <span class="br0">&#91;</span>$time_local<span class="br0">&#93;</span> <span style="color: #0000ff;">&quot;$request&quot;</span> '
                      '$status $body_bytes_sent <span style="color: #0000ff;">&quot;$http_referer&quot;</span> '
                      '<span style="color: #0000ff;">&quot;$http_user_agent&quot;</span> <span style="color: #0000ff;">&quot;$http_x_forwarded_for&quot;</span>';
&nbsp;
    access_log  logs/access.log  main;
&nbsp;
    gzip on;
    gzip_http_version <span style="color: #cc66cc;">1.0</span>;
    gzip_comp_level <span style="color: #cc66cc;">2</span>;
    gzip_min_length <span style="color: #cc66cc;">1100</span>;
    gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
    gzip_buffers <span style="color: #cc66cc;">16</span> 8k;
    gzip_disable <span style="color: #0000ff;">&quot;MSIE [1-6].(?!.*SV1)&quot;</span>;
    gzip_vary on;
&nbsp;
    include /etc/nginx/sites-enabled/*;
&nbsp;
    server <span class="br0">&#123;</span>
        listen       <span style="color: #cc66cc;">80</span> default;
        access_log  logs/host.access.log  main;
&nbsp;
        error_page   <span style="color: #cc66cc;">500</span> <span style="color: #cc66cc;">502</span> <span style="color: #cc66cc;">503</span> <span style="color: #cc66cc;">504</span>  /50x.html;
        location = /50x.html <span class="br0">&#123;</span>
            root   html;
        <span class="br0">&#125;</span>
&nbsp;
        location / <span class="br0">&#123;</span>
                 include /etc/nginx/proxy.conf;
                 proxy_pass http://127.0.0.1:<span style="color: #cc66cc;">8080</span>;
        <span class="br0">&#125;</span>
    <span class="br0">&#125;</span>
<span class="br0">&#125;</span></pre></div></div>

</p>
<p>This configuration file sets up the particular domain inside of the Nginx proxy. It covers both the fully qualified domain name and the alias, and provides the root directory for serving up the static content. If there is content that you do not want to be served up (e.g. you have a public folder) make sure to point this only to your assets directory. We set up the path for logs to be written to (you&#8217;ll have to <em>mkdir -p</em> those directories) as well. The real gem here is the regular expression that specifies what static content will not get fielded off to the apache daemons. Obviously you can make any corrections here that you see fit. When you are done set up a symbolic link in /etc/nginx/sites-enabled/<site>.</p>
<p><strong>/etc/nginx/sites-available/thoughtlessbanter.com</strong></p>

<div class="wp_syntax"><div class="code"><pre class="xorg_conf" style="font-family:monospace;">server <span class="br0">&#123;</span>
 server_name www.thoughtlessbanter.com thoughtlessbanter.com;
 root /path/to/thoughtlessbanter.com/;
&nbsp;
 access_log /var/log/nginx/thoughtlessbanter.com/access.log;
 error_log /var/log/nginx/thoughtlessbanter.com/error.log warn;
&nbsp;
 location ~* ^.+.<span class="br0">&#40;</span>jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js<span class="br0">&#41;</span>$ <span class="br0">&#123;</span>
              access_log off;
              expires 30d;
 <span class="br0">&#125;</span>
&nbsp;
 location / <span class="br0">&#123;</span>
              include /etc/nginx/proxy.conf;
              proxy_pass http://127.0.0.1:<span style="color: #cc66cc;">8080</span>;
 <span class="br0">&#125;</span>
<span class="br0">&#125;</span></pre></div></div>

</p>
<p>This little tidbit is necessary to send over the header information from the HTTP client to the Apache daemon. These proxy settings, with this configuration set up, will affect <em>every single web request</em>, so be careful with what you modify here. There are additional parameters involving the maximum size of a payload, send, connect, and read timeouts, etc. These can all be looked up with <a href="http://wiki.nginx.org/HttpProxyModule">a quick Google search</a> and modified freely.</p>
<p><strong>/etc/nginx/proxy.conf</strong></p>

<div class="wp_syntax"><div class="code"><pre class="xorg_conf" style="font-family:monospace;">proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;</pre></div></div>

</p>
<p>Last you&#8217;ll need to modify your virtual host for all of the websites to now accept the connection on the new port, 8080, which is were Nginx will proxy the requests to. Be sure to set the server alias for both the fully qualified domain, and the shortened one. I am not an Apache configuration guru here, so some of the other options may not be applicable, but they seem to do the job for me. Most of my domains are further configured appropriately in the .htaccess in the document root directory.</p>
<p><strong>/etc/apache2/sites-available/thoughtlessbanter.com</strong></p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;VirtualHost</span> *:8080<span style="color: #000000; font-weight: bold;">&gt;</span></span>
              ServerAdmin jb@thunkbrightly.com
              ServerName thoughtlessbanter.com
              ServerAlias www.thoughtlessbanter.com
              DocumentRoot /path/to/thoughtlessbanter.com
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Directory</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
               Options FollowSymLinks
               AllowOverride All
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Directory<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Directory</span> /path/to/thoughtlessbanter.com<span style="color: #000000; font-weight: bold;">&gt;</span></span>
               Options Indexes FollowSymLinks MultiViews
               AllowOverride All
               Order allow,deny
               allow from all
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Directory<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
              ErrorLog /var/log/apache2/thoughtlessbanter.com-error.log
              CustomLog /var/log/apache2/access.log combined
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/VirtualHost<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

</p>
<p>When you have made all of the changes feel free to restart the services and test your website. Once all the instances are bounced you should be able to point the browser to the location and still bring up your website. If you check the logs located in /var/log/nginx/<site> and /var/log/apache2/<site>.log you should be able to see your static content requests hitting nginx, and being served up right from there. The apache daemons will now only serve the application logic.</p>
<p>Let me know what you think. I&#8217;m sure I&#8217;ve made a few mistakes.</p>
]]></content:encoded>
			<wfw:commentRss>http://thoughtlessbanter.com/2011/11/27/speeding-up-apache-with-nginx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Object Caching 538/648 objects using memcached

Served from: thoughtlessbanter.com @ 2012-05-19 16:37:21 -->
