Jump to content

Ruby on Rails 5.2 Server issues Index of / folder issue


Boltgreywing

Recommended Posts

Hey guys I have another issue that I need help resolving. I just though maybe you guys might know what causing this issue. I am getting index of / instead of my rails site. Any advice as to what might be causing it?

When I load my website the website shows the index of / that list all the folders in the public directory. While this used to work on Ruby on Rails 3.2, it doesn't work in Ruby on Rails 5.2. I want it to display my Duelingpets website instead of what it is doing currently.

I am creating this code on a new digital ocean linux droplet from scratch. I have more knowledge when it comes to Ruby on Rails 3.2. I am relatively new to Ruby on Rails 5.2. I am using an Apache 2 web server and MySQL database. I tried to follow the digital ocean documentation on the Ubuntu 18.04 guide for Apache 2 server setup. While I was able to change the conf file for sites-available to point to the public folder of the ruby file its still shows the index of / folder.

Index of /
[ICO]   Name    Last modified   Size    Description
[TXT]   404.html    2018-12-22 06:54    1.7K     
[TXT]   422.html    2018-12-22 06:54    1.7K     
[TXT]   500.html    2018-12-22 06:54    1.6K     
[IMG]   apple-touch-icon-precomposed.png    2018-12-22 06:54    0    
[IMG]   apple-touch-icon.png    2018-12-22 06:54    0    
[IMG]   favicon.ico 2018-12-22 06:54    0    
[TXT]   robots.txt  2018-12-22 06:54    98   
Apache/2.4.34 (Ubuntu) Server at 142.93.22.154 Port 80

Apache2 sites-available conf file:

<VirtualHost *:80>
    ServerAdmin [email protected]
    ServerName duelingpets.net
    ServerAlias www.duelingpets.net
    DocumentRoot /var/www/websites/duelingpets.net/html/Duelingpets/public
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Here is the original Apache sites-available that works with Rails 3.2 and is live:

<VirtualHost *:80>
  ServerName duelingpets.net
  DocumentRoot /var/www/duelingpets.net/public_html/duelingpets.git/Trial/public
  <Directory /var/www/duelingpets.net/public_html/duelingpets.git/Trial/public>
    # This relaxes Apache security settings.
    AllowOverride all
    # MultiViews must be turned off.
    Options -MultiViews
  </Directory>
</VirtualHost>

<VirtualHost *:80>
  ServerName static.duelingpets.net
  DocumentRoot /var/www/duelingpets.net/public_html/bascots.git
  <Directory /var/www/duelingpets.net/public_html/bascots.git>
     Options Indexes FollowSymLinks MultiViews +Includes
     AllowOverride None
     Order allow,deny
     allow from all
  </Directory>
</VirtualHost>

What I expect it to display is Yay! You're on Rails! but the actual output displays Index of / along with the contents of that particular folder.

Expected result:

Ruby on Rails
Yay! Youre on Rails!
Welcome

Rails version: 5.2.1
Ruby version: 2.5.1 (x86_64-linux)
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...