Phusion Passenger 3.0.2 released
Phusion Passenger is an Apache and Nginx module for deploying Ruby web applications. It has a strong focus on ease of use, stability and performance. Phusion Passenger is built on top of tried-and-true, battle-hardened Unix technologies, yet at the same time introduces innovations not found in most traditional Unix servers. Since version 3.0 it can also run standalone without an external web server, making it not only easier for first-time users but also ideal on development environments.
Recent changes
Phusion Passenger is under constant maintenance and development. We are pleased to announce Phusion Passenger version 3.0.2. This is a bug fix release.
- [Nginx] Fixed compilation problems
- The Nginx compilation process was broken due to not correctly reverting the working directory of the Nginx configure script. This has been fixed: issue #595.
- [Nginx] Fixed crash if passenger_root refers to a nonexistant directory
- Issue #599.
- Fixed compilation problems on NetBSD
- There was a typo in a NetBSD-specific fcntl() call. It also turns out that NetBSD doesn’t support some ISO C99 math functions like llroundl(); this has been worked around by using other functions. Issue #593.
- Fixed file descriptor closing issues on FreeBSD
- Phusion Passenger child processes didn’t correct close file descriptors on FreeBSD because it queries /dev/fd to do that. On FreeBSD /dev/fd only returns meaningful results if fdescfs is mounted, which it isn’t by default. Issue #597.
How do I upgrade to 3.0.2?
Via a gem
First install the gem with the following command:
gem install passenger
If you’re using Phusion Passenger for Apache or for Nginx, then re-run the Apache or Nginx module installer, whichever is appropriate:
passenger-install-apache2-module passenger-install-nginx-module
At the end the installer will tell you to paste a configuration snippet into your web server config file. Replace the old snippet that you already had with this new one.
Phusion Passenger Standalone users don’t need to run anything else. Whenever you type
passenger start
it will automatically upgrade itself.
Via a native Linux package
John Leach from Brightbox has kindly provided Ubuntu packages for Phusion Passenger. The package is available from the Brightbox repository which you can find at:
http://apt.brightbox.net
Add the following line to the Third Party Software Sources:
deb http://apt.brightbox.net hardy main
(The simplest way to do that is to create a file in /etc/apt/sources.list.d/ containing the deb instruction, and then run ‘apt-get update’).
Once you’ve done this then you can install Phusion Passenger by running:
sudo apt-get install libapache2-mod-passenger
-or-
sudo apt-get install nginx-brightbox
(Note that John is currently packaging 3.0.2, so it might take a while before this release shows up in the apt repository.)
Final
Phusion Passenger is provided to the community for free. If you like Phusion Passenger, please consider sending us a donation. Thank you!
Phusion Passenger 3.0.1 released
Phusion Passenger is an Apache and Nginx module for deploying Ruby web applications. It has a strong focus on ease of use, stability and performance. Phusion Passenger is built on top of tried-and-true, battle-hardened Unix technologies, yet at the same time introduces innovations not found in most traditional Unix servers. Since version 3.0 it can also run standalone without an external web server, making it not only easier for first-time users but also ideal on development environments.
Recent changes
Phusion Passenger is under constant maintenance and development. We are pleased to announce Phusion Passenger version 3.0.1. This is a bug fix release.
- MUCH faster compilation
- We’ve applied code aggregation techniques, allowing Phusion Passenger to be compiled much quicker now. For example, compiling the Nginx component (not Nginx itself) on a MacBook Pro now takes only 29 seconds instead of 51 seconds, an improvement of 75%! Compiling the Apache module on a slower Dell Inspiron now takes 39 seconds instead of 1 minute 22 seconds, or 110% faster!
- Fixed malfunction after web server restart
- On Linux systems that have a non-standard filesystem on /tmp, Phusion Passenger could malfunction after restarting the web server because of a bug that’s only triggered on certain filesystems. Issue #569.
- Boost upgraded to version 1.44.0.
- We were on 1.42.0.
- Much improved startup error messages
- Phusion Passenger performs many extensive checks during startup to ensure integrity. However the error message in some situation could be vague. These startup error messages have now been improved dramatically, so that if something goes wrong during startup you will now more likely know why.
- Curl < 7.12.1 is now supported
- The previous version fails to compile with Curl versions earlier than 7.12.1. Issue #556.
- passenger-make-enterprisey fixed
- This is the command that people can run after donating. It allows people to slightly modify Phusion Passenger’s display name as a joke. In 3.0.0 it was broken because of a typo. This has been fixed.
- Removed passenger-stress-test
- This tool was used during the early life of Phusion Passenger for stress testing websites. Its performance has never been very good and there are much better tools for stress testing, so this tool has now been removed.
- [Apache] RailsEnv and RackEnv configuration options are now equivalent
- In previous versions, RailsEnv only had effect on Rails 1 and Rails 2 apps while RackEnv only had effect on Rack apps. Because Rails 3 apps are considered Rack apps, setting RailsEnv had no effect on Rails 3 apps. Because this is confusing to users, we’ve now made RailsEnv and RackEnv equivalent. Issue #579.
- [Nginx] Fixed compilation problems on systems with unpowerful shells
- Most notably Solaris. Its default shell does not support some basic constructs that we used in the Nginx configure script.
- [Nginx] Upgraded default Nginx version to to 0.8.53
- The previous default was 0.8.52.
- [Nginx] passenger_enabled now only accepts ‘on’ or ‘off’ values
- Previously it would recognize any value not equal to ‘on’ as meaning ‘off’. This caused confusion among users who thought they could also specify ‘true’, so we now throw a proper error if the value is unrecognized. Fixes issue #583.
How do I upgrade to 3.0.1?
Via a gem
First install the gem with the following command:
gem install passenger
If you’re using Phusion Passenger for Apache or for Nginx, then re-run the Apache or Nginx module installer, whichever is appropriate:
passenger-install-apache2-module passenger-install-nginx-module
At the end the installer will tell you to paste a configuration snippet into your web server config file. Replace the old snippet that you already had with this new one.
Phusion Passenger Standalone users don’t need to run anything else. Whenever you type
passenger start
it will automatically upgrade itself.
Via a native Linux package
John Leach from Brightbox has kindly provided Ubuntu packages for Phusion Passenger. The package is available from the Brightbox repository which you can find at:
http://apt.brightbox.net
Add the following line to the Third Party Software Sources:
deb http://apt.brightbox.net hardy main
(The simplest way to do that is to create a file in /etc/apt/sources.list.d/ containing the deb instruction, and then run ‘apt-get update’).
Once you’ve done this then you can install Phusion Passenger by running:
sudo apt-get install libapache2-mod-passenger
-or-
sudo apt-get install nginx-brightbox
(Note that John is currently packaging 3.0.1, so it might take a while before this release shows up in the apt repository.)
Final
Phusion Passenger is provided to the community for free. If you like Phusion Passenger, please consider sending us a donation. Thank you!
Phusion Passenger 3.0.0 final released
Phusion Passenger is an Apache and Nginx module for deploying Ruby web applications. It has a strong focus on ease of use, stability and performance. Phusion Passenger is built on top of tried-and-true, battle-hardened Unix technologies, yet at the same time introduces innovations not found in most traditional Unix servers. Since version 3.0 it can also run standalone without an external web server, making it not only easier for first-time users but also ideal on development environments.
What’s new compared to 2.2
Phusion Passenger 3 is a major new release and brings about many, many improvements in the areas of performance, features and stability. It is fully compatible with the latest technologies such as Rails 3.0, Ruby 1.9.2, RVM and Bundler.
You can read about the improvements in Phusion Passenger 3 through a set of articles that we had written on this subject:
- Technology Preview 1: Performance
Phusion Passenger 3 can be up to 55% faster than Phusion Passenger 2.2. - Technology Preview 2: Stability, robustness, availability, self-healing
We’ve implemented many safeguards to keep Phusion Passenger stable and running as much as possible. - Technology Preview 3: Closing the gap between development and production & rethinking the word “easy”
Describes how Phusion Passenger’s usage model differs from Mongrel’s, Thin’s and Unicorn’s and when one would prefer our model over the other and vice versa.
Introduces Phusion Passenger Standalone (formerly called Phusion Passenger Lite) which can be used as a potentially improved replacement for Mongrel, Thin and Unicorn. - Technology Preview 4: Adding new features and removing old limitations
- Bonus article: Phusion Passenger & running multiple Ruby versions
What’s new compared to 3.0.0 RC 1
- [Apache] `passenger-install-apache2-module –snippet` no longer prints ANSI color codes
- This makes it possible to pipe its output directly to a config file. Fixes issue #548.
- [Apache] Fixed thread stack size problems on FreeBSD
- Previously it might crash for bizarre reasons.
- [Nginx] Upgraded to Nginx 0.8.52 by default
- This is because Nginx 0.8 has recently become the stable release series.
- [Standalone] Fixed Unix domain socket support
- There was a bug in Phusion Passenger Standalone which would cause the `-S` option to fail.
How do I upgrade to 3.0.0?
Via a gem
First install the gem with the following command:
gem install passenger
If you’re using Phusion Passenger for Apache or for Nginx, then re-run the Apache or Nginx module installer, whichever is appropriate:
passenger-install-apache2-module passenger-install-nginx-module
At the end the installer will tell you to paste a configuration snippet into your web server config file. Replace the old snippet that you already had with this new one.
Phusion Passenger Standalone users don’t need to run anything else. Whenever you type
passenger start
it will automatically upgrade itself.
Via a native Linux package
John Leach from Brightbox has kindly provided Ubuntu packages for Phusion Passenger. The package is available from the Brightbox repository which you can find at:
http://apt.brightbox.net
Add the following line to the Third Party Software Sources:
deb http://apt.brightbox.net hardy main
(The simplest way to do that is to create a file in /etc/apt/sources.list.d/ containing the deb instruction, and then run ‘apt-get update’).
Once you’ve done this then you can install Phusion Passenger by running:
sudo apt-get install libapache2-mod-passenger
-or-
sudo apt-get install nginx-brightbox
(Note that John is currently packaging 3.0.0, so it might take a while before this release shows up in the apt repository.)
Final
Phusion Passenger is provided to the community for free. If you like Phusion Passenger, please consider sending us a donation. Thank you!
Phusion Passenger 3.0.0 RC 1 released
This is it, the first Release Candidate (internally named “pre 4″). A few more bugs have been fixed since beta 3, but if no more serious bugs are found then the next release will be 3.0.0 final.
What’s new
- Autodetection of Ruby tool commands now take exe extension, –program-prefix and –program-suffix into account
-
Phusion Passenger had a pretty elaborate way of searching the system for Ruby tool commands like ‘gem’, ‘rake’, etc. The reason why all this search code exists is because the problem is much more complicated than just searching for “rake” in $PATH. A significant number of people have multiple Ruby versions installed on their system; let’s call these Ruby A and Ruby B. They run the Phusion Passenger installer with Ruby A and they installed the required gems with Ruby A’s RubyGems, but they have a Rake in $PATH that belongs to Ruby B. If we were to naively use the Rake in $PATH then the wrong Rake will be invoked and they would wonder why the gems they just installed aren’t detected. Our Ruby tool search code tries very hard to find the Rake that belongs to the Ruby interpreter that’s currently running.
However the code didn’t take the exe extension into consideration, as well as the –program-prefix and –program-suffix that Ruby could be configured with. For example, on some systems the Ruby command is called “ruby1.8″ and Rake is called “rake1.8″. Similarly, the default JRuby binary distribution calls Rake “jrake”. We’ve now updated our search code to take this into account as well. Issue #537.
Usability and ease of installation remains to be one of our biggest goals. As you can see we’ve gone through great lengths to make sure that everything works as expected and that everything is as fool-proof as possible, even if the system might not be entirely correctly configured.
- Fixed linking problems on some systems
- Phusion Passenger uses math functions such as
pow(). On some systems — .e.g. NetBSD, some versions of Solaris and some Linux distros — this requires Phusion Passenger to be linked to the Math library. Issue #539. - Phusion Passenger Standalone fix
- When Phusion Passenger Standalone is daemonized with -d, it exits with a non-zero exit code. This has been fixed. Issue #536.
- Preferred PCRE version upgraded to version 8.10
- passenger-install-nginx-module automatically installs PCRE for you in case you didn’t already have it.
Installation/upgrade
First install the latest Phusion Passenger gem:
gem install passenger --pre
(Or you can download the tarball.)
If you want to install or upgrade the Apache or Nginx version, then run the installer as you’re used to:
passenger-install-apache2-module passenger-install-nginx-module
At the end the installer will tell you to paste a configuration snippet. If you’re upgrading then replace the old snippet with the new one.
If you want to run Phusion Passenger Standalone, then run:
cd /path-to-your-app passenger start
No special upgrade instructions needed.
The documentation
Users guide for Apache
Users guide for Nginx
Users guide for Standalone
Phusion Passenger & running multiple Ruby versions
One of the questions we’ve been getting a lot lately is whether it’s possible to run multiple Ruby versions with Phusion Passenger, e.g. have app A and B run on Ruby 1.8.7 while having app C run on Ruby 1.9.2. In previous versions of Phusion Passenger there were ways to get around that, e.g. by mixing in Mongrels. As of Phusion Passenger 3 you can run all components as Phusion Passenger.
The setup that we currently recommend is to combine Phusion Passenger for Apache or Phusion Passenger for Nginx, with Phusion Passenger Standalone. One must first identify the Ruby version that you use most. One then proceeds with setting up Phusion Passenger for Apache or Phusion Passenger for Nginx to use that Ruby version. All applications that are to use a different Ruby version can be served separately through Phusion Passenger Standalone and hook into the main web server via a reverse proxy configuration.
Example

