mod_fastcgi and RoR with DarwinPorts
If you’ve seen my post on setting up Ruby on Rails using darwinports on OSX, you probably know what I’m about to describe. If you didn’t, this is an explanation of the steps required to install FastCGI in order to speed-up processing RubyOnRails when using apache. This installation is much easier and faster than the one mentioned on RoR’s docs.
This assumes you’ve completed the steps in the other post.
* Install fcgi: sudo port install fcgi
* Install mod_fastcgi: sudo port install mod_fastcgi
* Install ruby’s fcgi bindings: sudo gem install fcgi
* Load fastCGI on your apache: LoadModule fastcgi_module modules/mod_fastcgi.so
* Add the .fcgi handler:
FastCgiIpcDir /tmp/fcgi_ipc/
AddHandler fastcgi-script .fcgi
Now all you have to do is restart apache (sudo /opt/local/apache2/bin/apachectl restart) and you’re done. You still have to edit your rails apps to use fastCGI instead of mod_ruby, though, with the two steps described on RoR’s documentation.
