Running rails applications with Apache has never been great. In the past, options have been (from best to worst):
- proxy to mongrel or another appserver using mod_proxy or mod_proxy_balancer
- mod_fcgid
- mod_ruby (gasp)
Now there is a new player on the scene, Phusion Passenger. I haven’t used it yet in for a high traffic site, but for a tiny project it worked like a charm with no hiccups. Just do: (these steps are for Apache 2.0.52)
sudo gem install passenger
passenger-install-apache2-module
Follow the instructions and create /etc/apache2/conf.d/passenger:
1 2 3 |
LoadModule passenger_module /usr/local/lib/ruby/gems/1.8/gems/passenger-2.0.3/ext/apache2/mod_passenger.so PassengerRoot /usr/local/lib/ruby/gems/1.8/gems/passenger-2.0.3 PassengerRuby /usr/local/bin/ruby |
1 2 3 4 |
<VirtualHost www.foobar.com:80>
ServerName www.foobar.com
DocumentRoot /webapps/foobar/public
</VirtualHost> |
touch /webapps/foobar/tmp/restart.txt
to reload rails whenever you update your code. Brilliant!
Leave a Comment