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

Archive for the ‘Phusion Passenger’ Category

Phusion Passenger 2.2.11 released

This release fixes a regression that appeared in 2.2.10 which only affects Apache. When under high load, Apache might freeze and stop responding to requests. The regression was caused by an attempt in 2.2.10 to fix various file descriptor passing problems. The fix introduced a race condition in one of the Phusion Passenger components, and since the problem only occurs under certain high-concurrency workloads it escaped our last release testing.

This problem does not affect Nginx; you only have to upgrade if you’re using Apache.

More information about the problem can be found at the following discussion thread: http://groups.google.com/group/phusion-passenger/t/d5bb2f17c8446ea0

How do I upgrade to 2.2.11?

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.11, 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.10 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.10. This is a bug fix release.

  • Fixed some Bundler compatibility problems.
  • Fixed some file descriptor passing problems, which previously could lead to mysterious crashes.
  • Fixed some compilation problems on newer GCC versions. Issue #430.
  • Support #size method in rack.input.

How do I upgrade to 2.2.10?

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.10, 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.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!

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!

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

Phusion Passenger 2.2.4 released

We’re releasing Phusion Passenger 2.2.4 because two problems have been discovered which we deem important enough. The changes are as follows:

[Apache] Fixed a memory leak
Along with revamping the Apache module’s I/O routines, we accidentally introduced a memory leak. It leaks about 8 KB of memory per request. Our apologies for this.
Fixed Rack::Utils::HeadersHash#delete
The Rack::Utils::HeadersHash class is used for representing HTTP headers in Rails and possibly other frameworks. Unfortunately a recent version of this class contains a bug, which breaks the responds_to_parent plugin, among other things. This has been fixed: Rack issue #54.

How do I upgrade to 2.2.4?

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.

(Note that RubyForge might still be distributing the files to their mirrors, so you might temporarily get “404 Not Found” errors until all mirrors are updated.)

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.4, so it might take a while before this release shows up in the apt repository.)

Phusion Passenger 2.2.3 released – Bug Fix Edition

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.

Announcing the “Bug Fix Edition”

Phusion Passenger has gained a lot of features lately, with the most prominent one being Nginx support. A lot of software become more bloated and more buggy over time, and their documentation become outdated. But we at Phusion strive to maintain a high level of quality. Thus, after the release of version 2.2.2, we decided to focus our efforts on polishing Phusion Passenger, which means:

  • Fixing as many outstanding bugs as possible, instead of introducing new major features.
  • When introducing new features, only introduce those for which there is a lot of demand and that do not affect stability too much.
  • Spending time on improving the documentation and keeping it up-to-date.
  • Improving error messages. Nothing is more frustrating than seeing that something went wrong, but not knowing that it exactly is.
  • Improving overall usability. Even though Phusion Passenger is server software and our user base is generally knowledgeable, we still think usability is important and we take it very seriously.

The result is version 2.2.3, which we informally call the “Bug Fix Edition”. Over the course of two months, we’ve committed more than 80 change sets. Approximately 7500 lines of code has been changed, and approximately 45 bugs have been fixed.

The summary of changes – which we’ve attempted to sort based on importance – are as follows. Unless marked otherwise, a change affects both Apache and Nginx.

Fixed sub-URI deployments for Rails 2.2+ apps
Sub-URI deployments has been broken on Rails 2.2+ apps for some time now. This is because Rails 2.2 changed the way the sub-URI deployments are handled for the sake of thread-safety. Sub-URI deployments on Rails 2.2 was no longer automatic and required one to change config.action_controller.relative_url_root in environment.rb. We’ve fixed this issue so that sub-URI deployment is once again automatic, without the need to set config.action_controller.relative_url_root manually. Fixes issue #169.
Fixed many compilation problems
The most prominent fix affects GCC 4.4 support. GCC is included in e.g. Fedora 11.
Compilation problems on OpenBSD, Solaris and OpenSolaris have also been fixed.
On OpenBSD, please note however that Phusion Passenger for Apache doesn’t work because of severe limitations in their pthreads implementation. The Nginx version works fine, so we recommend OpenBSD users to use Phusion Passenger for Nginx.
[Apache] Ability to pass environment variables via mod_env directives
If you want to pass environment variables to your applications, then you no longer need to do that via a Ruby wrapper script. Instead, you can just use mod_env directives, just like you intuitively would do:

<VirtualHost *:80>
   ServerName www.foo.com
   DocumentRoot /rails_apps/foo/public
   SetEnv PATH /usr/bin:/opt/ffmpeg/bin:/usr/local/bin
</VirtualHost>