Suppose that you have four websites:
- foo.com, to run on Ruby 1.8.7.
- bar.com, to run on Ruby 1.8.7.
- fries.com, to run on Ruby 1.9.1.
- hamburgers.com, to run on Ruby 1.9.2.
And suppose that you’re using RVM to manage these Rubies.
Setting up foo.com and bar.com (Ruby 1.8.7)
The Ruby version that you use most is Ruby 1.8.7, so you setup Apache or Nginx to use Ruby 1.8.7 and to serve foo.com and bar.com.
rvm use 1.8.7 gem install passenger --pre # Then one of: passenger-install-apache2-module passenger-install-nginx-module
# Partial Apache configuration
PassengerRuby /home/someuser/.rvm/wrappers/ruby-1.8.7/ruby
<VirtualHost *:80>
ServerName www.foo.com
DocumentRoot /webapps/foo.com/public
</VirtualHost>
<VirtualHost *:80>
ServerName www.bar.com
DocumentRoot /webapps/bar.com/public
</VirtualHost>
# Partial Nginx configuration
passenger_ruby /home/someuser/.rvm/wrappers/ruby-1.8.7/ruby
server {
listen 80;
server_name www.foo.com;
root /webapps/foo.com/public;
passenger_enabled on;
}
server {
listen 80;
server_name www.bar.com;
root /webapps/bar.com/public;
passenger_enabled on;
}
foo.com and bar.com have now been deployed on Phusion Passenger for Apache or Phusion Passenger for Nginx, and running on Ruby 1.8.7.
Setting up fries.com (Ruby 1.9.1)
The next step is to start fries.com in Phusion Passenger Standalone using Ruby 1.9.1. Since port 80 is already used by Apache or Nginx, we use start Phusion Passenger Standalone on a different port.
rvm use 1.9.1 gem install passenger --pre cd /webapps/fries.com passenger start -a 127.0.0.1 -p 3000 -d
Fries.com is now running on localhost port 3000 as a background daemon. Next, connect it to Apache or Nginx via a reverse proxy.
# Partial Apache configuration
<VirtualHost *:80>
ServerName www.fries.com
DocumentRoot /webapps/fries.com/public
PassengerEnabled off
ProxyPass / http://127.0.0.1:3000
ProxyPassReverse / http://127.0.0.1:3000
</VirtualHost>
# Partial Nginx configuration
server {
listen 80;
server_name www.fries.com;
root /webapps/fries.com/public;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $host;
}
}
Setting up hamburgers.com (Ruby 1.9.2)
We do the same thing for hamburgers.com. Port 3000 is already in use, so we assign it to port 3001.
rvm use 1.9.2 gem install passenger --pre cd /webapps/hamburgers.com passenger start -a 127.0.0.1 -p 3001 -d
Then we hook it up to the web server via reverse proxying.
# Partial Apache configuration
<VirtualHost *:80>
ServerName www.hamburgers.com
DocumentRoot /webapps/hamburgers.com/public
PassengerEnabled off
ProxyPass / http://127.0.0.1:3001
ProxyPassReverse / http://127.0.0.1:3001
</VirtualHost>
# Partial Nginx configuration
server {
listen 80;
server_name www.hamburgers.com;
root /webapps/hamburgers.com/public;
location / {
proxy_pass http://127.0.0.1:3001;
proxy_set_header Host $host;
}
}
Performance tip
Phusion Passenger Standalone also supports listening on a Unix domain socket instead of a TCP socket. Unix domain sockets are significantly faster than TCP sockets.

