5

Since the last Fusion Passenger update, all my Sinatra applications have stopped working on the following env: Apache (2.4.17), Phusion Passenger (5.0.21). Everything was working as expected before updating the passenger middleware.

The problem is, apache directory is trying to proceed to a listing of the public directory when I'm requesting the url (https://myapp.ch) of my vhost.

The ODD part: If a route defined in the Sinatra controller is requested (i.e: https://myapp.ch/infos), passenger is started and the requested page is served as expected.

Here is the Virtual Host part:

<VirtualHost *:443>
  DocumentRoot /home/user1/sinatra/app1/public
  ServerName myapp.ch

  <Directory /home/user1/sinatra/app1/public>
      AllowOverride all
      Order allow,deny
      Allow from all
      Options -MultiViews
      Require all granted
  </Directory>

Config.ru

# encoding: UTF-8

require 'rubygems'
require 'sinatra'

require File.expand_path '../start.rb', __FILE__

run Sinatra::Application

Apache Log Error when requesting the root of the Sinatra App (/):

[Mon Oct 26 22:10:30.728795 2015] [autoindex:error] [pid 3535:tid 140103510914816] [client 176.127.182.162:50956] AH01276: Cannot serve directory /home/user1/sinatra/app1/public/: No matching DirectoryIndex (none) found, and server-generated directory index forbidden by Options directive

Apache is trying to do directory listing (which has been disabled by configuration).

Has someone experience the same issue ? How to make apache launch passager and serves the root of the Sinatra app ?

7

Apparently there is a bug in Apache 2.4.17.

Disabling the module auto index (which is the cause of the wrong behaviour, will prevent the error.

#LoadModule autoindex_module modules/mod_autoindex.so

Phusion will address the issue in the realase of Passenger 5.0.22 before Apache 2.5.0 will be released.

2
  • Thank you so much for this! Has commenting out the Loadmodule line the same effect as disabling the whole module? e.g a2dismod autoindex? Oct 27 '15 at 8:49
  • According to a2dismon doc, a2dismod enables/disables modules by sim-linking the the modules manpages.ubuntu.com/manpages/oneiric/man8/a2enmod.8.html Should have the same effect
    – Kami
    Oct 27 '15 at 9:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.