Hoopla!

now with extra whiz-bang!

Hoopla!

Rails-optimized dispatch.fcgi

May 28, 2006 · 1 comment

After seeing Dreamhost killoff my fastcgi processes I’ve modified my dispatch.fcgi file in accordance with the suggestion on the dreamhost wiki. This is fully functional and you can (probably) just copy and past straight into your dispatch.fcgi file. The contents of the file are mostly just comments anyway, so this significantly simplified my dispatch file. Enough ado, here’s the code:

require File.dirname(__FILE__) + "/../config/environment" 
require 'fcgi_handler'

class RailsFCGIHandler
  private
  def fix_handler(signal)
    dispatcher_log :info, "asked to terminate immediately" 
    dispatcher_log :info, "fix handler working its magic!" 
    restart_handler(signal)
  end
  alias_method :exit_now_handler, :fix_handler
end

RailsFCGIHandler.process! nil, 10

→ 1 comment Tags:

My dispatch.fcgi

April 09, 2006 · 1 comment

Okay, it should be made clear that Rails couldn’t run on Dreamhost until I set the permissions on dispatch.fcgi (in the ‘public’ directory) to 755. Here’s the content of my dispatch.fcgi file:

1
2
3
4
5
6
#!/usr/bin/env ruby

require File.dirname(__FILE__) + "/../config/environment"
require 'fcgi_handler'

RailsFCGIHandler.process! nil, 10

→ 1 comment Tags: