Phusion, The Computer Science Company | Chamber of Commerce no 08173483 (Apeldoorn, The Netherlands) | info@phusion.nl

Ruby Enterprise Edition 1.8.7-2010.01 released

What is Ruby Enterprise Edition?

Ruby Enterprise Edition (REE) is a server-oriented distribution of the official Ruby interpreter, and includes various additional enhancements, such as:

REE can be easily installed in parallel to your existing Ruby interpreter, allowing you switch to REE with minimal hassle or risk. REE has been out for about a year now and is already used by many high-profile websites and organizations, such as New York Times, Shopify and 37signals.

“We switched to enterprise ruby to get the full benefit of the [copy-on-write] memory characteristics and we can absolutely confirm the memory savings of 30% some others have reported. This is many thousand dollars of savings even at today’s hardware prices.”
Tobias Lütke (Shopify)

Ruby Enterprise Edition is 100% open source.

Changes

Upgraded to Ruby 1.8.7-p248
The previous REE release was based on 1.8.7-p174.
Improved compiler optimization options
The previous REE release was compiled with -Os -fno-strict-aliasing.

-fno-strict-aliasing was used to avoid improper code generation by GCC 4.4. This was actually caused by some aliasing bugs in Ruby’s util.c source file. The problems have been fixed in 1.8.7-p174 so we’ve now removed this compilation flag, allowing for better compiler optimizations.

It turned out that -O2 yields better performance than -Os in many production environments, though some microbenchmarks might indicate otherwise. Therefore we’ve now replaced -Os with -O2.

Fixed OpenSSL extension compilation problems on systems with OpenSSL 1.0
At this time, upstream Ruby cannot be compiled on systems with OpenSSL 1.0 because of compatibility problems in the Ruby OpenSSL extension. Fedora 12 includes OpenSSL 1.0. We’ve applied a patch by the Fedora guys and added some minor changes to fix some compilation warnings. These patches have been send upstream. Ruby issue #2022.
Backported an IO#write exception bug fix
Upstream Ruby 1.8.7-p248 has a bug in its IO#write method: it always raises Errno::EINVAL even when a different error occured. We found this problem while testing Phusion Passenger on this Ruby release.

We’ve submitted a patch upstream. This patch is also applied in this REE release.

Thread timer fix now merged upstream
Previous REE releases included Joe Damato’s and Aman Gupta’s thread timer fix. This fix has now found its way back upstream and is included by default in 1.8.7-p248, so we’ve removed the patch from our source tree.
Fix a crash bug in the zero-copy context switching patch set
This crash can be reproduced by running “god”, which will eventually cause a crash. Aman Gupta has fixed this problem.

Please note that the zero-copy context switching patch set is disabled by default, and must be explicitly enabled by passing –fast-threading to the installer. It is currently still marked as experimental because there are some known issues with the Kernel::fork method. Issue #9.

Ubuntu package now contains debugging symbols
Previous REE Ubuntu packages that we release had binaries with debugging symbols stripped, in order to minimize the package sizes. We no longer strip the debugging symbols now because Joe and Aman’s Memprof depends on the presence of debugging symbols. Memprof should work out-of-the-box with this release of REE.

Please note that although the binaries are larger, this does not affect performance in any way. The debugging symbols are only used for debugging and introspection purposes and do not affect the runtime behavior of Ruby at all.

Developer documentation is now installed by default
RDoc and RI documentation are now installed by default. You can avoid this by passing --no-dev-docs to the installer.

The Ubuntu packages include developer documentation.

Installer now checks for the existence of the ‘patch’ utility
This fixes bug #10.
Some documentation updates
Parts are contributed by Trevor Turk.

Download & upgrade

To install Ruby Enterprise Edition, please visit the download page. To upgrade from a previous version, simply install into the same prefix that you installed to last time. Please also refer to the documentation for upgrade instructions.

Phusion Passenger 2.2.9 released

Phusion Passenger is an Apache and Nginx module for deploying Ruby on Rails web applications, and is mainly focused on ease of use and stability.

Recent changes

Phusion Passenger is under constant maintenance and development. We are pleased to announce Phusion Passenger version 2.2.9. This is a bug fix release.