Only Nginx supports reverse proxying to Unix domain sockets; Apache does not support this.
In order to make Phusion Passenger Standalone listen on a Unix domain socket, you need to run it with Nginx 0.8.21 or higher. In fact we contributed support for Unix domain sockets to Nginx specifically for this feature!
Start Phusion Passenger Standalone like this:
passenger start --socket /tmp/fries.com.socket -d --nginx-version 0.8.50
The --socket option tells Phusion Passenger to bind to the given Unix domain socket. The --nginx-version option tells Phusion Passenger Standalone to use Nginx 0.8; 0.7 is the default.
Next you must setup an Nginx upstream block with the Unix domain socket as the only entry. Then setup Nginx to reverse proxy to the created upstream block.
upstream fries_upstream {
server unix:/tmp/fries.com.socket;
}
server {
listen 80;
server_name www.fries.com;
root /webapps/fries.com/public;
location / {
proxy_pass http://fries_upstream;
proxy_set_header Host $host;
}
}
It should be noted that Phusion Passenger for Apache and Phusion Passenger for Nginx already use Unix domain sockets internally for optimal performance. In fact we’ve done this since version 1.0. We plan on elaborating more about our internal technologies in a future blog post.
Conclusion
Those of you who are familiar with Mongrel and Thin will see the similarity. Indeed, Phusion Passenger Standalone was designed to be able to used in a reverse proxy environment such as the one demonstrated in this article. Unlike Mongrel and Thin clusters however you only need a single Phusion Passenger Standalone instance per web application and thus only a single address to proxy to. Phusion Passenger Standalone will take care of starting and stopping application processes for you and will make sure processes are restarted when they crash.
Phusion Passenger 3.0.0 public beta 3 released
What’s new
- More RVM issues fixed
- A lot of people who happen to use RVM have reported various problems. Some of the symptoms include:
- The spawn server crashes during startup.
- Phusion Passenger Standalone prints ‘command not found’ errors.
It turned out that these problems occur when one has an older RVM version installed. Phusion Passenger depends on features provided by relatively new RVM versions. We’ve added sanity checks in Phusion Passenger so that it warns you if it detects an old RVM installation.
You can upgrade your RVM installation by running these commands:
rvm update --head rvm reload rvm repair all
We’ve also fixed support for system-wide RVM installs.
- Aggressively checks for permissions
- Many problems that people report on the Phusion Passenger discussion board are actually caused by wrong permissions set on the application files or on one of the parent directories. We’ve added aggressive permission checking code in Phusion Passenger. If any permissions are wrong then it will tell the user exactly which directory has wrong permissions and how to fix it. This should make Phusion Passenger a lot more fail-proof than before.
- Fixed some more compilation problems
- These problems occur on some systems but not on others.
- Fixed passenger-status crash
- When passenger-status tries to tell the user that it needs to be run as root, it used to crash instead because of a typo.
- Phusion Passenger Standalone checks for GNU make on FreeBSD
- Phusion Passenger Standalone depends on the GNU version of make in order to be able to show a compilation progress bar.
Installation/upgrade
First install the latest Phusion Passenger gem:
gem install passenger --pre
(Or you can download the tarball.)
If you want to install or upgrade the Apache or Nginx version, then run the installer as you’re used to:
passenger-install-apache2-module passenger-install-nginx-module
At the end the installer will tell you to paste a configuration snippet. If you’re upgrading then replace the old snippet with the new one.
If you want to run Phusion Passenger Standalone, then run:
cd /path-to-your-app passenger start
No special upgrade instructions needed.
The documentation
Users guide for Apache
Users guide for Nginx
Users guide for Standalone
Phusion Passenger 3.0.0 public beta 2 released
Thanks to all the users who have provided constructive feedback! This release fixes all newly reported issues so far.
- Phusion Passenger Standalone now correctly handles paths with spaces in them
- Beta 1 would error out with a weird message.
- Fixed some RVM support issues
- If you’re using RVM and you had problems with beta 1, try this version. Thanks to Wayne for helping out!
- Improved watchdog startup error checking
- If the watchdog crashes during startup then the reason wasn’t always obvious. We’ve improved the startup error checking code so that more error information can be collected.
- Fixed Phusion Passenger Standalone binary compatibility string generation
- The binary compatibility string is generated from many components, including part of the output of ‘uname -p’. It turns out that on some systems that command outputs in an unexpected format.
- Fixed curl error detection
- Curl is used to download things when wget is not available. Beta 1 did not correctly recognize cases in which curl exit because of an HTTP 404 error.
- Fixed PassengerMinInstances default value on Apache
- It’s supposed to be 1, but in beta 1 it was accidentally still 0.
- Fixed support for older Apache 2 versions
- Beta 1 used API calls which are only available in newer versions.
- Fixed various compilation warnings
- Including warnings on CentOS 5 and Ubuntu 10.04.
Installation/upgrade
First install the latest Phusion Passenger gem:
gem install passenger --pre
(Or you can download the tarball.)
If you want to install or upgrade the Apache or Nginx version, then run the installer as you’re used to:
passenger-install-apache2-module passenger-install-nginx-module
At the end the installer will tell you to paste a configuration snippet. If you’re upgrading then replace the old snippet with the new one.
If you want to run Phusion Passenger Standalone, then run:
cd /path-to-your-app passenger start
No special upgrade instructions needed.
The documentation
Users guide for Apache
Users guide for Nginx
Users guide for Standalone
Phusion Passenger 3.0.0 public beta 1 is out!
Phusion Passenger is software with which one can deploy Ruby web applications on the Apache or Nginx web server. Now, with the release of version 3.0.0 beta 1, it also comes with a standalone version that does not require an external web server. Please read http://www.modrails.com/ for details.
In the past period we’ve blogged extensively about the progress of Phusion Passenger 3. Many exciting changes have been introduced. It’s been a long ride, but today we are happy to announce the first Phusion Passenger 3 public beta! We’ve already tested Phusion Passenger 3 extensively in private, and now we’re giving the community a chance to test it as well in order to make the final release rock-solid.
We’ve received a lot of emails from people who are excited about Phusion Passenger 3. Thank you all for your support!
To recap, we’ve described Phusion Passenger 3 extensively in our past Technology Preview articles:
- Technology Preview 1: Performance
Phusion Passenger 3 can be up to 55% faster than Phusion Passenger 2.2. - Technology Preview 2: Stability, robustness, availability, self-healing
We’ve implemented many safeguards to keep Phusion Passenger stable and running as much as possible. - Technology Preview 3: Closing the gap between development and production & rethinking the word “easy”
Describes how Phusion Passenger’s usage model differs from Mongrel’s, Thin’s and Unicorn’s and when one would prefer our model over the other and vice versa.
Introduces Phusion Passenger Standalone (formerly called Phusion Passenger Lite) which can be used as a potentially improved replacement for Mongrel, Thin and Unicorn. - Technology Preview 4: Adding new features and removing old limitations
Except for mass deployment, all features described in the technology previews are available as open source in Phusion Passenger 3. A few more changes have been made since the last Technology Preview:
- The ‘PassengerPreStart’ option
- In Technology Preview 4 we described PassengerMinInstances. That option ensures that, at least x instances will be kept around once they’ve been spawned, but it does not ensure that instances are immediately spawned up during web server start. Instead we have a separate configuration option for that, called PassengerPreStart. PassengerPreStart and PassengerMinInstances and the reason why they’re separate configuration options are described extensively in the manual.
- RVM support
- RVM is becoming more and more popular. Previous versions of Phusion Passenger work fine with RVM, but one has to follow special installation instructions for it to work properly. We’ve noticed that many users are not aware of this and as a result couldn’t get Phusion Passenger working properly with RVM. In Phusion Passenger 3 we’ve collaborated with Wayne E. Seguin and added special support for RVM so that everything should work out-of-the-box, without special installation instructions.
Other minor changes
For completeness, here are a list of minor changes that have not been described in the Technology Previews so far:
- Nginx is now compiled with SSL support by default.
- Nginx can now be compiled on a noexec /tmp filesystem. Fixes bug #380.
- Support for Nginx 0.8.
- Dropped support for Nginx 0.6.
- Much better Ruby 1.9.2 support. Our unit test suite has been refactored; Ruby 1.9.2 passes our unit test suite 100%.
- The PassengerFriendlyErrorPages option has been added. This allows you to turn off the friendly error pages that Phusion Passenger normally displays in the event of an error, so that only a standard 500 error page is shown. This is documented in the manual.
- The PassengerDebugLogFile option has been added. This is documented in the manual.
- User switching support has been made more flexible through the PassengerUser, PassengerGroup, PassengerDefaultUser and PassengerDefaultGroup options. These are documented in the manual.
- RailsSpawnMethod has been renamed to PassengerSpawnMethod because we now support smart spawning for Rack apps as well.
- passenger-install-apache2-module and passenger-install-nginx-module can now be run concurrently without the one deleting files compiled by the other.
- #at_exit blocks are now called during application process shutdown.
- passenger-install-apache2-module now supports a –snippet option. When this option is given, the command outputs the Apache configuration snippet that should be pasted, but doesn’t do anything else.
- Temporary files that Phusion Passenger places in /tmp are touched every 6 hours. This prevents /tmp cleaner daemons that are present on many systems from deleting these temp files that are essential for Phusion Passenger’s functioning. Bug #365.
Install
Installation is almost the same as Phusion Passenger 2. Type:
gem install passenger --pre
If you want to install the Apache or Nginx version, then run the installer as you’re used to:
passenger-install-apache2-module passenger-install-nginx-module
Or you can download the tarball.
If you want to run Phusion Passenger Standalone, then run:
cd /path-to-your-app passenger start
The documentation
Users guide for Apache
Users guide for Nginx
Users guide for Standalone
Things to come
Although Phusion Passenger 3.0 brings many exciting improvements, it is only the beginning. In parallel to Phusion Passenger 3, we have been working on some interesting things which we plan to reveal to the world shortly after the release of Phusion Passenger 3.0. Please stay tuned for future developments.
The Road to Passenger 3: Technology Preview 4 – Adding new features and removing old limitations
In the past two years that we’ve been developing Phusion Passenger, we’ve received not only many feature requests but also many criticisms about certain limitations. Some feature requests have been implemented in Phusion Passenger 2.x, some have not. Some limitations were solved in the life time of Phusion Passenger 2, others were not because they require a lot of refactoring first. In Phusion Passenger 3 we’ve extensively refactored the code to not only make a lot of new cool features possible, but also to lift a lot of the old limitations. In this Technology Preview we are pleased to announce these changes.
Asynchronous spawning