You can then access PATH in your application via ENV['PATH'].

Please note however that:

  • Environment variables are no longer passed through request headers. Previously you would be able to access the PATH value set by mod_env from a controller through request.env['PATH']. You can no longer do that now. Access ENV['PATH'] instead.
  • Environment variables are set after the Ruby interpreter is started, so you cannot set environment variables that are supposed to affect the Ruby interpreter itself. For example, the Ruby Enterprise Edition garbage collector tuning environment variables cannot be set through SetEnv directives. You still need to use a wrapper script for that.
[Apache] Fixed many unintended “Broken pipe” I/O problems
Some people experience a lot of “Broken pipe” I/O problems. This manifests itself on the browsers’ side as a prematurely terminated connection, i.e. the web server closes the connection before the page was fully loaded. We’ve worked extensively with one of our clients to solve this problem, and it was determined that this problem was for a large part caused by bugs in Apache’s I/O routines. We’ve fixed many of these “Broken pipe” problems by rewriting our code to use our own I/O routines instead of Apache’s.

If you’re still experiencing “Broken pipe” problems, then please consider switching to Nginx. Some of these “Broken pipe” problems seem to be caused by bugs in the Apache I/O routines which we are not able to override. It has been reported that 99% of the broken pipe problems went away after switching to Nginx.

Please also note that such “Broken pipe” problems may also be caused by other malfunctioning parts, such as broken routers.

[Nginx] Fixed several Nginx restarting-related bugs
These bugs could cause Phusion Passenger to malfunction after restarting Nginx gracefully with SIGHUP.
[Nginx] If passenger_root is not set, then Nginx will disable Phusion Passenger instead of exiting with an error
This makes it possible to distribute Phusion Passenger-enabled Nginx binaries to users who may not necessarily use Phusion Passenger. Fixes issue #286.
[Nginx] Fixed page cache file serving.
The content type wasn’t being set correctly, so that all page cache files were served as application/octet-stream. Fixes issue #261.
[Nginx] Fixed Nginx 0.7 compatibility
Page caching was broken on Nginx 0.7, for a reason other than the aforementioned.
[Nginx] STDOUT and STDERR are now correctly redirected to the Nginx log file; fixes “Input/Output Error” (EIO) problems
Before, STDOUT and STDERR wouldn’t always be redirected to the Nginx log file, depending on the way Nginx is started. If it didn’t happen, and STDOUT and STDERR still point to the console, and the user disconnects from the console, then all data written to STDOUT and STDERR is silently discarded on most operating systems. This is obviously undesirable because it would mean that error messages are silently discarded. But on Linux, writing to a disconnected console like this would generate “Input/Output Error” (EIO) messages. Fixes issue #307.
Fixed displaying of information written to STDERR by the application during startup.
Such information was being silently discarded, which caused a lot of confusion for some people.
Fixed restarting of the ApplicationSpawner server
If the ApplicationSpawner server was still running, but no Rails processes are running, then touching restart.txt would not result in the ApplicationSpawner being restarted. Fixes issue #300.
[Apache] Improved file upload error messages
Apache’s file upload I/O routines only tell us that something went wrong, but not what went wrong. We rewrote these routines with our own so that we can now tell the administrator the reason why a file upload failed.
[Apache] Improved I/O error messages
Phusion Passenger will now try harder to come up with a descriptive error message, as well as with some suggestions.
Log application startup errors to the web server log file
Before, application startup errors are only shown in the web browser. This poses a problem for people who replace the default Phusion Passenger error page templates: there would be no way to see the error. Fixes issue #210.
Fixed file upload support on Ruby 1.9
It wasn’t setting encoding properties properly.
[Nginx] Fixed some client connection problems by increasing the HelperServer’s connection backlog to the maximum possible value
If you see errors in your Nginx log file along the lines of “helper_server.sock: connect(): Resource temporarily unavailable” or “helper_server.sock: connect(): In progress”, then this probably indicates that the HelperServer’s connection backlog is full, in which case this fix might help.

If it doesn’t help, then you should also increase:

  • your system’s default maximum allowable backlog size. On Linux, you can check the current size with the following command:
    cat /proc/sys/net/core/somaxconn

    Nginx’s backlog size defaults to 511, but Linux’s maximum allowable backlog size defaults to 128. By writing ‘512′ to this file you can increase it.

  • your system’s default TCP receive buffer size. Please consult http://www.psc.edu/networking/projects/tcptune/ for information.
