<?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>Don&#039;t Forget</title>
	<atom:link href="http://www.johnnypez.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.johnnypez.com</link>
	<description>It&#039;s not a blog</description>
	<lastBuildDate>Fri, 19 Oct 2012 11:27:48 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.1</generator>
		<item>
		<title>Getting back to nginx</title>
		<link>http://www.johnnypez.com/uncategorized/getting-back-to-nginx/</link>
		<comments>http://www.johnnypez.com/uncategorized/getting-back-to-nginx/#comments</comments>
		<pubDate>Thu, 09 Feb 2012 17:12:42 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.johnnypez.com/?p=184</guid>
		<description><![CDATA[I recently had to deal with Apache which reminded me how much I loved Nginx.

So I'm in the middle of setting up a new VM with nginx and here's what I do to build it so I don't forget. It might also help you :) <a href="http://www.johnnypez.com/uncategorized/getting-back-to-nginx/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I recently had to deal with Apache which reminded me how much I loved Nginx.</p>
<p>So I&#8217;m in the middle of setting up a new VM with nginx and here&#8217;s what I do to build it so I don&#8217;t forget. It might also help you <img src='http://www.johnnypez.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<pre>
$> su
$> apt-get install build_essentials libpcre3-dev libssl-dev
$> cd /usr/local/src
$> wget http://nginx.org/download/nginx-1.1.14.tar.gz
$> tar -xzf nginx-1.1.14.tar.gz
$> cd nginx-1.1.14

$> ./configure --with-http_ssl_module \ 
  --user=nginx \
  --group=nginx \
  --conf-path=/etc/nginx/nginx.conf \
  --pid-path=/var/run/nginx.pid \
  --error-log-path=/var/log/nginx/errors.log \
  --http-log-path=/var/log/nginx/access.log \
  --sbin-path=/usr/local/sbin/nginx \

$> make &#038;&#038; make install
</pre>
<p>Your init script goes in /etc/init.d/nginx</p>
<pre>
#!/bin/sh

### BEGIN INIT INFO
# Provides:          nginx
# Required-Start:    $local_fs $remote_fs $network $syslog
# Required-Stop:     $local_fs $remote_fs $network $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: starts the nginx web server
# Description:       starts nginx using start-stop-daemon
### END INIT INFO

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/local/sbin/nginx
NAME=nginx
DESC=nginx

# Include nginx defaults if available
if [ -f /etc/default/nginx ]; then
	. /etc/default/nginx
fi

test -x $DAEMON || exit 0

set -e

. /lib/lsb/init-functions

test_nginx_config() {
	if $DAEMON -t $DAEMON_OPTS >/dev/null 2>&#038;1; then
		return 0
	else
		$DAEMON -t $DAEMON_OPTS
		return $?
	fi
}

case "$1" in
	start)
		echo -n "Starting $DESC: "
		test_nginx_config
		# Check if the ULIMIT is set in /etc/default/nginx
		if [ -n "$ULIMIT" ]; then
			# Set the ulimits
			ulimit $ULIMIT
		fi
		start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
		    --exec $DAEMON -- $DAEMON_OPTS || true
		echo "$NAME."
		;;

	stop)
		echo -n "Stopping $DESC: "
		start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
		    --exec $DAEMON || true
		echo "$NAME."
		;;

	restart|force-reload)
		echo -n "Restarting $DESC: "
		start-stop-daemon --stop --quiet --pidfile \
		    /var/run/$NAME.pid --exec $DAEMON || true
		sleep 1
		test_nginx_config
		start-stop-daemon --start --quiet --pidfile \
		    /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS || true
		echo "$NAME."
		;;

	reload)
		echo -n "Reloading $DESC configuration: "
		test_nginx_config
		start-stop-daemon --stop --signal HUP --quiet --pidfile /var/run/$NAME.pid \
		    --exec $DAEMON || true
		echo "$NAME."
		;;

	configtest|testconfig)
		echo -n "Testing $DESC configuration: "
		if test_nginx_config; then
			echo "$NAME."
		else
			exit $?
		fi
		;;

	status)
		status_of_proc -p /var/run/$NAME.pid "$DAEMON" nginx &#038;&#038; exit 0 || exit $?
		;;
	*)
		echo "Usage: $NAME {start|stop|restart|reload|force-reload|status|configtest}" >&#038;2
		exit 1
		;;
