<?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>seeparsan.net</title>
	<atom:link href="http://seeparsan.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://seeparsan.net</link>
	<description>Talesh Seeparsan : A Magento Consultant located in Toronto, Ontario</description>
	<lastBuildDate>Fri, 01 Apr 2011 03:30:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Switching your Magento development environment from Apache to nginx</title>
		<link>http://seeparsan.net/2011/03/switching-your-magento-development-environment-from-apache-to-nginx/</link>
		<comments>http://seeparsan.net/2011/03/switching-your-magento-development-environment-from-apache-to-nginx/#comments</comments>
		<pubDate>Sat, 05 Mar 2011 21:01:38 +0000</pubDate>
		<dc:creator>Talesh</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[deploy]]></category>

		<guid isPermaLink="false">http://seeparsan.net/?p=116</guid>
		<description><![CDATA[While at the Magento Imagine conference a couple weeks ago I learned that the entire Magento site and its demo sites all run on nginx instead of Apache. I was...]]></description>
			<content:encoded><![CDATA[<p>While at the Magento Imagine conference a couple weeks ago I learned that the entire Magento site and its demo sites all run on nginx instead of Apache. I was aware of that several alternatives to Apache existed and served various niches especially when it comes to delivering static HTML files at speed, however never really investigated them properly. Zeus and lighttpd were always just a blur on the horizon.</p>
<p>Seeing that I was consuming lots of information about node.js in the last couple weeks, I unavoidable came across<a href="http://jjinux.blogspot.com/2010/11/javascript-second-impression-of-nodejs.html" target="_blank"> infamous claim that node.js</a> was <a href="http://www.yuiblog.com/blog/2010/05/20/video-dahl/" target="_blank">faster than nginx by Ryan Dahl </a>the author of node.js. Seeing that I was completely out of the loop as to how important this is, I investigated nginx a little more and realized that it was indeed a formidable server after PHP-FPM and APC were installed. I took a couple weeks, running tests off and on trying to see how much of an advantage there was to using nginx, PHP_FPM and APC. Given that now I have an awesome fast dev rig, the speed for the client showed little change in my tests even running something like Magento. But I found a difference when I started putting the servers on virtual machines via Virtual Box with limited specs (as close as possible to the t1.mirco AMI Amazon has so kindly offered me for one year) Wanting to play with new technologies, I stopped after three tests and decided that I was on board with nginx, especially since it was adopted by WordPress and Magento.</p>
<p><a href="http://seeparsan.net/wp-content/uploads/2011/03/nginx-logo.png"><img class="alignright size-full wp-image-146" title="nginx-logo" src="http://seeparsan.net/wp-content/uploads/2011/03/nginx-logo.png" alt="" width="350" height="90" /></a></p>
<p>I intend to do some more rigorous testing and <a href="http://nginx.org/en/security_advisories.html" target="_blank">security analysis</a> before launching a production site on this combo because making the move from Apache is a huge step. But first steps were getting my local versions of Magento Community Edition 1.4.2.0 and 1.5.0.1 running on nginx. Yes I know I mentioned earlier that nginx made little difference when running on a brand new dev rig so why am I doing this? I firmly believe in building your software against as close as possible technology stack as your final deployment. When I worked as the Solution Architect on the <a href="http://seagate.paramountshop.com/" target="_blank">Paramount Pictures/Seagate online store</a>, all the offshore developers were building Magento stores on Windows. We had nightmares when it came to weekly deploys yet I couldn’t change the policy of an organization half way around the world. So just to be safe, if I am going to deploy onto nginx, I am going to code on an nginx server.</p>
<p>I usually have multiple virtual hosts running on my dev rig to manage development of extensions against multiple versions of Magento. There is also a custom build and deployment system in the back there holding everything together with <em>git</em>, but that is another post. The instructions below are only really intended to move a Ubuntu 10.10 development machine to nginx away from Apache. I would advice against blindly copy-pasting what you see here into your production machine. It will probably work but I am not responsible if anything breaks.</p>
<p>First step is to shutdown Apache</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> service apache2 stop</div></div>
<p>I usually try to remove all the unused packages from my system if I am not going to use them. That is why my build/deploy system is built on shell scripts as opposed to anything fancy like Capistrano, Maven etc. So the next step is removing Apache from your system. I resorted to Synaptic package manager for this because a simple <code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get remove</span> apache2</span></code> didn’t remove all the packages. Here is a list of all packages I ended up removing.</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">aptitude</span> remove apache2 apache2.2-common apache2.2-bin apache2-utils apache2-mpm-prefork libapache-mod-php5</div></div>
<p>At this point Synaptic package manager insisted that I install the <code class="codecolorer bash default"><span class="bash">php5-cgi</span></code> package so I just went along with it assuming that I will be able to remove it later on, but also aware that PHP-FPM works with PHP in a CGI context so I left it alone.</p>
<p>That should take care of Apache.  The next step is to install nginx and start it up</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> nginx</div></div>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> service nginx start</div></div>
<p>At this point nginx should have gone to your <code class="codecolorer bash default"><span class="bash"><span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www</span></code> folder and carefully dropped in a folder called <code class="codecolorer bash default"><span class="bash">nginx-default</span></code> in there to not disturb your existing <code class="codecolorer bash default"><span class="bash">default</span></code> folder if there is one. Absentmindedly it then forgets where it put its own docroot and points is default docroot to <code class="codecolorer bash default"><span class="bash"><span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www</span></code> so when you hit your localhost in a browser, you see the default nginx 404 error page. You can drop in an index.html into <code class="codecolorer bash default"><span class="bash"><span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www</span></code> to see what nginx will do.</p>
<p>The next step is install PHP-FPM which is a bunch of binaries that attach to PHP and run a service on your localhost on port 9000. Basically nginx queries this service for the PHP compiled data to send to the browser.</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> php5-fpm</div></div>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> service php5-fpm start</div></div>
<p>If you are getting “<code class="codecolorer bash default"><span class="bash"><span style="color: #7a0874; font-weight: bold;">&#91;</span>WARNING<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>pool www<span style="color: #7a0874; font-weight: bold;">&#93;</span> pm.start_servers is not <span style="color: #000000; font-weight: bold;">set</span></span></code>” and you are OCD you can set the value in <code class="codecolorer bash default"><span class="bash"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>php<span style="color: #000000; font-weight: bold;">/</span>fpm<span style="color: #000000; font-weight: bold;">/</span>pool.d<span style="color: #000000; font-weight: bold;">/</span>www.conf</span></code> on line 73.</p>
<p>APC is a PHP opcode cache that can cache the interpreted PHP script and even variables. From my testing it provided almost negligible change on a dev machine but it may run on a public server so again I installed it here. Should there be cache refresh issues we will catch it in development as opposed to launch. Zend has <a href="http://devzone.zend.com/article/12618" target="_blank">a good starter article on APC</a> if you want to learn more.</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> php-apc</div></div>
<p>Php should be up and running but we haven’t told nginx about it yet. There are configurations for doing so which you can get from<a href="http://www.howtoforge.com/installing-nginx-with-php5-and-php-fpm-and-mysql-support-on-ubuntu-10.10" target="_blank"> this How To Forge tutorial</a>, but we are not going down that path today. We are going to set up two virtual hosts which point to two installs of Magento CE 1.4.2.0 and 1.5.0.1. So I am going to make two new files in <code class="codecolorer bash default"><span class="bash"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>sites-available<span style="color: #000000; font-weight: bold;">/</span></span></code> , one called local1420 and the other called local1501 . Here I switch over to the wisdom of the<a href="http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/configuring_nginx_for_magento" target="_blank"> Magento Wiki page on nginx with a configuration</a> for the <code class="codecolorer bash default"><span class="bash">nginx.conf</span></code> and the individual site configurations.</p>
<p>I have found that the <code class="codecolorer bash default"><span class="bash">nginx.conf</span></code> setting works fine, but I had to tweak the individual site configs to work properly. When I have confirmed with someone smarter than me that I am doing it as right as possible I will probably modify the Magento Wiki to reflect the changes I made. For now I will post my file here so you can compare.</p>
<p>The major changes I made was a result of wanting to avoid http://www.local1420.com and just sticking with http://local1420.com so I removed lines 4–10 of the Magento suggested configurations. Beyond that I was not using HTTPS on my local dev machine, so I commented out <code class="codecolorer ruby default"><span class="ruby">fastcgi_param  HTTPS <span style="color:#ff6633; font-weight:bold;">$fastcgi_https</span>;</span></code>. Also seeing that I was not developing against a multistore environment, I commented out <code class="codecolorer ruby default"><span class="ruby">fastcgi_param  MAGE_RUN_CODE default;</span></code> and <code class="codecolorer ruby default"><span class="ruby">fastcgi_param  MAGE_RUN_TYPE store;</span></code>. The last change I made was to include <code class="codecolorer bash default"><span class="bash"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>drop.conf</span></code> which I will describe at the end of the article.</p>
<div class="codecolorer-container ruby default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br /></div></td><td><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">server <span style="color:#006600; font-weight:bold;">{</span><br />
listen <span style="color:#006666;">80</span>;<br />
server_name local1501.<span style="color:#9900CC;">com</span>;<br />
root <span style="color:#006600; font-weight:bold;">/</span>var<span style="color:#006600; font-weight:bold;">/</span>www<span style="color:#006600; font-weight:bold;">/</span>local1501.<span style="color:#9900CC;">com</span>;<br />
<br />
location <span style="color:#006600; font-weight:bold;">/</span> <span style="color:#006600; font-weight:bold;">{</span><br />
index index.<span style="color:#9900CC;">html</span> index.<span style="color:#9900CC;">php</span>; <span style="color:#008000; font-style:italic;">## Allow a static html file to be shown first</span><br />
try_files <span style="color:#ff6633; font-weight:bold;">$uri</span> <span style="color:#ff6633; font-weight:bold;">$uri</span><span style="color:#006600; font-weight:bold;">/</span> <span style="color:#0066ff; font-weight:bold;">@handler</span>; <span style="color:#008000; font-style:italic;">## If missing pass the URI to Magento’s front handler</span><br />
expires 30d; <span style="color:#008000; font-style:italic;">## Assume all files are cachable</span><br />
<span style="color:#006600; font-weight:bold;">}</span><br />
<br />
<span style="color:#008000; font-style:italic;">## These locations would be hidden by .htaccess normally</span><br />
location <span style="color:#006600; font-weight:bold;">/</span>app<span style="color:#006600; font-weight:bold;">/</span>                <span style="color:#006600; font-weight:bold;">{</span> deny all; <span style="color:#006600; font-weight:bold;">}</span><br />
location <span style="color:#006600; font-weight:bold;">/</span>includes<span style="color:#006600; font-weight:bold;">/</span>           <span style="color:#006600; font-weight:bold;">{</span> deny all; <span style="color:#006600; font-weight:bold;">}</span><br />
location <span style="color:#006600; font-weight:bold;">/</span>lib<span style="color:#006600; font-weight:bold;">/</span>                <span style="color:#006600; font-weight:bold;">{</span> deny all; <span style="color:#006600; font-weight:bold;">}</span><br />
location <span style="color:#006600; font-weight:bold;">/</span>media<span style="color:#006600; font-weight:bold;">/</span>downloadable<span style="color:#006600; font-weight:bold;">/</span> <span style="color:#006600; font-weight:bold;">{</span> deny all; <span style="color:#006600; font-weight:bold;">}</span><br />
location <span style="color:#006600; font-weight:bold;">/</span>pkginfo<span style="color:#006600; font-weight:bold;">/</span>            <span style="color:#006600; font-weight:bold;">{</span> deny all; <span style="color:#006600; font-weight:bold;">}</span><br />
location <span style="color:#006600; font-weight:bold;">/</span>report<span style="color:#006600; font-weight:bold;">/</span>config.<span style="color:#9900CC;">xml</span>   <span style="color:#006600; font-weight:bold;">{</span> deny all; <span style="color:#006600; font-weight:bold;">}</span><br />
location <span style="color:#006600; font-weight:bold;">/</span>var<span style="color:#006600; font-weight:bold;">/</span>                <span style="color:#006600; font-weight:bold;">{</span> deny all; <span style="color:#006600; font-weight:bold;">}</span><br />
<br />
location <span style="color:#006600; font-weight:bold;">/</span>var<span style="color:#006600; font-weight:bold;">/</span>export<span style="color:#006600; font-weight:bold;">/</span> <span style="color:#006600; font-weight:bold;">{</span> <span style="color:#008000; font-style:italic;">## Allow admins only to view export folder</span><br />
auth_basic           <span style="color:#996600;">“Restricted”</span>; <span style="color:#008000; font-style:italic;">## Message shown in login window</span><br />
auth_basic_user_file htpasswd; <span style="color:#008000; font-style:italic;">## See /etc/nginx/htpassword</span><br />
autoindex            on;<br />
<span style="color:#006600; font-weight:bold;">}</span><br />
<br />
location  <span style="color:#006600; font-weight:bold;">/</span>. <span style="color:#006600; font-weight:bold;">{</span> <span style="color:#008000; font-style:italic;">## Disable .htaccess and other hidden files</span><br />
<span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#006666;">404</span>;<br />
<span style="color:#006600; font-weight:bold;">}</span><br />
<br />
location <span style="color:#0066ff; font-weight:bold;">@handler</span> <span style="color:#006600; font-weight:bold;">{</span> <span style="color:#008000; font-style:italic;">## Magento uses a common front handler</span><br />
rewrite <span style="color:#006600; font-weight:bold;">/</span> <span style="color:#006600; font-weight:bold;">/</span>index.<span style="color:#9900CC;">php</span>;<br />
<span style="color:#006600; font-weight:bold;">}</span><br />
<br />
location ~ .<span style="color:#9900CC;">php</span><span style="color:#006600; font-weight:bold;">/</span> <span style="color:#006600; font-weight:bold;">{</span> <span style="color:#008000; font-style:italic;">## Forward paths like /js/index.php/x.js to relevant handler</span><br />
rewrite ^<span style="color:#006600; font-weight:bold;">(</span>.<span style="color:#006600; font-weight:bold;">*</span>.<span style="color:#9900CC;">php</span><span style="color:#006600; font-weight:bold;">)</span><span style="color:#006600; font-weight:bold;">/</span> $1 last;<br />
<span style="color:#006600; font-weight:bold;">}</span><br />
<br />
location ~ .<span style="color:#9900CC;">php</span>$ <span style="color:#006600; font-weight:bold;">{</span> <span style="color:#008000; font-style:italic;">## Execute PHP scripts</span><br />
<span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#006600; font-weight:bold;">(</span>!<span style="color:#006600; font-weight:bold;">-</span>e <span style="color:#ff6633; font-weight:bold;">$request_filename</span><span style="color:#006600; font-weight:bold;">)</span> <span style="color:#006600; font-weight:bold;">{</span> rewrite <span style="color:#006600; font-weight:bold;">/</span> <span style="color:#006600; font-weight:bold;">/</span>index.<span style="color:#9900CC;">php</span> last; <span style="color:#006600; font-weight:bold;">}</span> <span style="color:#008000; font-style:italic;">## Catch 404s that try_files miss</span><br />
expires        off; <span style="color:#008000; font-style:italic;">## Do not cache dynamic content</span><br />
<br />
fastcgi_pass   127.0.0.1:<span style="color:#006666;">9000</span>;<br />
<span style="color:#008000; font-style:italic;">#       fastcgi_param  HTTPS $fastcgi_https;</span><br />
fastcgi_param  SCRIPT_FILENAME  <span style="color:#ff6633; font-weight:bold;">$document_root</span>$fastcgi_script_name;<br />
<span style="color:#008000; font-style:italic;">#       fastcgi_param  MAGE_RUN_CODE default; ## Store code is defined in administration &amp;gt; Configuration &amp;gt; Manage  Stores</span><br />
<span style="color:#008000; font-style:italic;">#       fastcgi_param  MAGE_RUN_TYPE store;</span><br />
<span style="color:#9966CC; font-weight:bold;">include</span>        fastcgi_params; <span style="color:#008000; font-style:italic;">## See /etc/nginx/fastcgi_params</span><br />
<span style="color:#006600; font-weight:bold;">}</span><br />
<span style="color:#9966CC; font-weight:bold;">include</span> drop.<span style="color:#9900CC;">conf</span>;<br />
<span style="color:#006600; font-weight:bold;">}</span></div></td></tr></tbody></table></div>
<p>The last bit of configuration I added was advised by Karl Bessing  Basically it involves creating a short file in <code class="codecolorer bash default"><span class="bash"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span></span></code> called <code class="codecolorer bash default"><span class="bash">drop.conf</span></code> with the following code and including it in the server section of your virtual hosts. You can read more about what it does <a href="http://kbeezie.com/view/apache-to-nginx/" target="_blank">on his site.</a></p>
<div class="codecolorer-container ruby default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">location = <span style="color:#006600; font-weight:bold;">/</span>favicon.<span style="color:#9900CC;">ico</span> <span style="color:#006600; font-weight:bold;">{</span> access_log off; log_not_found off; <span style="color:#006600; font-weight:bold;">}</span><br />
location = <span style="color:#006600; font-weight:bold;">/</span>robots.<span style="color:#9900CC;">txt</span> <span style="color:#006600; font-weight:bold;">{</span> access_log off; log_not_found off; <span style="color:#006600; font-weight:bold;">}</span><br />
location ~ <span style="color:#006600; font-weight:bold;">/</span>\. <span style="color:#006600; font-weight:bold;">{</span> deny  all; access_log off; log_not_found off; <span style="color:#006600; font-weight:bold;">}</span></div></td></tr></tbody></table></div>
<p>And with that you should have all your configuration files all ready. Next step is to link in your available sites to your enabled sites. Usually you would use <code class="codecolorer bash default"><span class="bash">a2ensite</span></code> for something like this in Apache, but I was unaware if anything similar existed for nginx, so I just linked them in manually.</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">–s</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>sites-available<span style="color: #000000; font-weight: bold;">/</span>local1420 <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>sites-enabled<span style="color: #000000; font-weight: bold;">/</span>local1420</div></div>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">–s</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>sites-available<span style="color: #000000; font-weight: bold;">/</span>local1501 <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>sites-enabled<span style="color: #000000; font-weight: bold;">/</span>local1501</div></div>
<p>Restart nginx and php5-fpm and you are done.</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> service nginx restart</div></div>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> service php5-fpm restart</div></div>
<p>If you are installing Magento from scratch you can check the box displayed during setup labelled “Web server Apache rewrites”, because it works just fine. If you have any questions or improvements, feel free to leave a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://seeparsan.net/2011/03/switching-your-magento-development-environment-from-apache-to-nginx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript Master Class</title>
		<link>http://seeparsan.net/2011/03/javascript-master-class/</link>
		<comments>http://seeparsan.net/2011/03/javascript-master-class/#comments</comments>
		<pubDate>Sat, 05 Mar 2011 02:59:57 +0000</pubDate>
		<dc:creator>Talesh</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Learning]]></category>
		<category><![CDATA[Douglas Crockford]]></category>
		<category><![CDATA[Reading suggestions]]></category>

		<guid isPermaLink="false">http://seeparsan.net/?p=62</guid>
		<description><![CDATA[I have read Javascript: The Good Parts* cover to cover multiple times. ( Well OK lately, its been BOF to EOF on my iPad ) When someone is as resolute...]]></description>
			<content:encoded><![CDATA[<p>I have read<a href="http://www.amazon.com/exec/obidos/ASIN/0596517742/wrrrldwideweb" target="_blank"> Javascript: The Good Parts</a>* cover to cover multiple times. ( Well OK lately, its been BOF to EOF on my iPad ) When someone is as resolute and pragmatic as <a href="http://www.crockford.com/" target="_blank">Douglas Crockford</a> is to a technology as widely misunderstood and reviled as Javascript, human beings take notice. I believe it is inherent in our evolution to take notice at those who are that <a href="http://javascript.crockford.com/javascript.html" target="_blank">tenacious without being bullheaded</a>.</p>
<p>Since I was learning node.js during my two month work hiatus, I thought it would be a good time to brush up on <a href="http://javascript.crockford.com/style2.html" target="_blank">good Javascript style</a> and eventually I started poking around his book once more, and lo, I found out that Safari Books Online** had the entirety of his<a href="http://oreilly.com/catalog/9780596809614" target="_blank"> Javascript Master Class available for streaming</a>. Starting out a 5+ hour tutorial at almost midnight would not count as one of the smartest things I have done in my life, but it was worth it. Unfortunately I had just gotten past my second wind when he hit Pseudoclassical Inheritance in Javascript. By far that is one of the most convoluted processes I have ever had the pleasure to try grokking at 2am. I have had nightmares for weeks because I called it quits for the night at that point.</p>
<p>In all honesty, the videos are phenomenal. If you are even considering being part of the future of web application development I suggest you look at the videos. Think of it like this, if someone can preface their highly detailed and technical talk about Javascript by starting with the technology of puchcards, then that person is an Alpha in his field and you should listen to him when he speaks. I was completely taken in from the first video. Reading his book on the subject matter and listening to him speak about it are two completely different things. Also I believe he goes into a little more detail in the videos.</p>
<div id="attachment_66" class="wp-caption alignright" style="width: 310px"><a href="http://en.wikipedia.org/wiki/The_Mother_of_All_Demos"><img class="size-medium wp-image-66  " title="The Mother of all Demos" src="http://seeparsan.net/wp-content/uploads/2011/03/Engelbart-Demo-Intro-9Dec68-300x205.jpg" alt="" width="300" height="205" /></a><p class="wp-caption-text">Another Douglas, Douglas Engelbart</p></div>
<p style="text-align: left;">Many parts of the videos I have returned to, and reviewed to make sure I absorbed all the details, but that one section about Pseudoclassical Inheritance I recoil in horror everytime I think about trying to understand it. I still have a bunch of notes of things to look into, they are mostly little sparks that lit up in my head while I was learning things about Javascript I still need to try. (One of which, was <a href="http://en.wikipedia.org/wiki/The_Mother_of_All_Demos" target="_blank">“The mother of all demos” by Douglas Engelbart</a> which I am embarrassed to admit I have not looked at yet)</p>
<p style="text-align: left;">Having knowledge of the history of technology I believe is a very healthy practice. Especially with the headlong rush we technologists have found ourselves in, there is always something stirring in me to step back and look at the big picture. I believe that by studying where we have tread to get where we are technologically gives you a better understanding and appreciation for the shortcoming and awesomeness of technology today. But I think critically it gives you an opportunity to cut through the stampede of developers and find new ways to direct technology in the future. That I believe is one of Mr. Crockford’s strengths.</p>
<p><em>*Disclaimer: The Amazon referral code (if there is one here) is Mr. Crockfords. I make nothing if you click on that link.<br />
** I am still angry at Safari Books Online after their stupid iPad app fiasco, so no link for them. Half-assed software development is a cardinal sin in my eyes. I will rant about this later.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://seeparsan.net/2011/03/javascript-master-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Winter downtime</title>
		<link>http://seeparsan.net/2011/03/winter-downtime/</link>
		<comments>http://seeparsan.net/2011/03/winter-downtime/#comments</comments>
		<pubDate>Sat, 05 Mar 2011 00:42:47 +0000</pubDate>
		<dc:creator>Talesh</dc:creator>
				<category><![CDATA[Consulting]]></category>

		<guid isPermaLink="false">http://seeparsan.net/?p=48</guid>
		<description><![CDATA[Part of being a full time software consultant is dealing with the downtime. When you specialize in such a specific niche as I do, you are bound to have spells...]]></description>
			<content:encoded><![CDATA[<p>Part of being a full time software consultant is dealing with the downtime. When you specialize in such a specific niche as I do, you are bound to have spells where there is nothing really to do except market yourself. Despite this being a full time consultant gives you the power to approach what Nigel Marsh was seeking in his <a href="http://www.youtube.com/watch?v=jdpIKXLLYYM">Work — Life balance TED talk</a>. Luckily for the last few years my downtimes have been aligning pretty closely to the worst winter months here (January and February) so I have been spared commuting during blizzards for two years in a row. I ramp up on a pretty exciting project on Monday so I guess today is officially the end of my winter downtime.</p>
<p style="text-align: center;"><img class="aligncenter size-large wp-image-58" title="1327810_15462736" src="http://seeparsan.net/wp-content/uploads/2011/03/1327810_15462736-1024x711.jpg" alt="" width="558" height="387" /></p>
<p>The key I have found to surviving downtime is “catching up”. There are millions of things that one needs to catch up on especially when it comes to technology. There is the boring catching up, like finally setting up my blog and using this domain for something more than a <a href="http://en.wikipedia.org/wiki/Mx_record" target="_blank">MX record</a>, but still its an achievement to finally have something here again after all these years. But the fun parts of catching up are awesome. Finally my personal Wiki is now up to date as my development toolkit. All the tools, wisdom and information I gathered in working on two huge e-commerce sites in 2010 (<a href="http://www.virginmobile.ca/en/home/index.html" target="_blank">virginmobile.ca</a> and <a href="http://www.west49.com/" target="_blank">west49.com</a>) are all documented and safe from my unreliable memory.</p>
<p>But the real joy comes in getting an opportunity for unbridled experimentation with new technologies. Its the joy of <a href="http://blog.garlicsim.org/post/1495459004/technology-principle-the-toy-will-win" target="_blank">making toys.</a> In this two weeks, I have finally had a chance to get<a href="http://nodejs.org/" target="_blank"> node.js </a>running and start learning all that is it about. For some reason server side Javascript is very exciting to me. Javascript is as amazing as it is flawed. Given that I stuck with PHP all through the Python and Ruby waves in the last decade or so, I haven’t ever had a chance to experiment with the new server technology on the scene. This time it is different. Now I am already very familiar with the language itself and already love it. I just have to see what I can do with it on the server side. Tons of little ideas are brewing in my head.</p>
<p>What I haven’t gotten to in the last two months includes starting to play with <a href="http://www.google.ca/search?q=arduino" target="_blank">Arduino</a>. I really want to start tinkering with Arduino in my spare time. The simple bridge between the virtual world of software and the physical world of matter is very very tempting. Also next on the list of things to look into is Erlang, but less so. A language that has such robustness built into is very intriguing.  But it will probably have to wait until I am done experimenting with node.js and CouchDB.</p>
<p>All in all a very productive winter downtime.</p>
]]></content:encoded>
			<wfw:commentRss>http://seeparsan.net/2011/03/winter-downtime/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My (Dramatized) return to Linux</title>
		<link>http://seeparsan.net/2011/03/returning-to-linux/</link>
		<comments>http://seeparsan.net/2011/03/returning-to-linux/#comments</comments>
		<pubDate>Wed, 02 Mar 2011 04:57:32 +0000</pubDate>
		<dc:creator>Talesh</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Rant]]></category>
		<category><![CDATA[SGI]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Waterloo]]></category>

		<guid isPermaLink="false">http://seeparsan.net/?p=81</guid>
		<description><![CDATA[*nix has always been my operating system of choice. It really was what I started computing on at the University of Waterloo and consequently has left a lasting impression on...]]></description>
			<content:encoded><![CDATA[<div id="attachment_82" class="wp-caption alignright" style="width: 160px"><img class="size-thumbnail wp-image-82" title="indy-r5000-01" src="http://seeparsan.net/wp-content/uploads/2011/03/indy-r5000-01-150x150.jpg" alt="" width="150" height="150" /><p class="wp-caption-text">5000 blazing MIPS</p></div>
<p>*nix has always been my operating system of choice. It really was what I started computing on at the University of Waterloo and consequently has left a lasting impression on me. I am not sure if they still do it now, but I know when I started at Computer Science one of the myriad information sheets you get as a frosh in the Department of Mathematics was a list of commands for editing in <em>vi</em>. Those sheets even had the splotches on them that early ink based duplicating machines left. Sometimes I wonder how many years back those sheets date.</p>
<p>I remember the 100 level courses were all done on Windows computers with Java, but what was an eager bright eyed young Trinidadian to do in a new country and in a new school but sit down at a UNIX terminal and try to figure it out? It has been love since then. The first computer I ever purchased was an SGI Indy R5000 which I got on a insane deal used from the school newspaper where I worked. Early on I realized that if I wanted to do the “other-computer-things” that didn’t involve programming but were necessary to interacting with other people, I would need an operating system that was a little more compatible with Windows. So I bide my time until “BSD” came to Apple hardware (yup we called Mac OS X a BSD clone back then), and after working three jobs one summer bought myself a shiny little iBook (which still runs to this day).</p>
<p>Nostalgia and reliability aside, I only actually came to Apple for the modern OS that ran on a UNIX. I always ran my laptop alongside a UNIX machine, and eventually alongside a Linux machine. By and by eventually I started dabbling with digital media, and eventually print publishing of all things for a software developer to dabble in (remember I worked at the school newspaper). This capitulated my move completely to Mac OS X, a move that I eventually became comfortable with, despite its initial unsettling feelings. In the intervening 5–6 years, I did dark things. Primary among them was compromising my own core beliefs by pirating commercial software* to run on my Macs.</p>
<p>But eventually it became too much when I began seeing the piracy all around me capitulate to coworkers stealing very cheap designs from the internet to print. It reflected my own dirty perception of my own software piracy and I broke. Long grave emails were written about piracy and summarily ignored. I did some serious soul searching on the subject and realized I was wrong to go against my very own core beliefs and an the internal rebellion started. Epic instrumental music may have even been playing in the background while I did said soul searching. I am not really sure, it is all a montage to me.</p>
<p>I usually hold on to my hardware for a long time and push them to the limits of their functionality, but that didn’t stop me from beginning the holy purge with a complete drive reformat. I was moving to a point where I needed Creative Suite less and less, but nevertheless, I purchased it along with Microsoft Office and the latest Mac OS X. Even then I was slowly phasing out print publishing but never lost touch with Linux as I was consistently deploying server software onto it.</p>
<p>My mobile solution will probably always be Apple hardware I believe; mainly now just due to the fact that it has become so mainstream that I should have no problems working on location. But last year when I decided to use Ubuntu as my development rig on location building the West 49 website I was blown away. The Linux desktop experience had evolved into something modern in the last size years. Even more functional than Mac OS X in some respects. But there was more to it.</p>
<p>Not only was I writing software with joy, I was handily managing the roles of Software Architect, Project Manager, Developer and even Account Exec to some degree. Hammering away at a keyboard writing software on Ubuntu reinstilled a fire in me that I had long forgotten. Yes Mac OS X has a terminal, but it just wasn’t the same. Linux felt much purer and my Magento extensions didn’t have problems with non-case sensitive file systems!</p>
<p>My aging wheezy iMac G5 began to fail, so it was time to return to Linux. The guys at Canada Computers were well educated as usual and walked me through the ropes of what was new in consumer hardware these days and what worked well with Ubuntu. Within a couple hours I was at home looking at almost a dozen boxes of computer parts ready to jump in. No anti-static wristband needed, I was going to ride this on the wild side ready to tear in. Two mismatched parts, a rats nest of wires,  three lost screws and a live USB drive later I was ready to return to my Linux.</p>
<p>Things that took me completely by surprise in Maverick Meerkat:<img class="alignright size-thumbnail wp-image-85" title="ubuntu-font-family-0.69-aaaa" src="http://seeparsan.net/wp-content/uploads/2011/03/ubuntu-font-family-0.69-aaaa-150x150.png" alt="" width="150" height="150" /></p>
<ul>
<li>The new <a href="http://font.ubuntu.com/" target="_blank">Ubuntu font</a> is absolutely gorgeous (The print admirer in me may never die in this cold cold digital age)</li>
<li>HDMI audio and video out to my monitors just work</li>
<li>Multimonitor video just works</li>
<li>Logitech Optical Trackman works better than Mac OS X ( still cannot recognize one button though )</li>
<li>It was half the price of a new Mac but thats nothing new</li>
<li>Dropbox just works</li>
<li>Sadly my muscle memory on ALT and CTRL keys are Mac style now, but that key mod map change just works</li>
<li>Visuals are so much more refined, did I mention the drop dead gorgeous new Ubuntu font with 10.10?</li>
<li>There is so much more built in than Mac OS X its astounding</li>
<li>Connecting to a network share via AFP was more reliable on Ubuntu than on Mac OS X</li>
<li>Software installation has had major improvements, Ubuntu Software Centre is the open-source godfather of the Mac App Store</li>
</ul>
<p>Nevertheless I still have tons to learn again. I used to have a setting on Mac OS X to open three terminals side by side to completely fill my screen depending on which screen I had hooked up to it. But now I want to investigate this thing I have been reading about called <em>tmux</em>. It would be a distinct improvement if I could just open open terminal, make it full screen and have three “terminals” side by side there to code. Thats probably a task for tomorrow to install <em>tmux</em> and test it while I set up my <em>git</em> and build systems. Blogs shall follow on my experiences with <em>tmux</em>.</p>
<p>All in all I am thrilled and comforted that I have returned back to where I was.</p>
<p><span id="more-81"></span></p>
<p><em>*Disclaimer: I now own a fully licensed version of Creative Suite and Microsoft Office, please forgive me Adobe, Microsoft. I was young and stupid.</em></p>
<p><em>**If you clicked on this post looking for cute furry animals, I apologize.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://seeparsan.net/2011/03/returning-to-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