Fixed compatibility with Rails 3.

Actually, previous Phusion Passenger releases were already compatible with Rails 3, depending on the spawn method that would be invoked. Here’s the story:

Since Phusion Passenger 2.2.8, when the file config.ru exists, Phusion Passenger will treat the app as a Rack app, not as a Rails app. This is in contrast to earlier versions which gave Rails detection more priority than Rack detection. Phusion Passenger loads Rack apps and Rails apps in different ways. The Rails loader was not compatible with Rails 3, which is what we’ve fixed in this release.

That said, a Rails 3 app would have worked out-of-the-box on Phusion Passenger 2.2.8 as well because Rails 3 apps include a config.ru file by default, causing Phusion Passenger 2.2.8 to use the Rack loader. Earlier versions of Phusion Passenger would just completely bail out because they’d use the Rails loader.

With 2.2.9 there are still some caveats:

  • Smart spawning (the mechanism with which REE’s 33% memory reduction is implemented) is *not* supported for Rack apps. This means that if you want to utilize smart spawning with Rails 3, then you should remove your config.ru file.
  • Rails 3 depends on Rack 1.1.0. You must have Rack 1.1.0 installed as a gem, even if you’ve bundled it with the gem bundler. This is because Phusion Passenger itself depends on Rack.

Both of these caveats are temporary. We have plans to solve both of these properly in the future.

What’s up with the Gem Bundler?

There has been some reports that Phusion Passenger is not compatible with Yehuda Katz’s gem bundler. This might have been true for an earlier version of the gem bundler, but the latest version seems to work fine. Please note that you need to insert the following snippet in config/preinitializer.rb, as instructed by the gem bundler’s README:

require "#{RAILS_ROOT}/vendor/gems/environment"

The Rails::Boot monkey patching code as posted here does not seem to be required anymore.

Fixed support for ActiveRecord subclasses that connect to another database.
ActiveRecord subclasses that connect to a database other than the default one did not have their connection correctly cleared after forking. This can result in weird errors along the lines of "Lost connection to MySQL server during query". Issue #429.
[Nginx] Fixed PCRE URL.
passenger-install-nginx-module downloads PCRE 7.8 if PCRE is not already installed. However PCRE 7.8 has been removed from their FTP server, so we’ve updated the URL to point to the latest version, 8.0.

How do I upgrade to 2.2.9?

Via a gem

Please install it with the following command:

gem install passenger

Next, run:

passenger-install-apache2-module

Or, if you’re an Nginx user:

passenger-install-nginx-module

Please don’t forget to copy & paste the Apache/Nginx config snippet that the installer gives you.

Via a native Linux package

John Leach from Brightbox has kindly provided an Ubuntu 8.04 package 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 2.2.9, 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 2.2.8 released

Phusion Passenger is an Apache and Nginx module for deploying Ruby on Rails web applications, and is mainly focused on ease of use and stability.

Recent changes

Phusion Passenger is under constant maintenance and development. We are pleased to announce Phusion Passenger version 2.2.8. This is a bug fix release.

[Nginx] Fixed some signal handling problems.
Restarting Nginx on OS X with SIGHUP can sometimes take a long time or even fail completely. This is because of some signal handling problems, which have now been fixed.
[Nginx] Added OpenSSL as dependency.
OpenSSL is required in order to install Nginx, but this was not checked by passenger-install-nginx-module. As a result, passenger-install-nginx-module fails on e.g. out-of-the-box Ubuntu installations until the user manually installs OpenSSL. Issue #422.
[Nginx] Fixed support for internal redirects and subrequests.
It is now possible to, for example, point X-Accel-Redirects to Phusion Passenger-served URLs. Patch contributed by W. Andrew Loe III: issue #433.
[Apache] Fixed a GnuTLS compatibility issue
mod_gnutls can cause Phusion Passenger to crash because of an unchecked NULL pointer. This problem has now been fixed: issue #391.
Fixed thread creation issue on Intel Itanium platforms.
This fixes issue #427.
Fixed compilation problems on Linux running on the Renesas SH4 CPU.
Patch contributed by iwamatsu: issue #428.
The Rack library has been unvendored.
The original reason for vendoring was to work around broken Rails applications that explicitly specify Rack as a gem dependency. We’ve found a better workaround that does not require vendoring Rack. This also fixes a compatibility problem with Rails 3, because Rails 3 depends on a newer Rack version than the one we had vendored. Issue #432.
Fixed compatibility with Ruby 1.9.1 patchlevel >= 152

