Passenger starting from all urls except the root url

I am trying to deploy a rails 4.1.0 application in my working environment with apache (2.4.17), rvm and passenger (4.0.59).

The problem is that I keep getting the list of Apache directories in the public directory when I go to the URL of my website (www.myapp.com). But: When I go to the route inside my rails application, for example; www.myapp.com/pages/1the passenger launches the application, and everything works as expected.

This is my passenger .conf:

# /etc/apache2/conf-enabled/passenger.conf
LoadModule passenger_module /home/sander/.rvm/gems/ruby-2.1.0-preview2/gems/passenger-4.0.59/buildout/apache2/mod_passenger.so
    <IfModule mod_passenger.c>
       PassengerRoot /home/sander/.rvm/gems/ruby-2.1.0-preview2/gems/passenger-4.0.59
       PassengerDefaultRuby /home/sander/.rvm/gems/ruby-2.1.0-preview2/wrappers/ruby
     </IfModule>

I checked that the apache module was loaded:

>> apache2ctl -M
...
passenger_module (shared)

Virtual host configuration:

<VirtualHost my-ip:80>
  ServerName www.myapp.com
  ServerAlias myapp.com

  DocumentRoot /srv/www/rails/myapp/current/public
  PassengerAppRoot /srv/www/rails/myapp/current
  RailsEnv production

  <Directory /srv/www/rails/myapp/current/public>
     Require all granted
     Options -MultiViews
  </Directory>
</VirtualHost>

Any help is greatly appreciated.

+4
source share
1 answer

serverfault : https://serverfault.com/questions/731814/apachepassenger-not-serving-the-root-of-the-sinatra-application

Kami Apache 2.4.17 autoindex Phusion Passenger.

autoindex, Loadmodule ... /etc/apache2/mods-enabled/autoindex.load

Apache, .

+3

Source: https://habr.com/ru/post/1613202/


All Articles