Using Passenger from Git on Brightbox hosts
I've just started my new job at Rawnet and was pleased to find that we're using Brightbox and Phusion Passenger to serve our sites. Unfortunately our install has been seeing the Broken Pipe bug intermittently. This has been fixed in passenger on github, but it's not yet part of a released version and thus not in the Brightbox apt repository.
The answer is to use Passenger's git head directly on the box. Thankfully, this is pretty straightforward, although there's a few gotchas that I'll mention later.
A suitable place for this is in /opt, so we'll clone into there:
sudo git clone git://github.com/FooBarWidget/passenger.git
Build the package using the built-in installer. It gives any hints you need to resolve any missing dependencies, although I didn't hit any issues:
cd passenger
bin/passenger-install-apache2-module
Next we need to configure Apache to use the newly-built Passenger module rather than the supplied package. We can use Ubuntu's a2enmod and a2dismod to help with this. First we'll create a new config set for the git passenger:
sudo vi /etc/apache2/mods-available/passenger-git.load:
LoadModule passenger_module /opt/passenger/ext/apache2/mod_passenger.so
sudo vi /etc/apache2/mods-available/passenger-git.conf:
<IfModule mod_passenger.c>
PassengerRoot /opt/passenger
PassengerRuby /usr/bin/ruby
</IfModule>
Now that we have these new config files, we can easily switch between the vendor-provided package and the git head like so:
sudo a2dismod passenger
sudo a2enmod passenger-git
sudo invoke-rc.d apache2 force-reload
Test your sites and all should hopefully be bon.
Keep your eyes on the commits to the passenger tree on github and when you see fixes or features you want on your install, just do the following:
cd /opt/passenger
sudo git pull
sudo bin/passenger-install-apache2-module
sudo invoke-rc.d apache force-reload