Rails on Lighttpd (with FreeBSD Instructions)
Jason Hoffman of the red-friendly server farm TextDrive, has a thorough expository of one Apache-alternative in his Should I Consider Lighttpd? Leveraging his experience with Rails hosting, he weighs the feature set of lighttpd against his essentials for a Rails application.
I think the best analogy for lighttpd to Those Who Rail Against the Machine would “Webrick that does FastCGI”: a single lighttpd instance is easy to compile, configure and get running for a single Rails App (it took me less than 10 minutes to have Manuals running under lighttpd).
It’s especially promising that the lighttpd site itself has Ruby and Rails running! (See the right-hand column.)
The most exhaustive setup instructions can be found on this Rails on Debian howto. I’m just going to offer a few setup pointers on FreeBSD, assuming you have a Rails setup already.
cd /usr/ports/www/ruby-fcgi make install cd /usr/ports/www/lighttpd make install # Add: lighttpd_enable="YES" vim /etc/rc.conf cd /usr/local/etc cp lighttpd.conf.sample lighttpd.conf # Follow step '6c' in the Rails on Debian tutorial vim lighttpd.conf /usr/local/etc/rc.d/lighttpd.sh start
I love that it comes with some many Apache-a-likes. For example,
You know what would be cool? Ruby configuration. Complete Ruby configuration.
Update: Ensure you are running lighttpd-1.3.8 or higher, since the lighttpd’s support for spawning FastCGI processes was buggy or non-existent previous to that release.