Previously, when application processes are being spawned, Phusion Passenger is unable to handle HTTP requests until the processes are done spawning, because Phusion Passenger is holding the lock on the application pool while this is happening. Some websites have apps that need a very long time to spawn (30+ seconds) and this would be a problem for them. This behavior would also cause a “thundering herd” problem: suppose that a traffic spike appears, then the first request will cause Phusion Passenger to spawn a process. The other requests in the spike are blocked until that’s done, and then all of a sudden they are processed. Phusion Passenger thinks it needs to spawn more, so it spawns another one and blocks the rest, and so on. This can cause a large number of processes to be spawned all of a sudden, causing a long delay.

In Phusion Passenger 3 spawning happens in the background so that no clients have to be blocked. This turns out to work so well that application process spawning is now virtually unnoticeable, except when spawning the first application process.
Ability to configure minimum number of processes
Phusion Passenger automatically shuts down processes that haven’t been accessed for a while, where “a while” is configurable through the PassengerPoolIdleTime directive. Many web applications are rarely accessed during the night, so what happens is that all application processes are shut down during the night and the first person in the morning who accesses the web application has to wait for some time while the first application process is being spawned. This problem could be solved by setting PassengerPoolIdleTime to 0 or to a large number which means that processes are kept around forever or for a long time, but this also means that application processes are not shut down during the night, which might still be desirable for resource utilization reasons.
Phusion Passenger 3 introduces a new, long-awaited configuration directive: PassengerMinInstances. As its name implies, PassengerMinInstances makes sure that at least the given number of processes will be started and kept around. This, in combination with asynchronous spawning, turns out to work so well that we’ve assigned a default value of 1 for PassengerMinInstances. With Phusion Passenger 3, spawning delays should become a thing of the past!
Smart spawning support for all Rack applications
Smart spawning is a core feature of Phusion Passenger since version 1.0. It can reduce the spawning time of Rails processes by as much as 90%, and in combination with Ruby Enterprise Edition it allows you to save 33% memory on average.
However, smart spawning was limited to Rails applications only, not for Rack applications. Starting from Rails 3, all Rails 3 applications are also Rack applications, and Phusion Passenger 2 only supports smart spawning of Rails 3 applications if you remove config.ru (thereby forcing Phusion Passenger to detect it as a Rails app, not a Rack app).
Phusion Passenger 3 now supports smart spawning for all Rack applications. This works transparently and without further configuration.
Ability to access individual application processes over HTTP