Ruby 1.9.1 patchlevel >= 152 has a bug in its tempfile library. If you’ve seen an error message along the lines of

*** Exception IOError in Passenger RequestHandler (closed stream)

then this is a Ruby bug at work. This bug has been fixed in Ruby 1.9.2, but Ruby 1.9.1 still contains this bug. We’ve added a workaround so that the bug is not triggered with this Ruby version. Issue #432.

How do I upgrade to 2.2.8?

Via a gem

Please install it with the following command:

gem install passenger

Next, run:

passenger-install-apache2-module

Or, if you’re an Nginx user:

passenger-install-nginx-module

Please don’t forget to copy & paste the Apache/Nginx config snippet that the installer gives you.

Via a native Linux package

John Leach from Brightbox has kindly provided an Ubuntu 8.04 package 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 2.2.8, 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!

Google Tech Talk on Ruby Enterprise Edition

Last Friday we visited the awesome Googleplex and gave a tech talk there about Ruby Enterprise Edition. This talk elaborates a bit on how REE works under the hood. Many thanks to John Woodell for making this possible!

techtalk

Phusion Passenger 2.2.7 released

Sorry, I made a mistake while releasing 2.2.6. In the past few days we’ve closed about 30 issues in our issue tracker, but in the mids of it I forgot to remove a single line of debugging code in passenger-install-apache2-module, causing it not to compile the Apache module. I’ve just released 2.2.7 which fixes this problem, and it should be indexed by RubyForge any time now. Our apologies again for the inconvenience.

Phusion Passenger 2.2.6 released

Phusion Passenger is an Apache and Nginx module for deploying Ruby on Rails web applications, and is mainly focused on ease of use and stability. It is under constant maintenance and development. We are pleased to announce Phusion Passenger version 2.2.6. This is a bug fix release.

This will be one of the last 2.2.x releases. Next in the pipeline is 3.0. We believe that all the upcoming changes will be well worth the version number bump. But more about this in a later blog post. :)

Anyway, the following things have changed since 2.2.5:

Fixed compatibility with /tmp cleaners such as tmpwatch
Some /tmp cleaner programs such as tmpwatch try to remove subdirectories in /tmp/passenger.xxx after a while because they think those subdirectories are unused. This could cause Phusion Passenger to malfunction, requiring a web server restart. Measures have now been taken to prevent those tmp cleaner programs from removing anything in /tmp/passenger.xxx. Issue #365.
Autodetection now gives more priority to Rack than to Rails
When autodetecting the application type, Rack is now given more priority than Rails. This allows one to drop a config.ru file in a Rails directory and have it detected as a Rack application instead of a Rails application. Patch contributed by Sam Pohlenz: issue #338.
Increased default socket backlog
The default socket backlog has been increased from ‘SOMAXCONN’ (which is 128 on most platforms) to 1024. This should fix most ‘helper_server.sock failed: Resource temporarily unavailable’ errors.
Apache fixes
The location of the ‘apxs’ and ‘apr-config’ commands can now also be passed to the installer through the –apxs-path and –apr-config-path parameters, in addition to the $APXS2 and $APR_CONFIG environment variables. Issue #3.
Nginx fixes and changes
Various problems that only occur on 64-bit platforms (such as Snow Leopard) have been fixed.
The installer now installs Nginx 0.7.64 by default.
Various other fixes
Fixed compilation problems on Solaris. Issue #369 and issue #379.
Fixed crashes on PowerPC.
Some Ruby 1.9 compatibility fixes. Issue #398.
The installer now displays correct dependency installation instructions for Mandriva Linux.

How do I upgrade to 2.2.6?

Via a gem

Please install it with the following command:

gem install passenger

Next, run:

passenger-install-apache2-module

Or, if you’re an Nginx user:

passenger-install-nginx-module

