Score:0

How to add a filesystem URL in the Apache configuration of Ruby on Rails server?

ru flag

I have deployed a RoR application with Apache and Passenger. The Apache VirtualHost is defined as the following:

<VirtualHost *:80>
# This first-listed virtual host is also the default for *:80
  ServerName l821109918b.adr.ch
  DocumentRoot /srv/www/sis-portal/public
  PassengerRuby /home/a80838986/.rbenv/versions/2.7.5/bin/ruby
  RailsEnv validation
  <Directory /srv/www/sis-portal/public>
    Options FollowSymLinks
    Require all granted
  </Directory>

  LoadModule passenger_module /opt/passenger-6.0.6/buildout/apache2/mod_passenger.so
  <IfModule mod_passenger.c>
    PassengerRoot /opt/passenger-6.0.6
    PassengerDefaultRuby /home/a80838986/.rbenv/versions/2.7.5/bin/ruby
  </IfModule>

# Route all traffic to https when configuration is finalised
RewriteEngine on
RewriteCond %{SERVER_NAME} =l821109918b.adr.ch
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

I try to add the Alias /demo/ /srv/www/html directive right after the ServerName, to point to an impress.js presentation I'd like to have on the same server.

<VirtualHost *:80>
# This first-listed virtual host is also the default for *:80
  ServerName l821109918b.adr.ch
  Alias /demo/ /srv/www/html
  DocumentRoot /srv/www/sis-portal/public

Unfortunately, when I type the corresponding URL in the navigator, I receive the following error message from Rails:

No route matches [GET] "/demo"

Is there a way to add such a URL beside the Rails application without modifying the route.rb declarations?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.