When one sends a request to the web server, Phusion Passenger routes the request to one of the application processes, but one never knows up front which one that’s going to be, nor is there a way to control it. This is fine for normal requests, but sometimes one wants to send a request to a specific application process, e.g. to debug something. Another use case for accessing individual application processes directly is broadcasting messages: e.g. telling every application process to clear some local in-memory caches.
This has always been possible with reverse proxy app servers like Mongrel and Thin because each of their processes listen on their own port. Phusion Passenger 3 now also allows one to access individual application processes directly. Each application process can now be accessed through its own TCP socket port. The port numbers are randomly allocated by the operating system and the protocol is plain HTTP, so you can use existing tools like ‘curl’.
We take security very seriously. These sockets are bound to 127.0.0.1 so it’s not possible to access them from remote computers. Furthermore, each socket is protected by its own unique randomly generated secure password. One can use ‘passenger-status’ to query the ports and passwords.
Global queuing now on by default
Many people with web apps that have long-running requests are familiar with the “slow Mongrel queue problem”. When one sets up Mongrel or Thin behind Nginx or Apache, it’s possible for new requests to be queued behind a Mongrel/Thin instance which is currently processing a long-running request. When other Mongrel/Thin instances become available, this new request is already queued behind the long-running request and cannot migrate to the other free instances. The more long-running requests one has the bigger of a problem this can become, resulting to very long response times for some users.
There are multiple ways to solve this problem, but Phusion Passenger has already solved this problem for a long time with a feature that we call global queuing. It was disabled by default because turning global queuing off would yield a little bit of extra performance in microbenchmarks. However for version 3.0 we’ve decided to turn it on by default: rather than saving those few milliseconds in benchmarks, we believe it’s much more important that all users get to have fair response times.
Ability to disable friendly error pages
One of the innovations that Phusion Passenger has brought us is the ability to show friendly error messages directly in the browser, e.g. when the web application fails to spawn because of a syntax error. This dramatically improves usability for developers, new and experienced alike, because one doesn’t have to manually dig into log files anymore. However this is not always desirable in production: although the error page is developer-friendly, it isn’t necessarily user-friendly. It might also expose information that the system administrator would rather not expose such as filenames.
Phusion Passenger 3 introduces a new configuration directive for controlling whether friendly error pages should be shown: ‘PassengerFriendlyErrorPages’. When turned off, Phusion Passenger will display the standard Apache/Nginx 500 Internal Server Error page instead, but all error messages are still logged to the web server error log file.
Nginx-specific improvements