Please don’t forget to copy & paste the Apache/Nginx config snippet that the installer gives you.

Via a native Linux package

John Leach from Brightbox has kindly provided an Ubuntu 8.04 package 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 2.2.6, 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!

Ruby Enterprise Edition 1.8.7-2009.10 released

What is Ruby Enterprise Edition?

Ruby Enterprise Edition (REE) is a server-oriented distribution of the official Ruby interpreter, and includes various additional enhancements, such as:

REE can be easily installed in parallel to your existing Ruby interpreter, allowing you switch to REE with minimal hassle or risk. REE has been out for about a year now and is already used by many high-profile websites and organizations, such as New York Times, Shopify and 37signals.

“We switched to enterprise ruby to get the full benefit of the [copy-on-write] memory characteristics and we can absolutely confirm the memory savings of 30% some others have reported. This is many thousand dollars of savings even at today’s hardware prices.”
Tobias Lütke (Shopify)

And just like Phusion Passenger, Ruby Enterprise Edition is 100% open source.

Changes

New version numbering scheme
We don’t use full date version numbers anymore. Instead we now use the release year and a sequence number. To avoid confusion we’ve given this release the sequence number 10.

The reason for this change is to allow milestone planning in our issue tracker. It’s kinda inconvenient to assign issues to future milestones if you don’t know their version numbers.

Fixed floating point calculation issues on GCC 4.4
GCC 4.4 produces incorrect floating point code because of aliasing issues in the Ruby source code. This causes floating point calculations to generate incorrect results. We’ve fixed this by compiling REE with -fno-strict-aliasing. Issue #2.
Removed -fno-stack-protector
The previous version was compiled with the -fno-stack-protector flag, which disables the stack protector. The stack protector is a compiler feature for reducing the effectiveness of buffer overflow attacks. We disabled the stack protector because the author of the MBARI patches recommended so for performance reasons.

Some systems such as Solaris as well as older Linux versions did not support the -fno-stack-protector flag, causing compilation to fail.

We’ve found that enabling the stack protector does not cause any noticeable degrade in performance, so we’ve removed the -fno-stack-protector flag, allowing the platform to decide whether to enable it or not. This not only improves security on platforms where the stack protector is enabled by default, but also fixes the compilation problems that some people were having. Issue #3.

Snow Leopard compatibility issues fixed
The tcmalloc memory allocator has some issues with Snow Leopard, so we’ve disabled tcmalloc on Snow Leopard. It’s still enabled for Leopard and other supported platforms.
Backported a File.open memory leak fix
Apparently File.open leaks memory. We’ve backported the leak fix.

Please note that this fix is not included in the latest upstream Ruby 1.8.7 release (p174). If you’re not an REE user then we strongly recommend applying this patch yourself.

The installer now checks for ‘make’
The installer used to fail silently if make isn’t installed. Issue #4.
Various minor changes
  • Upgraded tcmalloc to version 1.4
  • The installer now installs the ‘pg’ gem instead of ‘postgres’, because ‘pg’ is newer, has more features and is under more active maintenance.
  • The Linux x86_64 bootstrap binary has been recompiled so that it works on systems with a glibc version older than 2.7. This allows the installer to run out-of-the-box on e.g. x86_64 CentOS 5.2.

Download & upgrade

To install Ruby Enterprise Edition, please visit the download page. To upgrade from a previous version, simply install into the same prefix that you installed to last time. Please also refer to the documentation for upgrade instructions.

Ruby Enterprise Edition 1.8.7-20090928 released

In the not so distant past we launched a Ruby Enterprise Edition sponsorship campaign. We’ve been working hard on the code since that time. And although the campaign target hasn’t been reached, we’ve decided to release it anyway because we believe that this release is of great importance to the community.

Just how important is this release? Well, Twitter has beta tested this release and they’re reporting roughly 30% improvement in throughput. Keep reading to learn more and follow us on @phusion_nl for the latest updates.

Summary of changes

It’s now based on Ruby 1.8.7-p174

