<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Chee's blog &#187; deployment</title>
	<atom:link href="http://cheeyeo.wordpress.com/category/deployment/feed/" rel="self" type="application/rss+xml" />
	<link>http://cheeyeo.wordpress.com</link>
	<description>Observations, tips, tricks, articles on Ruby and anything else that follows.</description>
	<lastBuildDate>Wed, 18 Mar 2009 00:19:55 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='cheeyeo.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/1c59aee0b01111d834f3bfb3e82f9b0d?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Chee's blog &#187; deployment</title>
		<link>http://cheeyeo.wordpress.com</link>
	</image>
			<item>
		<title>Installing additional modules to nginx</title>
		<link>http://cheeyeo.wordpress.com/2008/09/09/installing-additional-modules-to-nginx/</link>
		<comments>http://cheeyeo.wordpress.com/2008/09/09/installing-additional-modules-to-nginx/#comments</comments>
		<pubDate>Tue, 09 Sep 2008 21:57:42 +0000</pubDate>
		<dc:creator>cheeyeo</dc:creator>
				<category><![CDATA[deployment]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[module]]></category>

		<guid isPermaLink="false">http://cheeyeo.wordpress.com/?p=34</guid>
		<description><![CDATA[A short post on how to install additional modules on an existing installation of nginx<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cheeyeo.wordpress.com&blog=3937360&post=34&subd=cheeyeo&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>There are a wealth of plugins or modules you could add to your existing nginx installation. I have been testing one of them recently &#8211; <a href="http://www.grid.net.ru/nginx/upload.en.html">the NGINX Upload module by Valery Kholodkov.</a>The beauty of this module is to capture and parse the mime headers before sending the parsed information onto your application backend. Your application only has to handle the parsed information which is formatted in a POST request header. This is defintely a powerful module to have if your application deals with large volumes of user uploads.</p>
<p>If you have an existing macport installation of nginx, it is a very straightforward process. All we need to do is to replace the default binary installtion with a new compiled version that includes the plugin.</p>
<p>Firstly, you would need to grab the source of nginx which is located here. The most current version is 0.6.32. Extract the source to your local directory. Next, grab the module you want to include &#8211; in this example we are using the upload module as mentioned above.</p>
<p>Open up the command prompt and change into the nginx sources folder and issue the following commands:</p>
<pre><span style="color:#993300;">cd nginx-0.6.32

sudo ./configure --add-module=../nginx_upload_module-2.0.6/ --prefix=/opt/local
--conf-path=etc/nginx/nginx.conf --sbin-path=sbin/ --with-http_ssl_module</span></pre>
<p>The last command above uses the &#8216;add-module&#8217; directive to include the module you want to add by specifying the path where it is located &#8211; in this case in the folder above the current directory called &#8216;nginx_upload_module&#8217;. The rest of the paramaters are pretty self-explanatory &#8211; it is pointing to where the default macport installtion of nginx resides namely /opt/local/sbin. The last parameter compiles the new nginx binary with ssl support.</p>
<p>If the command runs successfully, you should see the following on the screen:</p>
<pre><span style="color:#993300;">Configuration summary
+ threads are not used
+ using system PCRE library
+ using system OpenSSL library
+ md5 library is not used
+ sha1 library is not used
+ using system zlib library

nginx path prefix: "/opt/local"
nginx binary file: "/opt/local/sbin/"
nginx configuration file: "/opt/local/etc/nginx/nginx.conf"
nginx pid file: "/opt/local/logs/nginx.pid"
nginx error log file: "/opt/local/logs/error.log"
nginx http access log file: "/opt/local/logs/access.log"</span></pre>
<p>Lastly, run sudo make and sudo make install to complete the installation process. I restarted nginx using the following commands:</p>
<pre><span style="color:#993300;">sudo launchctl stop org.macports.nginx
sudo launchctl start org.macports.nginx</span></pre>
<p>You would need to refer to nginx.conf to alter the configuration option suited to the module you just added.</p>
<p>The entire process is semaless once you get your head round it but all it involves is just recompiling a new nginx binary to replace the one installed by macports. I think for those of you who have tried to compile new modules with apache would appreciate how easy it is to do the same thing with nginx &#8211; and I did not have to shut down the server for the entire process.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/cheeyeo.wordpress.com/34/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/cheeyeo.wordpress.com/34/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cheeyeo.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cheeyeo.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cheeyeo.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cheeyeo.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cheeyeo.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cheeyeo.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cheeyeo.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cheeyeo.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cheeyeo.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cheeyeo.wordpress.com/34/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cheeyeo.wordpress.com&blog=3937360&post=34&subd=cheeyeo&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://cheeyeo.wordpress.com/2008/09/09/installing-additional-modules-to-nginx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">cheeyeo</media:title>
		</media:content>
	</item>
		<item>
		<title>Deploying Rails Part 1</title>
		<link>http://cheeyeo.wordpress.com/2008/08/31/deploying-rails-part-1/</link>
		<comments>http://cheeyeo.wordpress.com/2008/08/31/deploying-rails-part-1/#comments</comments>
		<pubDate>Sun, 31 Aug 2008 13:00:31 +0000</pubDate>
		<dc:creator>cheeyeo</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[deploy]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://cheeyeo.wordpress.com/?p=26</guid>
		<description><![CDATA[Setting up NGINX on OS X Leopard Part 1<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cheeyeo.wordpress.com&blog=3937360&post=26&subd=cheeyeo&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>It is true that producing a rails application is half the batttle won- there are plenty of resources online and in books to guide a newbie through the process. Deploying a complete rails application is another challenge altogether. It requires a well-thought out plan and having the guts to deal with obscure error messages and grappling with the innards of server OS to get it right. It is an art in itself but it can be mastered by anyone with some patience and willingness to learn to get it right.</p>
<p>The traditional reply which I will provide anyone when ask how to deploy a rails application is to use Apache server as a shared host. However, I have recently discovered there are several disadvantages with this approach:</p>
<ol>
<li>Apache server requires mod_proxy module in order to run a cluster of mongrel servers. This means a default installation with the module already compiled or having to rebuild the entire server. Most shared host providers will not (in my experience) be willing to do that.</li>
<li>Any changes made to the configuration file require starting and restarting the server which means downtime for your application.</li>
<li>The configuration file (httpd.conf) is confusing &#8211; it relies on tags which in my experience is daunting and more error prone than a natural language syntax as in Ruby.</li>
</ol>
<p>Nginx, is an alternative to Apache and is capable of serving both static(html,css,javascript) request as well as dynamic request by routing it through to a mongrel cluster in the backend. It provides a host of configuration features including fcgi support as well as being able to make those configurations on the fly without having to restart the server! Yes, it means being able to upgrage the entire binary while your application still runs in the background.</p>
<p>Now I have not run any benchmark tests as of this writing but will do in subsequent post as to the speed it handles request but as it stands, a lot of major host providers(Engine Yard) and even some application providers(37signals,wordpress) are using it and commenting on significant improvements on performance.</p>
<p>I have setup nginx as a development server on my macbook and from what I understand by reading the wiki, there are two main approaches to installing it on osx.</p>
<ol>
<li>Using macports<br />
(<strong>sudo port install nginx)</strong></li>
<li>Downloading the latest stable tarball , extract and compile it.</li>
</ol>
<p>I tried both approaches and only the first seems to work for me. I will document in a subsequent post as to the result of the second approach.</p>
<p>It would be wise to stop apache server on your localhost if you have it setup previously before installing nginx.</p>
<p>Macports automatically installs nginx executable  into &#8216;/opt/local/sbin/nginx&#8217;. The configuration file is located at &#8216;/opt/local/etc/nginx/nginx.conf.default&#8217; &#8211; you need to copy and rename this file to &#8216;nginx.conf&#8217; before the server will start else you will get an error message on the terminal saying the conf file is not found.</p>
<p>To start or restart nginx I use the following commands on terminal:</p>
<p><strong>sudo launchctl start org.macports.nginx (to start it)</strong></p>
<p><strong>sudo launchctl start org.macports.nginx (to stop it)</strong></p>
<p>Fire up your browser and type in &#8216;http://localhost/&#8217; and you should see the following screen appear:<br />
<a href="http://cheeyeo.files.wordpress.com/2008/08/nginx.png"><br />
<img src="http://cheeyeo.files.wordpress.com/2008/08/nginx.png?w=568&#038;h=215" alt="" width="568" height="215" /></a></p>
<p>The default configuration points to &#8216;/opt/local/share/nginx/html/&#8217; but can be changed.</p>
<p>In part 2, I will showcase a configuration for a localhost deployment of a rails application including configuring your own mongrel_clusters.</p>
<p>Here are some links to find out more:</p>
<p><a href="http://brainspl.at/articles/search?q=nginx" target="blank">Ezra&#8217;s (creator of Merb) tips on running nginx</a></p>
<p><a href="http://wiki.codemongers.com/Main" target="blank">Official Nginx English wiki (apart from the Russian version- yes nginx was created by a russian)</a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/cheeyeo.wordpress.com/26/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/cheeyeo.wordpress.com/26/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cheeyeo.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cheeyeo.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cheeyeo.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cheeyeo.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cheeyeo.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cheeyeo.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cheeyeo.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cheeyeo.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cheeyeo.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cheeyeo.wordpress.com/26/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cheeyeo.wordpress.com&blog=3937360&post=26&subd=cheeyeo&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://cheeyeo.wordpress.com/2008/08/31/deploying-rails-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">cheeyeo</media:title>
		</media:content>

		<media:content url="http://cheeyeo.files.wordpress.com/2008/08/nginx.png" medium="image" />
	</item>
	</channel>
</rss>