In Phusion Passenger 3, Nginx is compiled with SSL support by default due to popular demand.
We’ve also introduced the following new configuration options:
- passenger_set_cgi_param (name) (value)
- This is the Phusion Passenger equivalent of proxy_module’s proxy_set_header. It allows you to pass arbitrary CGI environment parameters the web application.
- passenger_buffer_response (on|off)
- This is the Phusion Passenger equivalent of proxy_buffer. It was and still is off by default to allow streaming responses, but when streaming responses aren’t necessary one can turn this option on so that Nginx can gracefully handling clients that are slow at receiving responses.
- passenger_ignore_client_abort (on|off)
- This is the Phusion Passenger equivalent of proxy_ignore_client_abort.
In other news
In Technology Preview 3 we unveiled Phusion Passenger Lite. Based on various feedback that we’ve gotten since then, we’ve decided to rename this thing to Phusion Passenger Standalone in order to reduce confusion about what it is.
Towards the future
If there is one thing we’ve come to understand over time is that different businesses have different needs and constraints when it comes to deploying their applications. In order to provide the best experience and support to these businesses, we’re working on different versions of Phusion Passenger to accommodate them even better in their respective environments. In light of this, we want to underline that the technology previews we’re currently writing about will and have described the cool stuff that will be incorporated in the version intended for the most high demand environments. More information on this will follow. Having said that, almost everything we’ve blogged about up till this point will be included in the version that’s available for everybody.
The Road to Passenger 3: Technology Preview 3 – Closing the gap between development and production & rethinking the word “easy”
Update: “Phusion Passenger Lite” has been renamed to “Phusion Passenger Standalone” nowadays. The mass deployment feature has also been removed but will find its way back in the near future in a commercial version of Phusion Passenger.
Before Phusion Passenger came along, the most widely used Ruby app servers all implemented the same model which we refer to as the reverse proxy model. In this model, the user had to manually setup a bunch of app server processes and had to configure the web server to proxy requests to the app server processes. The technically inclined understand this model, but it is confusing to e.g. newcomers and to people who in general don’t have a lot of system administration skills or a reasonable understanding of HTTP. Most people were and still are much more familiar with PHP’s model, where you tell the web server where your app is and then have the web server take care of the rest for you. It was this confusion that caused all the uproar about sucky Rails deployment back in 2008.
While developing Phusion Passenger for Apache, we decided to follow a PHP-like model because ease of use was one of our main goals. No manual setups of app servers. No manual proxy configuration. Upload and go. For Phusion Passenger for Nginx, we continued to follow this model. Let’s call this the automatic model. As of 2010, Phusion Passenger appears to be the only widely-used Ruby app server that implements this model; the other widely-used Ruby app servers implement the reverse proxy model.
Reverse proxy vs automatic model: which one is better?
Ever since Phusion Passenger was first released, debates popped up about which one is superior. We believe that no model is inherently superior to the other. They are just different, meaning that both models have their own pros and cons. Which one is better for you depends a lot on your server infrastructure and your system administrators’ preferences.
Phusion Passenger’s automatic model:
- Integrated into the web server. Processes are managed along with the web server itself, and configuration happens in the web server config file.
- Easier to comprehend for most people. Appears more “standard stack” to system administrators who are not familiar with Ruby specifically.
- Can spawn and shutdown processes dynamically according to traffic patterns.
- Processes are automatically monitored: if they crash they are automatically restarted.
- Less manual control over individual processes because they can come and go at any time.
Reverse proxy model as implemented by most other Ruby app servers:
- App server is a separate entity. Processes are managed distinctly from the web server itself. Configuration happens outside the web server.
- Many people have a hard time comprehending this and they generally find setups like this cumbersome, but to experts this model can be seen as simple, elegant and sensible.
- Most app servers do not automatically restart crashed processes and one needs to monitor processes separately with things like Monit.
- One needs to specify the number of processes up front: no dynamic process count scaling according to traffic.
- Allows fine-grained manual control over individual processes.
We are not commenting on which points are supposed to be pros and which points are supposed to be cons because they are highly subjective. For us, integration into the web server is a strong plus because we host dozens of apps on our server(s) and we don’t like to spend time managing app server processes for each app, but other people are uncomfortable with having the web server manage things automatically and would prefer to keep a close eye on everything.
The automatic model can also be problematic to people who were on the reverse proxy model because they already had their web servers and infrastructures configured in a certain way. Switching to Phusion Passenger could mean changing a lot of web server configuration.
The hidden but unutilized potential
Reverse proxy model app servers can potentially have an extra advantage, but for some reason this hasn’t been implemented to its full potential so far:
Reverse proxy app servers are just easier to get started with. When you’ve just created a new Rails app, you can start it with script/server and you’re ready to go.
This works great in development but totally blows up in production. Reverse proxy model app servers must be put behind a reverse proxy e.g. Nginx or HAProxy for a variety of reasons such as security, load balancing between processes, handling of slow clients, etc. In production environments nobody exposes Mongrel or Thin directly to the Internet. Unicorn even explicitly documents that it is designed to be put behind a reverse proxy and that it doesn’t bother with slow clients at all.
In contrast, Phusion Passenger 2.x requires one to configure the web server, meaning the user must first install a web server. This is cumbersome when you’re in development and just want to get started. It is also cumbersome if you’re a newcomer and aren’t familiar with Apache or Nginx, and you just want to get your app running on your server.
Do you type script/server in development instead of creating a virtual host in the Apache or Nginx? Well you’re not the only one: we also do this until we eventually get sick of it, but there’s always a mental blockade that tells us that editing the web server configuration file is too much work to bother with.
Well, until Phusion Passenger 3 comes along.
Phusion Passenger Lite: fusion between the reverse proxy and the automatic model
In addition to Phusion Passenger for Apache and Phusion Passenger for Nginx, Phusion Passenger 3 introduces a new component to the existing lineup: Phusion Passenger Lite.
When it comes to usage, its interface is almost identical to that of Mongrel and Thin. To run your Ruby web app, just type this in the terminal and you’re ready to go:
passenger start
Closing the gap between development and production
Phusion Passenger Lite consists of an Nginx core. Nginx is known to be extremely scalable, high-performance and lightweight. You do not need to have Nginx already installed; this is automatically taken care of. You also do not need to have any Nginx experience: Nginx is hidden from the user but its power is automatically utilized.
Unlike Mongrel, Thin and Unicorn, Phusion Passenger Lite can be directly exposed to the Internet. It can serve static files at blazing speeds thanks to the Nginx core. Mongrel and Thin can serve static files but they aren’t very good at it. Unicorn doesn’t even try.
Easy migration from existing reverse proxy app servers
Because the interface is so similar, you can easily swap Mongrel, Thin or Unicorn in your existing reverse proxy setup and replace it with Phusion Passenger Lite. Unlike Mongrel and Thin, Phusion Passenger Lite only has to listen on a single socket instead of multiple, vastly simplifying your reverse proxy configurations. Phusion Passenger Lite can listen on a Unix domain socket instead of a TCP socket, just like Thin and Unicorn. In reverse proxy setups this can yield much higher performance than TCP sockets.
Advantages over existing reverse proxy app servers
Unlike Mongrel, Thin and Unicorn, Phusion Passenger Lite can dynamically spawn and shutdown processes according to traffic. However you can also configure it to use a static number of processes! In fact you can configure a minimum and a maximum and have Phusion Passenger Lite automatically figure out the number of processes to use for the current traffic.
Like Phusion Passenger for Apache/Nginx and Unicorn, worker processes that have crashed are automatically restarted.
That said, bear in mind that this advantage can be a disadvantage to some people. At its heart, Phusion Passenger Lite still manages processes for you, so you don’t have as much fine-grained control over the processes as you do with other reverse proxy app servers.
Advantage over Phusion Passenger for Apache and Phusion Passenger for Nginx
Another unintended advantage of Phusion Passenger Lite is that it runs as the same user as the shell and respects environment variables that are defined for your shell, e.g. things like PATH, LD_LIBRARY_PATH, RUBYOPT, GEM_PATH and GEM_HOME.
- Some people find that their app cannot load a certain library when the app is started in Phusion passenger, but can when the app is started with e.g. Mongrel or Thin. This is almost always caused by some environment variable that’s set in the shell but not in the web server: everything you set in /etc/bashrc and friends don’t have effect on processes started from the web server.
- Some people say that their application does not start on Phusion Passenger, but does under Mongrel/Thin. Very often this turns out to be just a permission issue or some web server configuration issue.
With Phusion Passenger Lite, even confusion like this will be a thing of the past.
Rethinking the word “easy”: automatic mass deployment
Phusion Passenger is considered by many people the easiest Ruby app server out there. But can it be easier? After some heavy thinking outside the box, we believe the answer is yes, it certainly can!
Imagine having a directory full of Ruby web apps, e.g. ~/Sites. To deploy an app, just drop your application’s directory into ~/Sites. To undeploy it, remove the application’s directory. The application directory’s name is used as the domain name. No manually signaling the web server for a restart.
This is exactly what we’ve done with Phusion Passenger Lite. We call this feature automatic mass deployment. Check out this demo.
So from now on, if you have a bunch of Ruby web apps in the same directory, just run this command in that directory
sudo passenger start -p 80 -u (some_unprivileged_username)
and you’ve immediately deployed every single app!
Conclusion
Phusion Passenger Lite does not replace Phusion Passenger for Apache or Phusion Passenger for Nginx. Rather, it is a complement to our existing lineup of Phusion Passenger products, optimized for different use cases. Phusion Passenger Lite closes the gap between development and production and can be used comfortably and easily in both. It can act as a drop-in replacement for your existing reverse proxy based setup. It makes Ruby web app deployment even easier than before: now you don’t even need a separate web server. On the other hand, if you need integration into the web server, then Phusion Passenger for Apache/Nginx is for you.
We hope you’ve enjoyed this Technology Preview. Please stay tuned for the next one because we have more exciting news for you!


Phusion. All rights reserved.