Previous REE releases were based on 1.8.6. We were initially reluctant about switching to 1.8.7: many people reported various incompatibility problems introduced by 1.8.7, and it seemed that alternative Ruby implementors were boycotting 1.8.7. However, the tide has now changed. Rails 3.0 will drop support for Ruby versions earlier than 1.8.7, JRuby had recently decided to support 1.8.7 and OS X Snow Leopard as well as all the Linux distros ship 1.8.7. We’ve received a lot of requests from the community for a 1.8.7-based version.

In short, everybody is moving towards 1.8.7, and we can’t afford to stay behind.

We were initially planning to release a final 1.8.6-based version, but after carefully considering the current state of things, we decided to skip the 1.8.6 release and jump directly to 1.8.7. 1.8.7 is also more compatible with 1.9, allowing a smoother transition to future Ruby versions.

The MBARI patches have been integrated
Brent Roman’s MBARI patch set uses a variety of techniques to significantly reduce Ruby’s memory usage. It also adds a bunch of performance optimizations, useful features and bug fixes.

  • Ruby’s garbage collector scans the C stack conservatively. This means that any data on the C stack that might look like a pointer pointing to a valid Ruby object will be treated like a real pointer, causing the object to be retained during garbage collection. Because of the way Ruby is written and because of compiler optimizations, there may be a lot of such “pointers” on the stack, even when they’re not really pointers but just garbage data that like look pointers.

    Brent has refactored and modified many parts of Ruby in order to reduce the possibility of such “garbage pointers” occurring on the stack. As a result, garbage collection will be much more effective. Many objects that would otherwise not have been freed will be freed thanks to the MBARI patches.

    As a side-effect of the reduced memory usage, applications typically run faster as well. Not only because applications are less likely to be swapped out, but also because modern hardware’s performance depends greatly on the amount of memory traffic.

  • Ruby uses an inefficient, linear time algorithm for extending the stack space when switching context between threads and/or continuations. This is mostly noticeable when you have a lot of threads. Brent replaces this with a constant time algorithm, which is much faster.
  • It adds the methods __file__ and __line__ to the Method, UnboundMethod and Proc classes. Very useful for inspecting large code bases that make heavy use of metaprogramming. These methods are documented in the Ruby Enterprise Edition manual.

We’ve ported his patch set to 1.8.7-p174. Especially Twitter benefited a lot from these patches.

The zero-copy context switching patch have been integrated as an optional feature
Joe Damato and Aman Gupta have created a patch which implements zero-copy context switching in Ruby’s threading system. In Ruby 1.8, whenever Ruby switches context to another thread, it has to copy over the entire thread stack. This is very expensive, and the deeper your function calls are nested, the slower it becomes. The zero-copy context switching patch removes the need to copy any stack data; instead, it keeps all thread stacks at different areas in memory and simply changes the stack pointer. In extreme situations, this patch can increase threading performance by as much as 10 times!

Phusion Passenger is not really affected by this patch because its request handling core is not multithreaded, at least not at this moment. But Mongrel is heavily multithreaded and will benefit tremendously from this patch.

We’ve made this patch compatible with the MBARI patch set, but there are currently some issues with 64-bit platforms, so we’ve disabled it by default. You can enable it by running the REE installer with --fast-threading

Various other minor changes
  • When compiling REE, binaries are optimized for size (-Os), not speed. See below for an explanation.
  • The tcmalloc memory allocator has been upgraded to version 1.3
  • RubyGems upgraded to version 1.3.5.
  • The Debian package now installs files to /usr/local, so that one doesn’t have to mess with $PATH to get things working.

In practice

This release has been beta tested with Twitter. Evan Weaver reported significant improvements in Twitter’s throughput after having switched to this REE release.

REE benchmark by Twitter

Twitter especially benefited from the MBARI patch set. We’ve found a few unexpected things during the beta testing phase:

  • We’ve found that optimizing Ruby for code size (compilation with -Os) yields better results that optimizing Ruby for speed (compiling with -O2). Ruby is a very unconventional program and we suspect that optimizing for code size allows more instructions to fit in the CPU instruction cache, resulting in better performance.
  • Microbenchmarks and synthetic benchmarks such as the Ruby benchmark suite do not show any performance improvements at all, although Twitter was able to measure a significant performance improvement. As always, benchmark results should be taken with a grain of salt.

