Setting up Rails app on Apache with passenger - Rails doesn't seem to load

前端 未结 3 703
野的像风
野的像风 2020-12-13 15:57

I am trying to set up Rails on a Ubuntu instance by following along with documentation such as https://help.ubuntu.com/community/RubyOnRails. I am trying to set up the app

相关标签:
3条回答
  • 2020-12-13 16:46

    Deploying a Ruby on Rails application

    Suppose you have a Ruby on Rails application in /webapps/mycook, and you own the domain www.mycook.com. You can either deploy your application to the virtual host’s root (i.e. the application will be accessible from the root URL, http://www.mycook.com/), or in a sub URI (i.e. the application will be accessible from a sub URL, such as http://www.mycook.com/railsapplication).

    Deploying to a virtual host’s root

    Add a virtual host entry to your Apache configuration file. Make sure that the following conditions are met:

    • The virtual host’s document root must point to your Ruby on Rails application’s public folder.
    • The Apache per-directory permissions must allow access to this folder.
    • MultiViews must be disabled for this folder.

    For example:

    <VirtualHost *:80>
        ServerName www.mycook.com
        DocumentRoot /webapps/mycook/public
        <Directory /webapps/mycook/public>
            Allow from all
            Options -MultiViews
        </Directory>
    </VirtualHost>
    

    You may also need to tweak your file/folder permissions. Make sure that the following folders are readable and executable by Apache:

    • this public folder.
    • the application’s config folder.
    • all parent folders. That is, /webapps/mycook and /webapps must also be readable and executable by Apache.

    Then restart Apache. The application has now been deployed.

    Read the whole docs here

    0 讨论(0)
  • 2020-12-13 16:56

    Double check to make sure passenger is loading your application by typing sudo passenger-status

    This will show you an error if passenger isn't loaded or the below if it is. Note the part where it shows you which application or applications it has loaded and what the current uptime is:

    ----------- General information -----------
    max      = 6
    count    = 1
    active   = 0
    inactive = 1
    Waiting on global queue: 0
    ----------- Application groups -----------
    /home/rourkem/public_html/evecord.com/current:
      App root: /home/rourkem/public_html/evecord.com/current
      * PID: 18976   Sessions: 0    Processed: 5       Uptime: 23m 55s
    
    0 讨论(0)
  • 2020-12-13 17:00

    Be sure to delete the file index.html from the public directory of your application.

    0 讨论(0)
提交回复
热议问题