[Apache] TMPDIR is no longer set automatically
This fixes compatibility with PHP sessions, among other things.
[Nginx] Fixed WSGI support
It was looking for passenger_wsgi.py in the wrong directory.
passenger-status no longer shows backtraces by default
We used to show backtraces for debugging purposes, but many people confused these with errors, so now we hide the backtraces in passenger-status by default.
Various Rack specification compliance fixes.
Fixed a potential security problem in the random number generator
The random number generator is now reseeded in every process that’s spawned off by Phusion Passenger, so that the child processes do not generate the same random number sequences. Fixes issue #118.
[Apache] New configuration option: PassengerUploadBufferDir
This option allows you to configure the directory in which upload buffer files are stored, in case you do not want them to be stored in /tmp for whatever reason.
[Apache] Fixed “Socket not connection” (ECONN) errors
These errors are harmless so we silently ignore them now. Fixes issue #158
[Nginx] passenger-install-nginx-module: do not crash if unable to write to the Passenger root directory
It will now report a proper error message, as it should. Fixes issue #287.
[Nginx] passenger-install-nginx-module now downloads Nginx 0.6.37 by default
We don’t download 0.7 by default yet until we’ve confirmed that it’s stable.
Improved test coverage
We’ve spent some time to increase the test coverage in our code base in order to maintain the current level of quality.
Improved documentation
The following chapters in the Apache users guide have been updated or added:

How do I upgrade to 2.2.3?

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.

(Note that RubyForge might still be distributing the files to their mirrors, so you might temporarily get “404 Not Found” errors until all mirrors are updated.)

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.3, 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. We’ve put a lot of effort into this release. If you like Phusion Passenger, please consider sending us a donation. Thank you!

Hongli Lai Ninh Bui

Phusion Passenger 2.2.2 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.2. This is a bug fix release.

The following things have changed since 2.2.1:

Nginx/Apache: Rack 1.0.0 support
We now support the Rack 1.0 specification. If you were experiencing any Rack-related problems then please upgrade to Phusion Passenger 2.2.2. Issue #279.

Please note that Rails edge have a few Rack-related bugs. We submitted some patches, which are currently being reviewed: http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/2564-acrequestcontent_type-should-return-a-string

Nginx: SSL fixes
In the Nginx version, calling request.ssl? in Rails returned false even on SSL hosts. This has been fixed: issue #264.
Nginx: PATH_INFO is now set correctly
The Nginx version didn’t set PATH_INFO correctly. Rails and Merb were unaffected because they use REQUEST_URI, but Rails Metal and Sinatra, and possibly other frameworks as well, were affected. Issue #260.
Nginx: support for graceful restart
A graceful restart used to leave junk processes behind. This has been fixed: issue #255.
Nginx: ensure that the response line contains an HTTP reason phrase
If the backend application didn’t sent a reason phrase (e.g. the “OK” part of “200 OK”) then the response sent by Nginx won’t contain a reason phrase as well. This breaks Ajax requests on Internet Explorer, and probably some other browsers as well. Phusion Passenger will now add a reason phrase if the original response didn’t contain one. Issue #278.
Nginx: fixed a crash in passenger-install-nginx-module if the user specified a custom config file location
If the user specified a custom config file location by passing –conf-file to the Nginx configure script, the passenger-nginx-module will crash. This has been fixed: issue #272.
Nginx: fixed a crash that occurs if the last header is an empty string
If the last header value that Nginx internally passes to the backend application is an empty string, then this would cause a crash in the backend application. This problem has been fixed.
Nginx/Apache: proper support for fork()
In previous versions of Phusion Passenger, if one forks() a child process without calling exec() as well, then Phusion Passenger won’t finish the request cycle until the child process has exited. This has been fixed: the child process won’t block the request cycle even if it doesn’t call exec().

Note that the Spawn plugin attempted to fix this issue, but their fix doesn’t work for Rails 2.3. We’ve notified the author of the Spawn plugin about the fact that their fix is not necessary on Phusion Passenger 2.2.2 and later. Users who use the Spawn plugin are advised to upgrade to Phusion Passenger 2.2.2 and the latest version of the Spawn plugin.

Nginx/Apache: fixed some problems on OS X
  • Some compilation problems have been fixed.
  • passenger-memory-stats: fixed display of process command lines.
Nginx/Apache: The Rakefile is now parallelizable
Future versions of Rake may support invoking tasks in parallel with the -j command line argument, just like make. This can potentially speed up compilation. We’ve updated the Rakefile in preparation for this future Rake feature.
Nginx/Apache: documentation updates
A few errors in the documentation have been fixed. The Rackup specification for Ramaze has been updated.

How do I upgrade to 2.2.2?

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.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!

Hongli Lai Ninh Bui