Other major beta testers include 37signals and Novell. They’re still in the progress of testing, and we’re eager to receive their test results.

Sponsors

Special thanks go out to LVS for acting as a gold sponsor for this release:

LVS has been building and supplying enterprise platforms for the betting and gaming industry in South East Asia, Europe and the UK for more than 10 years. The team at LVS is a balanced mix of gaming industry specialists, technical experts and entrepreneurial leaders. With offices in London and Gibraltar we directly employ over 40 staff.

Our Advanced Betting Platform (a fully internationalized and localized high-availability platform based on Java and Ruby on Rails) is now regarded as the most technically advanced sports book system available in the World, and has been customised to fit the requirements of companies like Victor Chandler in Gibraltar and La Française des Jeux in France.

LVSLogo

We also thank the following people and organizations for sponsoring this release:

Download & upgrade

To install Ruby Enterprise Edition, please visit the download page. To upgrade from a previous version, simply install into the same prefix that you installed to last time. Please also refer to the documentation for upgrade instructions.

UPDATE: Snow Leopard support

It looks like tcmalloc has some issues on Snow Leopard, causing the compiler to crash. We’ve just been able to obtain Snow Leopard last weekend (it had been sold out for several weeks) and we haven’t gotten around installing it yet.

To install REE on Snow Leopard, you should run the installer with --no-tcmalloc

Passenger Prefpane Update

Passenger Preference Pane provides a convenient GUI for OSX users to deploy their webapps with Phusion Passenger. However, some updates in Mac OS X Snow Leopard caused Passenger Preference Pane to stop working correctly. Thankfully, Alloy was quick to address these. Go check it out.

Phusion Passenger 2.2.5 released

Phusion Passenger is an Apache and Nginx module for deploying Ruby on Rails web applications, and is mainly focused on ease of use and stability.

Introducing the announcements mailing list

We now have an announcement-only mailing list for new Phusion Passenger releases. This mailing list can also be used for packagers to announce packaging updates. Future versions will no longer be announced on the discussion board, so discussion board subscribers who wish to be notified about new versions should subscribe to this announcements mailing list as well.

If you’re a packager and you’d like to have posting access to the announcements list, then please post a message on the discussion board.

Recent changes

Phusion Passenger is under constant maintenance and development. We are pleased to announce Phusion Passenger version 2.2.5. This is a bug fix release.

The following things have changed since 2.2.4:

[Apache] Small file uploads are now buffered; fixes potential DoS attack
Phusion Passenger buffers large file uploads to temp files so that it doesn’t block applications while an upload is in progress, but it sent small uploads directly to the application without buffering it. This could result in a potential DoS attack: the client can send many small, incomplete file uploads to the server, and this would block all application processes until a timeout occurs. In order to solve this problem, Phusion Passenger now buffers small file uploads in memory. Bug #356.
[Apache] Fixed support for mod_rewrite passthrough rules

Mod_rewrite passthrough rules were not properly supported because of a bug fix for supporting encoded slashes (%2f) in URLs. Unfortunately, due to bugs/limitations in Apache, we can support either encoded slashes or mod_rewrite passthrough rules, but not both; supporting one will break the other.

Support for mod_rewrite passthrough rules is now enabled by default; that is, support for encoded slashes is disabled by default. A new configuration option, PassengerAllowEncodedSlashes, has been added. Turning this option on will enable support for encoded slashes and disable support for mod_rewrite passthrough rules.

Issue #113 and issue #230.

[Apache] Added a configuration option for resolving symlinks in the document root path

Phusion Passenger 2.2.0 and higher no longer resolves symlinks in the document root path in order to properly support Capistrano-style directory structures. The exact behavior is documented in the Users Guide, section "How Phusion Passenger detects whether a virtual host is a web application".

However, some people relied on the old behavior. A new configuration option, PassengerResolveSymlinksInDocumentRoot, has been added to allow reverting back to the old behavior.

Patch contributed by Locaweb.

[Apache] mod_env variables are now also passed through CGI environment headers

