Phusion’s One Year Anniversary Gift: Phusion Passenger 2.2.0
This month is a very special month for Phusion. Not only was it one year ago that we posted our ideas on getting Ruby to work on all PHP platforms (RAHP) as an April fools joke, but it was also the month that Hongli and I officially founded Phusion, the Computer Science company at the Dutch chamber of commerce. Needless to say, seeing as this is Phusion’s first year anniversary as a company, we felt strongly inclined to go the extra mile and make this one count. Instead of making yet another April fools joke, we wanted to take the opportunity to announce a long-awaited addition to our Phusion Passenger line-up. In a way, I guess the joke would be that this really isn’t a joke.
We are glad to announce…
Ever since the first release of Phusion Passenger for Apache, some people have been asking us to create a Phusion Passenger for platform XYZ. Well, it may come to you as no surprise but we’ve been playing with similar ideas for quite some time. In fact, we’ve architected Phusion Passenger to be as independent from any specific web server as possible to make something like this an option to consider to begin with.
For us however, maintaining a product to live up to the high quality standards that you’ve come to expect of our products requires a lot of time and effort. Maintaining multiple versions of a project won’t exactly lower this amount of required effort and with limited resources in mind, this made us a bit reluctant on doing something like this from the start. Instead, we chose to focus our efforts on polishing up one version before ever deciding to make the jump to another server platform, a choice from which we’d be able to reap the fruits from in tenfold. Not only in terms of experience, but also in terms of having a more robust and solid code base to work from.
Even though we would be able to share a lot of code between different server versions from an architectural point of view, this would only be a small benefit compared to the work that would still be required. Not only would a fair deal of specific code need to be written but also maintained and documented. This process in particular is painful if the server software you’re writing it for doesn’t have any documentation itself, which became all too apparent for us in some particular cases.
Despite being able to successfully create several versions, we weren’t able to infer significant benefits over the Apache version, both from a technical point of view as well as from an ease of use point of view. In fact, in past articles we’ve elaborated on both points quite a deal and had decided not to pursue its release in favor of polishing the core foundations of Phusion Passenger first and foremost. However, reasons like these usually only play a small part in the choice of technology. Company policies and dependencies of other software usually play a bigger part in deciding this, and with this in mind, Apache might not always be an option. In this regard, we’ve always wanted to accommodate the largest denominator and it is for this reason that the initial version of Phusion Passenger and the ones that followed were exclusively for Apache. Until today that is.
A few weeks ago, as you may still remember from the comments in this article, Ezra of Engine Yard contacted us on the possibility of financially sponsoring a first release of Phusion Passenger for Nginx. Even though we had already written the majority of the code for Nginx Passenger quite a few months ago, we didn’t feel it was the right time to release it back then.
By the time of this writing however, Phusion Passenger is almost one year old and as mature as it has ever been thanks to all the contributions people have made during this time. With this in mind, we decided to accept Ezra’s offer.
After spending weeks on further development and intensive testing, we’ve now come to the point wherein we have the distinct honor to announce Phusion Passenger for Nginx as an addition to the Phusion Passenger server line-up.. Our thanks goes out to Engine Yard for financially sponsoring this first release of Phusion Passenger for Nginx, as well as all the people who have in some way donated in the past for making this release possible in the first place.
Great, how do I get started?
Geoffrey Grosenbach of Peepcode fame has kindly created a screencast for us. This screencast covers everything you need to get started with deploying a Rails/Ruby web application on Nginx using Phusion Passenger.
In a nutshell, you first need to install the Phusion Passenger gem:
sudo gem install passenger
(Note: Rubyforge might still be updating their mirrors. If the above command didn’t install 2.2.0 for you and you can’t wait, then download the 2.2.0 gem from Google Code)
Both the Apache and the Nginx version are contained in the same gem, which keeps things nice and simple!
Next, you need to run the passenger-install-nginx-module command, similar to what you’re used to when installing the Apache version:
sudo passenger-install-nginx-module
Nginx doesn’t support loadable modules like Apache does, so it needs to be compiled from scratch. But the installer can do this for you as well! You can of course also choose to compile Nginx manually. Once Nginx has been compiled and installed, the installer will tell you how to configure Nginx and how to deploy a Rails application on Nginx. A typical deploy server bock looks like this:
server {
listen 80;
server_name www.foo.com;
root /webapps/foo/public; # <--- notice the 'public' part
passenger_enabled on; # <--- don't forget this!
}
We've also spent a lot of effort on documenting Phusion Passenger for Nginx. For detailed installation instructions and usage instructions, please refer to the users guide for Nginx.
If you prefer to install Phusion Passenger via the source tarball instead, then that's also possible. Please read the included README for installation instructions.
Where to report bugs
If you've found a bug, please do not post it in a comment, but file an issue on our issue tracker instead.
Other changes
In addition to bringing you an Nginx version of Phusion Passenger, we've also made improvements in the Apache version. The most important changes are:
- Support for chunked file uploads
- Resource-limited HTTP clients, such as mobile devices, often send HTTP file uploads using the "chunked" transfer encoding in order to save resources. Previous versions of Phusion Passenger didn't support this, but now it does! Please note that chunked file uploads is only supported in the Apache version; the Nginx version doesn't because doesn't support chunked file uploads.
- Support for Capistrano-style deployments
- Whenever you deploy a new release with Capistrano, previous versions of Phusion Passenger will leave the application processes of the last release running until they idle timeout. This includes the old release's ApplicationSpawner server process. This is caused by the fact that Phusion Passenger uniquely identifies an application based on its canonical path, meaning that any symlinks in the paths are fully resolved. In Capistrano-style deployments, the 'current' directory is actually a symlink to a release directory, so every time you deploy a new release, Phusion Passenger thinks that it's a totally different application.
This issue has now been fixed, and Phusion Passenger no longer resolves symlinks anymore. So whenever you deploy a new release with Capistrano, Phusion Passenger will properly detect it as being the same application. If you had any hacks in your deploy.rb for killing off old processes, then you can remove them now!
- Ability to load application_controller.rb from non-standard directory
- In some applications, application_controller.rb is located in the search path, though not in app/controllers. Support for this kind of setup has been fixed.
- Worker process event hooks for Rack
- The :starting_worker_process and :stopping_worker_process event hooks have been implemented for Rack as well. Thanks to Saimon Moore.
Some final words
We initially planned to announce this release at the coming Railsconf, but the temptation was just too big to announce this on our very first anniversary. Also, if all goes as scheduled, we may have an even bigger announcement at Railsconf, so stay tuned!
Follow us on Twitter too to stay in the loop ( @phusion_nl )


