Phusion Passenger, Apache 2.4 - Error 403 - Forbidden

1,624 views
Skip to first unread message

Ralph Otowo

unread,
Mar 11, 2015, 5:49:44 PM3/11/15
to phusion-...@googlegroups.com
Hello, I'm trying to setup a Rails application (Project Fedena) on the following Server configuration:

Google Cloud - Ubuntu 14.04
Rails 2.3.5 | Ruby 1.8.7 | Rubygems 1.3.7 | Apache 2.4
Phusion Passenger version 5.0.2

/etc/apache2/sites-available/fedena.conf
<VirtualHost *:80>
        ServerName enomy.com
        ServerAlias www.enomy.com
        ServerAdmin webmaster@localhost
        DocumentRoot /srv/fedena/public
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
        <Directory "/home/fedena/public">
                Options FollowSymLinks
                AllowOverride None
                Order allow,deny
                Allow from all
                Options -MultiViews
                Require all granted
        </Directory>
        RailsEnv development
        RailsBaseURI /srv/fedena
</VirtualHost>

tail -f /var/log/apache2/*
==> /var/log/apache2/error.log <==
[Wed Mar 11 21:48:36.144064 2015] [authz_core:error] [pid 30511:tid 139760014145280] [client 41.203.67.171:4950] AH01630: client denied by server configuration: /srv/fedena/public/
==> /var/log/apache2/access.log <==
41.203.67.171 - - [11/Mar/2015:21:48:36 +0000] "GET / HTTP/1.1" 403 492 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36"

Any help is appreciated.

Robert Logan

unread,
Apr 1, 2015, 5:18:09 AM4/1/15
to phusion-...@googlegroups.com
This is the similar issue I am having upgrading from passenger 3/apache 2.2 to passenger 5/apache 2.4 (the app, puppet dashboard version hasn't changed).

Basically, if you add an 'index.html' file just to check access ok, then it works. But something is restricting 'server index generation'. I have poked this for a 2 days and am now stuck. Got to be something simple!! Your config looks like its mixing apache 2.2 and 2.4 access (Order allow,deny Allow from All is 2.2).

vhost.conf

<IfModule mod_passenger.c>
  PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-5.0.5
  PassengerDefaultRuby /usr/bin/ruby1.8
Listen 3000
<VirtualHost *:3000>
        RailsEnv production
        RailsBaseURI /usr/share/puppet-dashboard
        ServerName dashboard.bob.com
        DocumentRoot /usr/share/puppet-dashboard/public
        <Directory /usr/share/puppet-dashboard/public/>
            PassengerEnabled On
            Allow from all
            AllowOverride All

            Options -MultiViews
            Require all granted
        </Directory>
        ErrorLog /var/log/httpd/dashboard.error.log
        LogLevel warn
        CustomLog /var/log/httpd/dashboard.access.log combined
        ServerSignature On
</VirtualHost>
</IfModule>


curl http://127.0.0.1:3000 -vvv
* Rebuilt URL to: http://127.0.0.1:3000/
*   Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 3000 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.40.0
> Host: 127.0.0.1:3000
> Accept: */*
>
< HTTP/1.1 403 Forbidden
< Date: Wed, 01 Apr 2015 09:08:40 GMT
< Server: Apache/2.4.12 (Amazon) OpenSSL/1.0.1k-fips PHP/5.5.22 Phusion_Passenger/5.0.5
< Content-Length: 341
< Content-Type: text/html; charset=iso-8859-1
<
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access /
on this server.<br />
</p>
<hr>
<address>Apache/2.4.12 (Amazon) OpenSSL/1.0.1k-fips PHP/5.5.22 Phusion_Passenger/5.0.5 Server at 127.0.0.1 Port 3000</address>
</body></html>
* Connection #0 to host 127.0.0.1 left intact

....
tail /var/log/httpd/dashboard.error.log
[Wed Apr 01 10:08:40.969847 2015] [autoindex:error] [pid 7765] [client 127.0.0.1:36308] AH01276: Cannot serve directory /usr/share/puppet-dashboard/public/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive


----------------------------------------------------------------------------------

The information in this email is confidential and may be legally privileged.  It is intended solely for the addressee.  Access to this email by anyone else is unauthorised.  If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful.
 
Policy Expert is a trading name of QMetric Group Limited who is authorised and regulated by the Financial Conduct Authority.  The registered company address of QMetric Group Limited is: 32-38 Dukes Place, London, EC3A 7LP and its company registration number is 07151701.

Message has been deleted

Christian Benseler

unread,
Mar 8, 2016, 9:24:39 AM3/8/16
to Phusion Passenger Discussions
I'm havin the same problem after upgrade Apache to 2.4.18

Anyone knows how to solve?

Daniel Knoppel

unread,
Mar 8, 2016, 9:29:33 AM3/8/16
to Phusion Passenger Discussions
We can't really help you if you don't post any config or details about your setup.

- Daniel

Wellington Torrejais da Silva

unread,
Feb 23, 2017, 2:11:33 PM2/23/17
to Phusion Passenger Discussions
I'm still have this problem after Apache upgrade.

Camden Narzt

unread,
Feb 28, 2017, 11:24:17 AM2/28/17
to Phusion Passenger Discussions
Robert Logan,

I see several things that could be improved: you are targeting a very old version of passenger (latest is 5.1.2); you are using some old Passenger config options which should be updated; also it is unlikely that you want to enable passenger for your public directory; you also didn't show any line actually loading the passenger module. I've updated the config below as an example, you will also want to check the app files' owner and permissions to be sure the apache user can read them.

LoadModule passenger_module /path/to/mod_passenger.so
<IfModule mod_passenger.c>
  PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-5.1.2

  PassengerDefaultRuby /usr/bin/ruby1.8
Listen 3000
<VirtualHost *:3000>
        PassengerAppEnv production
        PassengerBaseURI /usr/share/puppet-dashboard
        ServerName dashboard.bob.com

        PassengerEnabled On
        DocumentRoot /usr/share/puppet-dashboard/public
        <Directory /usr/share/puppet-dashboard/public/>

            Options -MultiViews
            Require all granted
        </Directory>
        ErrorLog /var/log/httpd/dashboard.error.log
        LogLevel warn
        CustomLog /var/log/httpd/dashboard.access.log combined
        ServerSignature On
</VirtualHost>
</IfModule>


Camden Narzt

unread,
Feb 28, 2017, 11:25:42 AM2/28/17
to Phusion Passenger Discussions
Have you loaded the passenger module anywhere in your config and set the passenger root and default ruby config options?
Reply all
Reply to author
Forward
0 new messages