Prior to version 2.2.3, environment variables set by mod_env are passed to the application as CGI environment headers, not through Ruby’s ENV variable. In the last release we introduced support for setting ENV environment variables with mod_env, and got rid of the code for setting CGI environment headers. It turns out that some people relied on the old behavior, we so now environment variables set with mod_env are set in both ENV and in the CGI environment.

Fixes bug #335.

[Apache] Fixed compilation problems on some Linux systems with older versions of Apache

If you used to see compilation errors like this:

ext/apache2/Configuration.cpp:554: error: expected primary-expression before '.' token

then this version should compile properly.

[Apache] Fixed I/O timeouts for communication with backend processes
Got rid of the code for enforcing I/O timeouts when reading from or writing to a backend process. This caused more problems than it solved.
[Nginx] Support for streaming responses (e.g. Comet or HTTP push)

Buffering of backend responses is now disabled. This fixes support for streaming responses, something which the Apache version has supported for a while now. One can generate streaming responses in Ruby on Rails like this:

render :text => lambda { |response, output|
    10_000.times do |i|
        output.write("hello #{i}!\n")
    end
}
[Nginx] Installer now installs Nginx 0.7.61 by default
Previously it installed 0.6.37 by default.
[Nginx] Fixed the installer’s –extra-configure-flags flag when combined with –auto-download
Arguments passed to –extra-configure-flags were not being passed to the Nginx configure script when –auto-download is given. This has been fixed: bug #349.
[Nginx] Fixed unnecessary download of PCRE
The installer now checks whether PCRE is installed in /opt/local (e.g. MacPorts) as well before concluding that it isn’t installed and going ahead with downloading PCRE.
Fixed STDERR capturing

While spawning an application, Phusion Passenger captures any output written to STDERR so that it can show them later if the application failed to start. This turns out to be much more difficult than expected, with all kinds of corner cases that can mess up this feature.

For example, if the Rails log file is not writable, then this can cause Rails to crash with a bizarre and unhelpful error message whenever it tries to write to STDERR:

/!\ FAILSAFE /!\  Thu Aug 20 14:58:39 +1000 2009
Status: 500 Internal Server Error
undefined method `[]' for nil:NilClass

Some applications reopen STDERR to a log file. This didn’t work.

Of all of these problems have been fixed now. (Bug #332)

Fixed some bugs in application sources preloading

Rails >= 2.2 already preloads the application sources, in which case Phusion Passenger wasn’t supposed to perform it’s own preloading, but the Rails >= 2.2 detection code was bugged. This has been fixed.

Rails < 2.2 doesn’t preload the application sources by itself, but there should be a certain order with which the sources are preloaded, otherwise preloading could fail in some applications. We now enforce a specific load order: first models, then controllers, then helpers.

Bug #359.

Fixed a few bugs in WSGI compliance
PATH_INFO is supposed to be set to the request URI, but without the query string and without the base URI. This has been fixed: bug #360.
Other things
Fixed some Ruby 1.9-specific crashes caused by encoding issues. Bug #354.
Fixed loading of config/environment.rb on Ruby 1.9.2, because Ruby 1.9.2 no longer has "." in the default load path. Patch by metaljastix, issue #368.
The Users Guide for Apache now mentions something about correct permissions for application directories.
Fixed compilation problems on IA-64 (bug #118). We also reduced the stack sizes for the threads by half, so Phusion Passenger should use even less virtual memory now.
Fixed compilation problems on Linux systems with ARM CPU.
Fixed a few compatibility problems with 64-bit OpenBSD.
Fixed a few typos and minor bugs.

Wait, what about Snow Leopard?

There are some known issues with Snow Leopard, though we do not yet know what these issues exactly are, what causes them or how to fix them. We haven’t upgraded yet because Snow Leopard is sold out in all local stores. Please check the discussion board for updates about Snow Leopard support.

How do I upgrade to 2.2.5?

Via a gem

Please install it with the following command:

gem install passenger

Next, run:

passenger-install-apache2-module

Or, if you’re an Nginx user:

passenger-install-nginx-module

Please don’t forget to copy & paste the Apache/Nginx config snippet that the installer gives you.

Via a native Linux package

John Leach from Brightbox has kindly provided an Ubuntu 8.04 package 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 2.2.5, 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!

Hongli Lai Ninh Bui