Phusion. All rights reserved.
Whoa, way cool! WTG EY and Phusion team
“An even bigger announcement”… IIS? *smirk*
@Morten : errr… computer says no
Way to go guys, seriously cool stuff!
I’ve been working with Hongli to get passenger for nginx tuned and tested in production and I must say I am very impressed. This release melts away any concerns I had and makes passenger pretty much the best way to run your ruby apps. There are still a few things that mongrel or thin are better for(amqp ahem) but if your app works on nginx+passenger then it is what you shoudl use. Performance is great, management is *way* easier then mongrel + monit.
Nice work guys.
You guys rule! Thank you so much for the incredible work.
Great work guys! This is fantastic news. Your team has done amazing things for the Rails community over the last year.
Also a small plug
Nginx+Passenger is now available as a tuned stack on http://engineyard.com/solo
http://www.grabup.com/uploads/38b5d7dbef1de2013d8545d2da79fe6f.png?direct
Again, making life easier for Railers, Congrats!!
This opens up a lot of awesome possibilities. Thanks Engine Yard guys for sponsoring this.
[...] has just announced the release of Passenger 2.2.0, a significant update to the dream-come-true Apache module for deploying Rack-based Ruby [...]
I have never been able to run EventMachine correctly inside Passenger for Apache… Maybe this will work for Nginx?
This is HUGE! Very cool, guys. Thanks to Engine Yard for sponsoring this project. I’m excited to see some benchmarks.
So. Excited.
Great stuff! Rails deployment is becoming easier and easier! thanks a million!
awesome! great job!
Great guys! Awesome to see you kicking so much ass! Can’t wait for your announcement at RailsConf.
How does this performance/scale compared to the apache version? If I have a long running rails request for example, does it block (consume) a whole nginx worker process?
That’s awesome, and something I’ve wished for over the last view months. Thanks, guys!
This is outstanding! * goes off to donate $ to this project *
Great job guys, I’ve been hoping for passenger support in nginx. I can finally ditch my apache installation.
One question though, while I was going through the advance installation to add some extra compile arguments I noticed that by default the install will add the –without-http_rewrite_module argument to the configuration command. Is there a reason it disables this module? I haven’t seen any mention of this in the user guide. I use the rewrite on some php apps I’m serving from nginx so I kind of need this module. Thanks.
This is most excellent! Way to go Phusion! Thanks to Engine Yard for the sponsorship!
Wow, fantastic, and thank you! Now I get to have more fun!
This is so cool. Thank you!
This is AWESOME guys. Just one quick request, can there be an “Option 3″ in the install to only give me the correct ./configure option for me to use myself? I am using it with MacPorts nginx (requires a small change to the portfile) but, there is no checkout of nginx to point the installer at, I had to get a tarball just to make the installer continue.
Thanks again for the awesome work!
This news just made my day.
Many thanks.
Rock, and as they say, Roll!
That’s epic news. When I got time I’ll modify my local development setup.
Yeaah! nginx+modrails it rock!
also easy to install again!
it rocks!
Thanks guys!
By the way, if anyone has an error ‘/bin/sh: bad interpreter: Permission denied’, just do mount -o remount,exec /tmp to make sure files in your /tmp (which is where the files are installed) are executable.
Totally rocks! Waiting for first impressions in production use
Good work guys!
This will be great for deployments where a full Apache installation would be overkill.
Oh, this is so cool!
Thanks for giving me nginx back!
zed is dead baby zed is dead!!!
Kudos guys!
[...] passenger доступен и для nginx. Ну что же – будем пробовать April 16th, 2009 in [...]
Wow, this is big news! Thanks a lot for the hard work.
[...] has just announced the release of Passenger 2.2.0, a significant update to the dream-come-true Apache module for deploying Rack-based Ruby [...]
Choice is good! At RailsCluster, we’ll continue to use Phusion Passenger for Apache because it allows user rewriting and other good things using .htaccess files.
Thank you to everyone involved.
Great news, great job!
Documentation bug report – content for 5.8.2 is wrong (identical to 5.8.3)
Leave it to you guys and what do you get??? SERIOUS AWESOMENESS
Thank you for this great addition to Passenger. You rock.
Great stuff guys! Thanks for your efforts. I might have to consider a move back to nginx now
.
I updated the Macports Portfile for nginx to also install passenger.
http://gist.github.com/96657
For those of you who are new to nginx like me, followed the screencast, and were wondering why you got a ‘Welcome to Nginx!’ page instead of your webapp, remove /opt/nginx/html/index.html (default location).
Wait, so if the joke is that this isn’t a joke, than that means that this actually is a joke?
Wow, totally unexpected. Great work guys.
My app is currently on an Nginx+Monit+Mongrel stack and I have been pushing off moving to mod rails because I wanted to stay with nginx. Sometimes pushing things off is a good thing it seems
Now I won’t have to make the switch. Fantastic work! Thanks!
Amazing!
Any word on a lighttpd release ?
Very nice! Cant wait to try this out.
Works great!
Nice work guys! Big win for Passenger! Hip Hip Hooray!
Wow, installation was like hitting the easy button. Even better than apache.
Greatest news of April. Awesome job, guys!
[...] made it! Phusion has released passenger with nginx support. No more bloated apache installs, hooray! I’ve been waiting for this [...]
[...] Passenger 支持 Nginx 了!4月份最让人激动的消息。 [...]
Awesome work. I made a little script to generate apache and nginx/passenger vhosts from a yaml file. Somebody might find it useful: http://github.com/burke/webconfig/tree/master
Kid-b의 생각…
짝짝짝!! 이제 그 어려운 설정 파일을 가진 apache를 안써도 되는구나!! ㅎ…
[...] April 17, 2009 Source: http://blog.phusion.nl/2009/04/16/phusions-one-year-anniversary-gift-phusion-passenger-220/ [...]
[...] Начиная с версии 2.2.0 Phusion Passenger приобрел поддержку nginx [...]
You guys Rock!!! Thank you!!
[...] See more here: Phusion’s One Year Anniversary Gift: Phusion Passenger 2.2.0 … [...]
Can’t build with nginx-0.7.51:
cc -c -pipe -g -DNGX_DEBUG_MALLOC -g -I /usr/local/include -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/local/include/libxml2 -I /usr/local/include -I objs -I src/http -I src/http/modules -I src/http/modules/perl -I src/mail -o objs/addon/nginx/Configuration.o /usr/home/osa/ports/www/nginx-devel/work/passenger-2.2.0/ext/nginx/Configuration.c
/usr/home/osa/ports/www/nginx-devel/work/passenger-2.2.0/ext/nginx/Configuration.c: In function `passenger_merge_loc_conf’:
/usr/home/osa/ports/www/nginx-devel/work/passenger-2.2.0/ext/nginx/Configuration.c:402: error: `ngx_garbage_collector_temp_handler’ undeclared (first use in this function)
/usr/home/osa/ports/www/nginx-devel/work/passenger-2.2.0/ext/nginx/Configuration.c:402: error: (Each undeclared identifier is reported only once
/usr/home/osa/ports/www/nginx-devel/work/passenger-2.2.0/ext/nginx/Configuration.c:402: error: for each function it appears in.)
/usr/home/osa/ports/www/nginx-devel/work/passenger-2.2.0/ext/nginx/Configuration.c:402: warning: passing arg 1 of `ngx_conf_merge_path_value’ from incompatible pointer type
/usr/home/osa/ports/www/nginx-devel/work/passenger-2.2.0/ext/nginx/Configuration.c:402: warning: passing arg 2 of `ngx_conf_merge_path_value’ from incompatible pointer type
/usr/home/osa/ports/www/nginx-devel/work/passenger-2.2.0/ext/nginx/Configuration.c:402: warning: passing arg 3 of `ngx_conf_merge_path_value’ from incompatible pointer type
/usr/home/osa/ports/www/nginx-devel/work/passenger-2.2.0/ext/nginx/Configuration.c:402: warning: passing arg 4 of `ngx_conf_merge_path_value’ makes pointer from integer without a cast
/usr/home/osa/ports/www/nginx-devel/work/passenger-2.2.0/ext/nginx/Configuration.c:402: error: too many arguments to function `ngx_conf_merge_path_value’
*** Error code 1
great news. thanks guys!
This is great news! Thanks a lot for your efforts guys. Just installed Passenger for Apache last week and am loving it. I’ll be sure to check the Nginx version as well
[...] http://blog.phusion.nl/2009/04/16/phusions-one-year-anniversary-gift-phusion-passenger-220/ Ruby nginx, passenger, phusion [...]
[...] Passenger now works in Nginx. Merb and Rails are going to merge to become Rails 3.0. Word has it that it won’t be [...]
You guys are my gods! Even the user-switching works. Love it!
wow!!
Am I dreaming?
It’s wonderful!
I’m going to moving to passenger with my nginx!
[...] Phusion Passenger 2.2.0 a été lancé hier, et c’est une nouvelle vesion qui permet de faire fonctionner Passenger avec nginx. Auparavant, c’était seulement compatible avec le serveur web Apache. C’est une bonne nouvelle pour les développeurs web Rails, qui ont maintenant plus de choix de déployement. SubscribeDiggdel.icio.usFacebookRedditStumbleUpon | (Pas de votes) [...]
[...] Phusion’s One Year Anniversary Gift: Phusion Passenger 2.2.0. Phusion has released a new version of Passenger that works with nginx. Previously, it was only available for the Apache web server. Good news for Rails developers, who now have more deployment choices. [...]
[...] pessoal da Phusion acabou de anunciar o release 2.2.0 do Passenger, uma atualização significante deste módulo para Apache que facilita o deployment de [...]
Great work! It’s a real surprise.
@sergey The newest nginx it will compile with is 0.7.43. This change broke it: http://gist.github.com/96873
This is great news. However, am I the only one that this isn’t working for? I get it installed alright, set my /etc/hosts, flush DNS, then go to the local address, and I get “Welcome to nginx!”. When I delete the index.html file in /opt/nginx/html I get “Permission Denied”. Seems like for some reason it is not picking up the server block in the config file. Anyone else having problems.
This is going to be great. Thanks for the hard work!
[...] Phusion’s One Year Anniversary Gift: Phusion Passenger 2.2.0 « Phusion Corporate Blog [...]
[...] Phusion’s One Year Anniversary Gift: Phusion Passenger 2.2.0 (with Nginx support) (tags: nginx ruby rails sysadmin) [...]
[...] Phusion Passenger 2.2.0 Phusion Passenger now available for nginx [...]
Instalando Nginx com Passenger…
Para quem acompanha o mundo Ruby On Rails soube que no dia 16 foi lançado o Passenger com suporte total para Nginx (Lê-se Engine X). Assim temos mais uma rápida opção de deployment para Ruby On Rails.
Para instalar, primeiro instala a gem do Passe…
[...] days ago, Phusion (@phusion_nl on Twitter) announced the release of Passenger 2.2.0, a significant update to the dream-come-true Apache module for deploying Rack-based Ruby [...]
This is Phusion ’s first year anniversary as a company.
Linux for Rails and its staff wish you an Happy Birtday.
Thank you Phusion for your job done.
[...] http://blog.phusion.nl/2009/04/16/phusions-one-year-anniversary-gift-phusion-passenger-220/ [...]
[...] Phusion Passenger 2.2.0 [...]
[...] For further Information klick here. [...]
[...] Phusion team released a new version of Passenger last week, 2.2.1, which sports a shiny new NGINX extension. It also adds chunked file uploads (Apache only) [...]
I’m already on mod_rails, feeling myself like get in the new car
[...] Vielzahl von Optionen. Die mit dem geringsten Aufwand ist aber sicherlich Passenger, das in der neusten Version jetzt auch für Nginx verfügbar ist. Gegenüber anderen Ruby Webservern wie Mongrel oder Thin hat Passenger zwar keinen [...]
[...] Phusion Passenger 2.2.0 w/ Nginx support After spending weeks on further development and intensive testing, we’ve now come to the point wherein we have the distinct honor to announce Phusion Passenger for Nginx as an addition to the Phusion Passenger server line-up.. Our thanks goes out to Engine Yard for financially sponsoring this first release of Phusion Passenger for Nginx, as well as all the people who have in some way donated in the past for making this release possible in the first place. [...]
[...] http://blog.phusion.nl/2009/04/16/phusions-one-year-anniversary-gift-phusion-passenger-220/ : Phusion Passenger, aussi connu sous le nom de mod_rails, sort en version 2.2.0 et est maintenant compatible avec le serveur web nginx. [...]
Good Job !
Is there any benchmarks Apache vs. Nginx ?
Thanks
Olivier
[...] most efficient setup appeared to be running nginx, Passenger-Nginx, and Ruby Enterprise Edition. It was actually pretty easy to get all this running and would have [...]
[...] all the pain once associated with deploying Ruby on Rails applications. Phusion Passenger recently added support for the nginx web server. My application required SSL support, but Phusion Passenger does not by default compile nginx [...]
[...] In praise of Slicehost October 30, 2009 mtjhax Leave a comment Go to comments I’ve been using Slicehost for some personal projects and prototype sites for about a year and, at the risk of sounding like I’m getting paid to pimp their service–which I absolutely am not, I gotta say I just love ‘em! I just moved a major web site from a 2GB dedicated server to a 512MB virtual slice (and it’s handling requests even faster than before after porting from Apache to Nginx + Phusion Passenger). [...]
[...] need to install passenger and nginx module for passenger in your remote machine according to this sudo gem install passenger sudo passenger-install-nginx-module the second command will tell you [...]
[...] [Image] google.setOnLoadCallback(function(){ var img = document.getElementById("icone-calendar-post"); img.src = "http://www.abricocotier.fr/wp-content/themes/cleaker-21/images/calendar.png"; }); [...]
[...] need to install passenger and nginx module for passenger in your remote machine according to this 12sudo gem install passenger sudo [...]
[...] lighttpd. Either of these two should save you a lot of ram, at least per static http connection. Passenger is available for nginx. October 31, 2009 3:04 [...]