<?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>A Noted Path by Theodore Nguyen-Cao &#187; rails</title>
	<atom:link href="http://www.theodorenguyen-cao.com/tag/rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.theodorenguyen-cao.com</link>
	<description>Personal blog of Theodore Nguyen-Cao</description>
	<lastBuildDate>Wed, 21 Jul 2010 15:40:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Using validates_presence_of on a boolean field? Should use validates_inclusion_of!</title>
		<link>http://www.theodorenguyen-cao.com/2009/01/12/using-validates_presence_of-on-a-boolean-field-should-use-validates_inclusion_of/</link>
		<comments>http://www.theodorenguyen-cao.com/2009/01/12/using-validates_presence_of-on-a-boolean-field-should-use-validates_inclusion_of/#comments</comments>
		<pubDate>Mon, 12 Jan 2009 05:38:43 +0000</pubDate>
		<dc:creator>Theo</dc:creator>
				<category><![CDATA[geekery]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://www.theodorenguyen-cao.com/?p=191</guid>
		<description><![CDATA[rsvp.theoandpat.com had boolean flag to marked whether or not a visitor was going to be able to make it to our wedding. Unfortunately, if you selected you were not able to make it and submit the form, the application would return saying it could not process your submission because you have to say that you [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://rsvp.theoandpat.com">rsvp.theoandpat.com</a> had boolean flag to marked whether or not a visitor was going to be able to make it to our wedding. Unfortunately, if you selected you were not able to make it and submit the form, the application would return saying it could not process your submission because you have to say that you are going to make it. I argued, this is an RSVP form so you have to accept if you are RSVPing. That&#8217;s the point of the RSVP! Only people RSVP would bother submitting the form!Â  Pat wasn&#8217;t too happy about that and ask/told me to fix it.Â  </p>
<p>Digging into it, it turns out the wayÂ  for <code><a href="http://api.rubyonrails.org/classes/ActiveRecord/Validations/ClassMethods.html#M001893">validates_presence_of</a></code> relies on <code>Object#blank</code> which of course when sent</p>
<pre name="code" class="ruby">
false.blank? # returns true
</pre>
<p>Reading up on the documentation, it is suggested to use <code><a href="http://api.rubyonrails.org/classes/ActiveRecord/Validations/ClassMethods.html#M001898">validates_inclusion_of</a></code> when dealing with booleans.</p>
<p>The one line change solved the problem:</p>
<pre name="code" class="ruby">
validates_inclusion_of :accepted, :in => [true, false]
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.theodorenguyen-cao.com/2009/01/12/using-validates_presence_of-on-a-boolean-field-should-use-validates_inclusion_of/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Rails initial request slow with mod_rails</title>
		<link>http://www.theodorenguyen-cao.com/2008/12/07/rails-initial-request-slow-with-mod-rails/</link>
		<comments>http://www.theodorenguyen-cao.com/2008/12/07/rails-initial-request-slow-with-mod-rails/#comments</comments>
		<pubDate>Sun, 07 Dec 2008 18:20:08 +0000</pubDate>
		<dc:creator>Theo</dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://www.theodorenguyen-cao.com/?p=158</guid>
		<description><![CDATA[Following up on my previous post , I&#8217;ve been experience slow load times (10-15 secs) on the initial request after application restarts. This has to do with the way mod_rails manages application instances (Although, I experienced this when using mongrel_cluster and proxy balancers). It will spin up instances on page request and each instance has [...]]]></description>
			<content:encoded><![CDATA[<p>Following up on my previous <a href="http://www.theodorenguyen-cao.com/2008/12/06/setting-up-phusion-passenger-mod_rails-with-capistrano-support/">post</a> , I&#8217;ve been experience slow load times (10-15 secs) on the initial request after application restarts.  This has to do with the way mod_rails manages application instances (Although, I experienced this when using mongrel_cluster and proxy balancers).  It will spin up instances on page request and each instance has an idle timeout.  This just means after the timeout expires, mod_rails will shutdown that instance to conserve memory allocation.  While you can change timeout value (see <a href="http://www.modrails.com/documentation/Users%20guide.html#PassengerPoolIdleTime">PassengerPoolIdleTime</a>), this will only cause all instances that get spin up to live longer. After high load times, these instances will stick around longer than neccessary.</p>
<p>For low traffic sites (like mine), this idle timeout may be reached causing the next visitor to our website to experience a really long delay before page load.  What we really want is an option to set a minimum number of instances.  This would allow us to automatically spin up an instance during start up and keep it around.  Unfortunately at this time, it doesn&#8217;t look like there is a way to set this.  </p>
<p>As a workaround, I&#8217;ve setup a crontab that makes a request to my application every 5 minutes to prevent  mod_rails from killing off all application instances.</p>
<p>To do this just run:</p>
<pre name="code" class="console">crontab -e</pre>
<p>And then specific the following cron</p>
<pre name="code" class="console">
*/5 * * * * wget -O /dev/null http://www.myapp.com 2>/dev/null
</pre>
<p>You can verify this is working correctly but just tailing your application logs and verify every 5 minutes you get a request.</p>
<p>You can also run </p>
<pre name="code" class="console">
 passenger-status
</pre>
<p>You should see at least the count variable to be at least 1 instance.</p>
<p>Note, this workaround will not immediate start up an instance upon restart.  You can add an initial request as part of your post deploy capistrano task though.  You probably should be making sure your application is up after deploying or restarting the application anyways.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theodorenguyen-cao.com/2008/12/07/rails-initial-request-slow-with-mod-rails/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Setting up Phusion Passenger (mod_rails) with Capistrano support</title>
		<link>http://www.theodorenguyen-cao.com/2008/12/06/setting-up-phusion-passenger-mod_rails-with-capistrano-support/</link>
		<comments>http://www.theodorenguyen-cao.com/2008/12/06/setting-up-phusion-passenger-mod_rails-with-capistrano-support/#comments</comments>
		<pubDate>Sun, 07 Dec 2008 00:27:18 +0000</pubDate>
		<dc:creator>Theo</dc:creator>
				<category><![CDATA[geekery]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.theodorenguyen-cao.com/?p=144</guid>
		<description><![CDATA[I had heard of mod_rails awhile back but never had the time to take a closer look at it. While setting up a new rails app, I was getting frustrated with all of the configuration I needed to do to get the mongrel clusters and proxy balancers setup. So I decided to give passenger a [...]]]></description>
			<content:encoded><![CDATA[<p>I had heard of mod_rails awhile back but never had the time to take a closer look at it.  While setting up a new rails app, I was getting frustrated with all of the configuration I needed to do to get the mongrel clusters and proxy balancers setup.  So I decided to give passenger a chance.  I&#8217;m a fan now <img src='http://www.theodorenguyen-cao.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The process was dead simple.</p>
<ol>
<li>Install the passenger gem
<pre class="console" name="code">sudo gem install passenger</pre>
</li>
<li>Install passenger as an Apache module
<pre class="console" name="code">passenger-install-apache2-module</pre>
</li>
<li>Load the passenger apache module by editing the Apache config
<pre class="console" name="code">
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.0.5/ext/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.0.5
PassengerRuby /usr/bin/ruby1.8
</pre>
</li>
<li>Restart Apache</li>
</ol>
<p>If all things went well, you have everything installed you need. If there were some missing dependencies, you should be presented with how to install those dependencies.</p>
<p>In the installation output, it tells you how to mod_railsify your apps by creating a vhost as such:</p>
<pre class="console" name="code">
&lt;VirtualHost *:80&gt;
    ServerName www.mywebsite.com
    DocumentRoot /home/deploy/mywebsite/public
&lt;/VirtualHost&gt;
</pre>
<p>That&#8217;s it! No more of this proxy balancer and mongrel_cluster.yml configuration.</p>
<p>There&#8217;s some magic going on in the background.  As requests come in, passenger will spin up more application instances.  For more tweaking your configuration options check out the <a href="http://www.modrails.com/documentation/Users%20guide.html#_resource_control_and_optimization_options">user guide</a>.</p>
<p>Go to your website and you should see your rails app up and running.</p>
<p>So now we have your app up and running, how do we update or restart our app?  Passenger provides two ways for us to do this. </p>
<p>The first is whenever apache is restarted, your application is restarted.</p>
<p>The second way allows us to restart a specified application without affecting Apache.  Whenever passenger detects <code>tmp/restart.txt</code>, it will restart the application instances for us.  We can integrate this into our Capistrano deploy flow by adding the following  our <code>config/deploy.rb</code></p>
<pre name="code" class="ruby">
namespace :passenger do
  desc "Restart Application"
  task :restart do
    run "touch #{current_path}/tmp/restart.txt"
  end
end

after :deploy, "passenger:restart"
</pre>
<p>This will create that restart.txt after the cap:deploy task gets executed, causing the application to restart.</p>
<p>Finally, passenger comes with some pretty useful utilities.</p>
<p>Check out <code>passenger-status</code> which produces output showing current passenger server statuses.</p>
<p>Sample output: </p>
<pre name="code" class="console">
----------- General information -----------
max      = 6
count    = 1
active   = 0
inactive = 1
Using global queue: no
Waiting on global queue: 0

----------- Applications -----------
/home/deploy/www.myapp.com/releases/20081206183156:
  PID: 30784     Sessions: 0
</pre>
<p>Another utility <code>passenger-memory-status</code> gives you insight into how much memory is being used by apache and passenger.</p>
<p>Sample output:</p>
<pre name="code" class="console">
-------------- Apache processes ---------------
PID    PPID   Threads  VMSize    Private  Name
-----------------------------------------------
12841  1      1        225.9 MB  0.0 MB   /usr/sbin/apache2 -k start
28294  12841  1        248.4 MB  21.4 MB  /usr/sbin/apache2 -k start
28300  12841  1        243.7 MB  0.5 MB   /usr/sbin/apache2 -k start
28306  12841  1        248.4 MB  4.4 MB   /usr/sbin/apache2 -k start
28357  12841  1        249.1 MB  19.8 MB  /usr/sbin/apache2 -k start
29400  12841  1        249.4 MB  3.7 MB   /usr/sbin/apache2 -k start
29788  12841  1        249.3 MB  21.7 MB  /usr/sbin/apache2 -k start
29834  12841  1        245.8 MB  18.9 MB  /usr/sbin/apache2 -k start
29836  12841  1        245.8 MB  9.3 MB   /usr/sbin/apache2 -k start
29868  12841  1        245.8 MB  2.4 MB   /usr/sbin/apache2 -k start
29870  12841  1        246.5 MB  5.2 MB   /usr/sbin/apache2 -k start
### Processes: 11
### Total private dirty RSS: 107.44 MB

--------- Passenger processes ----------
PID    Threads  VMSize    Private  Name
----------------------------------------
28031  10       15.3 MB   0.1 MB   /usr/lib/ruby/gems/1.8/gems/passenger-2.0.5/ext/apache2/ApplicationPoolServerExecutable 0 /usr/lib/ruby/gems/1.8/gems/passenger-2.0.5/bin/passenger-spawn-server  /usr/bin/ruby1.8  /tmp/passenger_status.12841.fifo
28032  2        48.7 MB   0.6 MB   Passenger spawn server
29161  1        114.8 MB  0.7 MB   Passenger FrameworkSpawner: 2.1.2
30461  1        122.8 MB  32.3 MB  Passenger ApplicationSpawner: /home/deploy/www.myapp.com/releases/20081206183156
30784  1        129.3 MB  33.4 MB  Rails: /home/deploy/www.myapp.com/releases/20081206183156
### Processes: 5
### Total private dirty RSS: 67.08 MB
</pre>
<p>Pretty sweet.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theodorenguyen-cao.com/2008/12/06/setting-up-phusion-passenger-mod_rails-with-capistrano-support/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Where is my sequel sock?</title>
		<link>http://www.theodorenguyen-cao.com/2008/05/03/where-is-my-sequel-sock/</link>
		<comments>http://www.theodorenguyen-cao.com/2008/05/03/where-is-my-sequel-sock/#comments</comments>
		<pubDate>Sat, 03 May 2008 05:33:40 +0000</pubDate>
		<dc:creator>Theo</dc:creator>
				<category><![CDATA[geekery]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://blog.notedpath.com/2008/05/03/where-is-my-sequel-sock/</guid>
		<description><![CDATA[I was looking for where mysql.sock was since running rake db:bootstrap was complaining with &#8220;No such file or directory &#8211; /tmp/mysql.sock&#8221;. Rails looks for the mysql.sock file under /tmp/mysql.sock by default. Ubuntu using an apt-get install of mysql puts the mysql.sock file at /var/run/mysqld/mysqld.sock. I always forget where it is. So, I&#8217;m writing it down. [...]]]></description>
			<content:encoded><![CDATA[<p>I was looking for where mysql.sock was since running rake db:bootstrap was complaining with &#8220;No such file or directory &#8211; /tmp/mysql.sock&#8221;.  Rails looks for the mysql.sock file under /tmp/mysql.sock by default.  Ubuntu using an apt-get install of mysql puts the mysql.sock file at /var/run/mysqld/mysqld.sock.</p>
<p>I always forget where it is. So, I&#8217;m writing it down.</p>
<p><strong>/var/run/mysqld/mysqld.sock</strong></p>
<p>You can also grep for it from mysql like so</p>
<pre class="console">
&gt;&gt;  mysql -? | grep mysqld.sock
socket                            /var/run/mysqld/mysqld.sock</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.theodorenguyen-cao.com/2008/05/03/where-is-my-sequel-sock/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Ruby: ! versus not operator</title>
		<link>http://www.theodorenguyen-cao.com/2008/03/29/ruby-versus-not-operator/</link>
		<comments>http://www.theodorenguyen-cao.com/2008/03/29/ruby-versus-not-operator/#comments</comments>
		<pubDate>Sun, 30 Mar 2008 04:45:27 +0000</pubDate>
		<dc:creator>Theo</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.notedpath.com/2008/03/29/ruby-versus-not-operator/</guid>
		<description><![CDATA[I was writing some code in an erb template that looked like this: &#60;% if @user &#38;&#38; not @user.errors.empty? -%&#62; #do stuff &#60;% end -%&#62; This resulted in a syntax error. Huh? What&#8217;s wrong with this? Turns out it&#8217;s an outstanding Core Ruby bug. As shown in the ticket if we have a method foo [...]]]></description>
			<content:encoded><![CDATA[<p>I was writing some code in an erb template that looked like this:</p>
<pre name="code" class="ruby">
&lt;% if @user &amp;&amp; not @user.errors.empty? -%&gt;
#do stuff
&lt;% end -%&gt;</pre>
<p>This resulted in a syntax error. Huh? What&#8217;s wrong with this?</p>
<p>Turns out it&#8217;s an outstanding <a href="http://rubyforge.org/tracker/?func=detail&amp;atid=1698&amp;aid=3843&amp;group_id=426">Core Ruby bug</a>.</p>
<p>As shown in the ticket if we have a method foo</p>
<pre name="code" class="ruby">
def foo(parameter)
  puts parameter.to_s
end</pre>
<p>using the ! and the not operator on various method calls show us that the ! and not operator are not interchangeable in practice.</p>
<pre name="code" class="ruby">
foo(!(1 &lt; 2)) # works fine
foo(not(1 &lt; 2)) # generates syntax error
foo(not 1 &lt; 2) # generates syntax error
foo((not 1 &lt; 2)) # works fine</pre>
<p>Changing the my code to the following fixed my issue:</p>
<pre name="code" class="ruby">
&lt;% if @user &amp;&amp; !@user.errors.empty? -%&gt;
#do stuff
&lt;% end -%&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.theodorenguyen-cao.com/2008/03/29/ruby-versus-not-operator/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Breaking Java Habits: Ruby increment/decrement operators</title>
		<link>http://www.theodorenguyen-cao.com/2008/03/15/breaking-java-habits-ruby-incrementdecrement-operators/</link>
		<comments>http://www.theodorenguyen-cao.com/2008/03/15/breaking-java-habits-ruby-incrementdecrement-operators/#comments</comments>
		<pubDate>Sat, 15 Mar 2008 23:03:07 +0000</pubDate>
		<dc:creator>Theo</dc:creator>
				<category><![CDATA[geekery]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://blog.notedpath.com/2008/03/15/breaking-java-habits-ruby-incrementdecrement-operators/</guid>
		<description><![CDATA[My background in C++ and Java has instilled in me some programming habits that don&#8217;t play nice in Ruby. When I want to increment or decrement a number, my fingers instinctively go to &#8216;++&#8217; and &#8216;&#8211;’&#8217;. Unfortunately, this syntax is not supported by Ruby. As a language design choice, Ruby opted to not support this [...]]]></description>
			<content:encoded><![CDATA[<p>My background in C++ and Java has instilled in me some programming habits that don&#8217;t play nice in Ruby.  When I want to increment or decrement a number, my fingers instinctively go to &#8216;++&#8217; and &#8216;&#8211;’&#8217;.</p>
<p>Unfortunately, this syntax is not supported by Ruby.  As a language design choice, Ruby opted to not support this syntactic sugar to increment/decrement a variable.</p>
<p>I will have to break my habit and start going with:</p>
<pre name="code" class="ruby">
// increment x
x+=1
// decrement x
x-=1</pre>
<p>Another thing to note is that the prefix increment/decrement operators like &#8216;&#8211;x&#8217; or &#8216;++x&#8217; do nothing. The signs are interpreted as unary operators.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theodorenguyen-cao.com/2008/03/15/breaking-java-habits-ruby-incrementdecrement-operators/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Autocomplete in Rails 2.0</title>
		<link>http://www.theodorenguyen-cao.com/2007/12/11/autocomplete-in-rails-20/</link>
		<comments>http://www.theodorenguyen-cao.com/2007/12/11/autocomplete-in-rails-20/#comments</comments>
		<pubDate>Tue, 11 Dec 2007 05:10:19 +0000</pubDate>
		<dc:creator>Theo</dc:creator>
				<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://blog.notedpath.com/2007/12/11/autocomplete-in-rails-20/</guid>
		<description><![CDATA[I&#8217;ve been trying out the newly released Rails 2.0. Lots of cool new stuff. However, it takes some time to get used to doing things the new way if you haven&#8217;t been working from EdgeRails. One of the features that came out of the box in previous releases was support for autocomplete using scriptaculous. This [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been trying out the newly released <a href="http://weblog.rubyonrails.org/2007/12/7/rails-2-0-it-s-done">Rails 2.0</a>.  Lots of cool new stuff. However, it takes some time to get used to doing things the new way if you haven&#8217;t been working from <a href="http://wiki.rubyonrails.org/rails/pages/EdgeRails">EdgeRails</a>.</p>
<p>One of the features that came out of the box in previous releases was support for autocomplete using <a href="http://demo.script.aculo.us/ajax/autocompleter_customized">scriptaculous</a>.  This has now been moved from the core rails install to an install via plugin.</p>
<p>Just install the plugin via:<br />
<code>script/plugin install http://svn.rubyonrails.org/rails/plugins/auto_complete</code></p>
<p>Then, you have to turn off the <a href="http://en.wikipedia.org/wiki/Cross-site_request_forgery">cross-site request forgery</a> protection that comes with Rails 2.0.</p>
<p>You can do this at the Controller level by adding something similar to the following:</p>
<pre name="code" class="ruby">
class UsersController < ApplicationController
protect_from_forgery <img src='http://www.theodorenguyen-cao.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> nly => [:update, :delete, :create] // exclude the auto_complete method
...
end
</pre>
<p>If you don&#8217;t do this, your autocomplete actions will throw an ActionController::InvalidAuthenticityToken exception which caused me hours of confusion.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theodorenguyen-cao.com/2007/12/11/autocomplete-in-rails-20/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Mongrel + Apache = rails.notedpath.com</title>
		<link>http://www.theodorenguyen-cao.com/2007/09/10/mongrel-apache-railsnotedpathcom/</link>
		<comments>http://www.theodorenguyen-cao.com/2007/09/10/mongrel-apache-railsnotedpathcom/#comments</comments>
		<pubDate>Tue, 11 Sep 2007 03:32:25 +0000</pubDate>
		<dc:creator>Theo</dc:creator>
				<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://blog.notedpath.com/2007/09/10/mongrel-apache-railsnotedpathcom/</guid>
		<description><![CDATA[After fighting apache for a couple hours, I finally have mongrel set up to proxy through apache. At first I had the proxy module enabled but was getting a 403 page. After adding logging to the vhost config, I see [Mon Sep 10 22:57:00 2007] [warn] proxy: No protocol handler was valid for the URL [...]]]></description>
			<content:encoded><![CDATA[<p>After fighting apache for a couple hours, I finally have mongrel set up to proxy through apache.</p>
<p>At first I had the proxy module enabled but was getting a 403 page. After adding logging to the vhost config, I see</p>
<p><code>[Mon Sep 10 22:57:00 2007] [warn] proxy: No protocol handler was valid for the URL /. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.</code></p>
<p>I go ahead and find out I didn&#8217;t have proxy_http enabled.  After executing <code>sudo a2enmod proxy_http</code> and bouncing apache, TA-DA!  </p>
<p><center><a href='http://blog.notedpath.com/wp-content/uploads/2007/09/screenshot001.jpg' title='Rails - Hello, World!'><img src='http://blog.notedpath.com/wp-content/uploads/2007/09/screenshot001.jpg' alt='Rails - Hello, World!' /></a></center></p>
]]></content:encoded>
			<wfw:commentRss>http://www.theodorenguyen-cao.com/2007/09/10/mongrel-apache-railsnotedpathcom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I need mod_proxy_balancer?</title>
		<link>http://www.theodorenguyen-cao.com/2007/08/19/i-need-mod_proxy_balancer/</link>
		<comments>http://www.theodorenguyen-cao.com/2007/08/19/i-need-mod_proxy_balancer/#comments</comments>
		<pubDate>Mon, 20 Aug 2007 00:10:30 +0000</pubDate>
		<dc:creator>Theo</dc:creator>
				<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://blog.notedpath.com/2007/08/19/i-need-mod_proxy_balancer/</guid>
		<description><![CDATA[I have been trying to get a rails app served up by a mongrel cluster through apache. All the documentation I&#8217;ve looked at says this can be done with an Apache module mod_proxy_balancer. Looks like my apache install using apt-get does not come with that module. Blah! Guess I have to pull down the source [...]]]></description>
			<content:encoded><![CDATA[<p>I have been trying to get a rails app served up by a mongrel cluster through apache.  All the documentation I&#8217;ve looked at says this can be done with an Apache module mod_proxy_balancer.  Looks like my apache install using <em>apt-get</em> does not come with that module.  Blah!  Guess I have to pull down the source and build from source.  Hopefully, I don&#8217;t break anything!</p>
<p>References:</p>
<ul>
<li><a href="http://mongrel.rubyforge.org/docs/apache.html">Mongrel: Apache</a></li>
<li><a href="http://www.kodefoo.com/2007/2/18/deploying-rails-on-ubuntu-dapper/">Deploying Rails on Ubuntu</a></li>
<li><a href="http://blog.codahale.com/2006/06/19/time-for-a-grown-up-server-rails-mongrel-apache-capistrano-and-you">Time For a Grown-Up Server</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.theodorenguyen-cao.com/2007/08/19/i-need-mod_proxy_balancer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache, Tomcat, Rails</title>
		<link>http://www.theodorenguyen-cao.com/2007/08/19/apache-tomcat-rails/</link>
		<comments>http://www.theodorenguyen-cao.com/2007/08/19/apache-tomcat-rails/#comments</comments>
		<pubDate>Sun, 19 Aug 2007 17:09:54 +0000</pubDate>
		<dc:creator>Theo</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://blog.notedpath.com/2007/08/19/apache-tomcat-rails/</guid>
		<description><![CDATA[It was easier than I thought it would be to install Java and Tomcat. With a few apt-get commands, I had both Java and Tomcat up and running. The next step was to serve Tomcat through Apache. This was done by using the AJP Connector. Tomcat is running with AJP connector port 8009 and I [...]]]></description>
			<content:encoded><![CDATA[<p>It was easier than I thought it would be to install Java and Tomcat.  With a few <em>apt-get</em> commands, I had both Java and Tomcat up and running.  The next step was to serve Tomcat through Apache.  This was done by using the AJP Connector.  Tomcat is running with AJP connector port 8009 and I can serve up JSPs and servlet content through Apache who is listening on port 80. Pretty slick <img src='http://www.theodorenguyen-cao.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>It was even easier to get a Rails app up and running on WEBrick on default port 3000.</p>
<p>Next steps will be to serve Rails content through Apache.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theodorenguyen-cao.com/2007/08/19/apache-tomcat-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