esac

exit 0
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.johnnypez.com/uncategorized/getting-back-to-nginx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multiple deploy keys with git</title>
		<link>http://www.johnnypez.com/reference/multiple-deploy-keys-with-git/</link>
		<comments>http://www.johnnypez.com/reference/multiple-deploy-keys-with-git/#comments</comments>
		<pubDate>Tue, 24 Jan 2012 12:39:11 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Reference]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.johnnypez.com/?p=180</guid>
		<description><![CDATA[Before I forget, and some may find this useful too.
If you are deploying a few projects to the same server you will run into this, you need to use unique deploy keys to access each project unless you want to add the server's public key to your account. <a href="http://www.johnnypez.com/reference/multiple-deploy-keys-with-git/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Before I forget, and some may find this useful too.<br />
If you are deploying a few projects to the same server you will run into this, you need to use unique deploy keys to access each project unless you want to add the server&#8217;s public key to your account. For security reasons I did not want to do that.</p>
<p>First generate some deployment keys with <code>ssh-keygen</code>. Here&#8217;s some more info on <a href="http://help.github.com/deploy-keys/">adding your deploy keys to your git repo</a></p>
<p>So I need to set up my ssh config file in <code>~/.ssh/config</code> like so&#8230;</p>
<pre>
Host project-a
  HostName github.com
  User git
  IdentityFile ~/.ssh/deploy_key_a_rsa
  IdentitiesOnly yes

Host project-b
  HostName github.com
  User git
  IdentityFile ~/.ssh/deploy_key__b_rsa
  IdentitiesOnly yes
</pre>
<p>Let&#8217;s say your two project git urls look like this:</p>
<pre>
  git@github.com:anon/project-a.git
  git@github.com:anon/project-b.git
</pre>
<p>You can now clone with the correct keys using..</p>
<pre>
  $> git clone project-a:anon/project-a.git
  $> git clone project-b:anon/project-b.git
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.johnnypez.com/reference/multiple-deploy-keys-with-git/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A better capitalize method</title>
		<link>http://www.johnnypez.com/ruby-rails/a-better-capitalize-method/</link>
		<comments>http://www.johnnypez.com/ruby-rails/a-better-capitalize-method/#comments</comments>
		<pubDate>Wed, 04 Jan 2012 15:13:27 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Ruby/Rails]]></category>

		<guid isPermaLink="false">http://www.johnnypez.com/?p=175</guid>
		<description><![CDATA[I'm back doing the blogging thing and this time its geekier than ever. Mostly ruby and javascript now. Kicking this year off with a quick ruby tip for capitalising names. <a href="http://www.johnnypez.com/ruby-rails/a-better-capitalize-method/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m just creating an app that has a registration form and I want to ensure that people&#8217;s names have capital letters in the right places.</p>
<p>String#capitalize just capitalizes the first letter of a string so it&#8217;s not exactly what I want.</p>
<p><code><br />
"laura ann".capitalize<br />
=> "Laura ann"<br />
"o'shea".capitalize<br />
=> "O'shea"<br />
</code></p>
<p>At a glance I couldn&#8217;t see any other ruby method or ActiveSupport method that does what I want here so a solution can be reached using String#gsub.</p>
<p><code><br />
"laura ann".gsub(/\b([\S])/){|m| m.upcase}<br />
=> "Laura Ann"</p>
<p>"o'shea".gsub(/\b([\S])/){|m| m.upcase}<br />
=> "O'Shea"<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.johnnypez.com/ruby-rails/a-better-capitalize-method/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Customising FB.ui iframe dialog dimensions</title>
		<link>http://www.johnnypez.com/uncategorized/customising-fb-ui-iframe-dialog-dimensions/</link>
		<comments>http://www.johnnypez.com/uncategorized/customising-fb-ui-iframe-dialog-dimensions/#comments</comments>
		<pubDate>Tue, 15 Feb 2011 16:42:41 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.johnnypez.com/?p=172</guid>
		<description><![CDATA[I was faced with making some FB.ui dialogs fit neatly inside and iframe today. The FB.ui dialogs get their default dimensions, from one of the methods in FB.UIServer.Methods For example, if you&#8217;re usinge FB.ui({method:'stream.share'}) The dialog gets its size from &#8230; <a href="http://www.johnnypez.com/uncategorized/customising-fb-ui-iframe-dialog-dimensions/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I was faced with making some FB.ui dialogs fit neatly inside and iframe today.<br />
The FB.ui dialogs get their default dimensions, from one of the methods in FB.UIServer.Methods</p>
<p>For example, if you&#8217;re usinge <code>FB.ui({method:'stream.share'})</code><br />
The dialog gets its size from <code>FB.UIServer.Methods.stream.share.size</code><br />
Which is equal to <code>{height:380, width:575}</code> if you take a look at it in a javascript console.</p>
<p>So these dimensions are there to be changed if you need to.</p>
<p>Note, I was using the &#8216;feed&#8217; dialog which is not present in FB.UIServer.Methods so I defined it after my call to FB.init so it would be available when I opened by dialog&#8230;</p>
<p><code><br />
FB.init({appId: '[my app id]', status: true, cookie: true, xfbml: true});<br />
FB.UIServer.Methods["feed"] = {size:{width:500,height:240}};<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.johnnypez.com/uncategorized/customising-fb-ui-iframe-dialog-dimensions/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>To get mysql gem to work on OSX 10.6</title>
		<link>http://www.johnnypez.com/uncategorized/to-get-mysql-gem-to-work-on-osx-10-6/</link>
		<comments>http://www.johnnypez.com/uncategorized/to-get-mysql-gem-to-work-on-osx-10-6/#comments</comments>
		<pubDate>Wed, 09 Feb 2011 11:51:02 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.johnnypez.com/?p=168</guid>
		<description><![CDATA[Just a quick note. I lost an hour to fiddling about with this. If you&#8217;re having trouble with the mysql gem version 2.8.1 on OSX 10.6 try uninstalling it and building it this way: sudo gem uninstall mysql export ARCHFLAGS="-arch &#8230; <a href="http://www.johnnypez.com/uncategorized/to-get-mysql-gem-to-work-on-osx-10-6/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Just a quick note. I lost an hour to fiddling about with this.</p>
<p>If you&#8217;re having trouble with the mysql gem version 2.8.1 on OSX 10.6 try uninstalling it and building it this way:</p>
<p><code><br />
sudo gem uninstall mysql<br />
</code></p>
<p><code><br />
export ARCHFLAGS="-arch i386 -arch x86_64" ; gem install --no-rdoc --no-ri mysql -- --with-mysql-dir=/usr/local --with-mysql-config=/usr/local/mysql/bin/mysql_config<br />
</code></p>
<p>The gem should build with no errors or warnings. The paths to mysql-dir and mysql-config are standard paths used by the mysql dmg, you might want to check your own paths first with:<br />
<code><br />
which mysql_config<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.johnnypez.com/uncategorized/to-get-mysql-gem-to-work-on-osx-10-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A bit of a refresh!</title>
		<link>http://www.johnnypez.com/web-design-and-development/a-bit-of-a-refresh/</link>
		<comments>http://www.johnnypez.com/web-design-and-development/a-bit-of-a-refresh/#comments</comments>
		<pubDate>Tue, 12 Oct 2010 11:14:53 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Design & Development]]></category>

		<guid isPermaLink="false">http://www.johnnypez.com/?p=166</guid>
		<description><![CDATA[As you&#8217;ll notice, the site has undergone a bit of a refresh. Content hasn&#8217;t changed much but my Twitter stream and Flickr Photostream take a front seat as these are the places where I am most active. I&#8217;ll also be &#8230; <a href="http://www.johnnypez.com/web-design-and-development/a-bit-of-a-refresh/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>As you&#8217;ll notice, the site has undergone a bit of a refresh. Content hasn&#8217;t changed much but my Twitter stream and Flickr Photostream take a front seat as these are the places where I am most active.</p>
<p>I&#8217;ll also be attempting yet again to keep blogging. My blog will be very tech focussed and will more often than not highlight tech issues and solutions that I come up against in my work. It will be pretty random, more of a repository of gotchas for myself and anyone else who happens to be doing similar stuff.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.johnnypez.com/web-design-and-development/a-bit-of-a-refresh/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Hex to UIColor</title>
		<link>http://www.johnnypez.com/design-development/hex-to-uicolor/</link>
		<comments>http://www.johnnypez.com/design-development/hex-to-uicolor/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 08:59:24 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Design & Development]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.johnnypez.com/?p=159</guid>
		<description><![CDATA[Alrighty, just a quick one. I&#8217;ve been looking all over for something that quickly gives me the code for a UIColor when given a HEX colour. I couldn&#8217;t find one so I whipped one up double quick. http://scratch.johnnypez.com/hex-to-uicolor]]></description>
			<content:encoded><![CDATA[<p>Alrighty, just a quick one.<br />
I&#8217;ve been looking all over for something that quickly gives me the code for a UIColor when given a HEX colour.<br />
I couldn&#8217;t find one so I whipped one up double quick.</p>
<p><a href="http://scratch.johnnypez.com/hex-to-uicolor" title="Convert Hex to UIColor">http://scratch.johnnypez.com/hex-to-uicolor</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.johnnypez.com/design-development/hex-to-uicolor/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>ifconfig eth0 shows packet errors</title>
		<link>http://www.johnnypez.com/linux/ifconfig-eth0-shows-packet-errors/</link>
		<comments>http://www.johnnypez.com/linux/ifconfig-eth0-shows-packet-errors/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 15:20:25 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.johnnypez.com/?p=144</guid>
		<description><![CDATA[Just a quick note on problem I came up against today. I monitor one of my production servers (running Ubuntu 7.10 server) with Munin and through this I had noticed a lot of errors on network interface eth0. I had &#8230; <a href="http://www.johnnypez.com/linux/ifconfig-eth0-shows-packet-errors/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Just a quick note on problem I came up against today.<br />
I monitor one of my production servers (running Ubuntu 7.10 server) with Munin and through this I had noticed a lot of errors on network interface eth0.</p>
<p>I had a quick look with <code>ifconfig eth0</code> to see what was going on. These were the lines of interest from the output:</p>
<pre>
RX packets:404933416 errors:0 dropped:0 overruns:0 frame:0
TX packets:501341708 errors:31383248 dropped:0 overruns:11 carrier:62766496
</pre>
<p>Obviously something is not right.<br />
I spent a while reading through log files to no avail, this isn&#8217;t really my area of expertise so I gave in and contacted my hosting provider.<br />
<span id="more-144"></span><br />
A Digiweb engineer got back to me very quickly advising me to check if the network interface was running at half-duplex.<br />
I used ethtool to check this out: </p>
<pre>
john:~$ sudo ethtool eth0
Settings for eth0:
	Supported ports: [ TP MII ]
	Supported link modes:   10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	Supports auto-negotiation: Yes
	Advertised link modes:  10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	Advertised auto-negotiation: Yes
	Speed: 10Mb/s
	Duplex: Half
	Port: MII
	PHYAD: 32
	Transceiver: internal
	Auto-negotiation: on
	Supports Wake-on: pumbg
	Wake-on: d
	Current message level: 0x00000007 (7)
	Link detected: yes
</pre>
<p>The interface was only running at 10Mb/s half-duplex.<br />
It seems auto-negotiation of the link had failed.</p>
<pre>john:~$ sudo mii-tool eth0
eth0: autonegotiation failed, link ok</pre>
<p>I fixed this be turning off auto-negotiation and applying the desired settings to eth0 with the following command:</p>
<pre>john:~$ ethtool -s eth0 speed 100 duplex full autoneg off</pre>
<p>Then to make sure this is always done with the interface is being brought up I added that command to /etc/network/interfaces just after the iface line:</p>
<pre>iface eth0 inet static
pre-up /usr/sbin/ethtool -s eth0 speed 100 duplex full autoneg off</pre>
<p>Having done this, the error count on eth0 hasn&#8217;t increased. Job done.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.johnnypez.com/linux/ifconfig-eth0-shows-packet-errors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unable to find a $JAVA_HOME at &#8230; on Mac OSX</title>
		<link>http://www.johnnypez.com/design-development/unable-to-find-a-java_home-at-on-mac-osx/</link>
		<comments>http://www.johnnypez.com/design-development/unable-to-find-a-java_home-at-on-mac-osx/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 09:44:13 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Design & Development]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">http://www.johnnypez.com/?p=140</guid>
		<description><![CDATA[I recently switched my Java versions from 1.5 to 1.6 and I&#8217;ve been hitting some issues with the java path. I tried setting the environment variable JAVA_HOME=/usr and that worked for some stuff but I still saw this error when &#8230; <a href="http://www.johnnypez.com/design-development/unable-to-find-a-java_home-at-on-mac-osx/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I recently switched my Java versions from 1.5 to 1.6 and I&#8217;ve been hitting some issues with the java path.<br />
I tried setting the environment variable <code>JAVA_HOME=/usr</code> and that worked for some stuff but I still saw this error when running java.<br />
eg:<br />
<code>>java -version<br />
Unable to find a $JAVA_HOME at "/usr", continuing with system-provided Java</code></p>
<p>I solved the problem by doing the following.<br />
First I found out where java actually was with:<br />
<code>>ls -l' `which java`<br />
/usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java</code></p>
<p>I noticed a command called java_home in that same directory. Running that command yields the correct java home directory.<br />
<code>>/System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java_home<br />
/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home</code></p>
<p>To correctly set the my JAVA_HOME environment variable in future, I added the following to my <code>~/.profile</code></p>
<p><code>export JAVA_HOME=`/System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java_home`</code></p>
<p>Once you have done this you can restart your terminal window or run <code>>. ~/.profile</code> to reload you profile into the current terminal session.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.johnnypez.com/design-development/unable-to-find-a-java_home-at-on-mac-osx/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Compiling Nginx with Phusion Passenger on OSX</title>
		<link>http://www.johnnypez.com/web-design-and-development/compiling-nginx-with-phusion-passenger-on-osx/</link>
		<comments>http://www.johnnypez.com/web-design-and-development/compiling-nginx-with-phusion-passenger-on-osx/#comments</comments>
		<pubDate>Wed, 29 Apr 2009 09:21:40 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Design & Development]]></category>

		<guid isPermaLink="false">http://www.johnnypez.com/?p=126</guid>
		<description><![CDATA[It took me a little while to get passenger set up with Nginx because I wanted to compile Nginx separately instead of using the tool provided with the passenger gem. I have it all working now so here&#8217;s how I &#8230; <a href="http://www.johnnypez.com/web-design-and-development/compiling-nginx-with-phusion-passenger-on-osx/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It took me a little while to get passenger set up with Nginx because I wanted to compile Nginx separately instead of using the tool provided with the passenger gem.  I have it all working now so here&#8217;s how I did it. I&#8217;m running OSX Leopard but this should be fine on any Linux distro too.<br />
<span id="more-126"></span></p>
<pre>
sudo gem install passenger
cd `passenger-config --root`
rake nginx
</pre>
<p>Download latest stable nginx tarball. (currently 0.6.36) to the directory of your choice, then, in that directory</p>
<pre>
tar -xzf nginx-0.6.36.tar.gz
cd nginx-0.6.36
./configure --with-http_ssl_module --add-module=`passenger-config --root`/ext/nginx
make
sudo make install
</pre>
<p>OR</p>
<p>If you already have nginx installed you might just want to copy the nginx binary from objs/nginx and replace the existing nginx binary with that.</p>
<pre>
cp -f objs/nginx /usr/local/nginx/sbin/nginx
</pre>
<p>Edit the nginx.conf (should be in /usr/local/nginx/conf) to add passenger_root, again you can get this path with <code>passenger-config --root</code>.<br />
Create a virtual host with a root in the rails app public dir and set <code>passenger_enabled on;</code> also set <code>rails_env development;</code>. It is important that the server <code>root</code> directive is set to the public directory of your rails app.</p>
<p>The following is an excerpt from my nginx.conf with passenger relevant config only:</p>
<pre>
http {
  #
  #
  passenger_root /Library/Ruby/Gems/1.8/gems/passenger-2.2.2;
  #
  #
  server {
    listen 80;
    server_name www.example.com;
    root /some/path/to/my_rails_app/public;
    passenger_enabled on;
    rails_env development;
  }
  #
  #
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.johnnypez.com/web-design-and-development/compiling-nginx-with-phusion-passenger-on-osx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
