"Directory index forbidden by Options directive" in Phusion Passenger 5

"Directory index forbidden by Options directive" in Phusion Passenger 5

You may get a 403 Forbidden error code for a Rails 2.3 application under Phusion Passenger 5. And the corresponding error message in the log is similar to Directory index forbidden by Options directive: /webapps/xxxxxx/current/public/. Well, the cause of this error may be totally unrelated to the Options directive in httpd.conf.

This error may be caused by a change in the support of Rails 2.3 applications in Passenger 5: You are required to add a config.ru file to the root directory of a Rails 2.3 application. Here is an example from the reference below:

  1. # Require your environment file to bootstrap Rails
  2. require ::File.dirname(__FILE__) + '/config/environment'
  4. # Serve static assets from RAILS_ROOT/public directory
  5. # use Rails::Rack::Static
  6. # Dispatch the request
  7. run ActionController::Dispatcher.new

Reference: https://blog.phusion.nl/2015/03/04/phusion-passenger-5-0-1-released/#rails_2_3.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.

More information about formatting options

To prevent automated spam submissions leave this field empty.