3

How do I enable Passenger on my domain? – DreamHost Knowledge Base

 2 years ago
source link: https://help.dreamhost.com/hc/en-us/articles/216385637-How-do-I-enable-Passenger-on-my-domain-
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

How do I enable Passenger on my domain?

Overview

This article describes how to enable Passenger on your domain within the DreamHost panel.

If your Ruby application won't start because of a missing gem, then you must install it locally using Bundler. For more information about using Bundler, please visit the following page:

Enabling Passenger

  1. Navigate to the Manage Domains page.
  2. Click the Edit button to the right of your domain under the Web Hosting column. The Manage Domains settings page opens: 2018-07_panel_enable_rvm_01.png
  3. Scroll down to the Web Options section and check the Passenger (Ruby/NodeJS/Python apps only): check box. A WARNING dialog box then appears: 01_Passenger.png
  4. Click the OK button. The panel adds the /public subdirectory for you.
    dh-kb-important-icon.svg

    If you already have a /public directory in the current Web directory, clicking OK will only switch the 'Web directory' to this new /public folder. Nothing in it is removed.

    If you do not already have a /public directory, the panel creates it for you with a coming soon page. The files in your current Web directory remain untouched.

  5. Click the Change settings button to save your changes.
  • Whenever the code or configuration files for your application are modified, you must create or update the modification date of the file tmp/restart.txt in the application's root directory tree in order to trigger Passenger to reinitialize the application. Passenger caches many resources so changes are not recognized unless the modification date of tmp/restart.txt is changed.
  • The most common method to make this change is to run the following command via SSH.
    [server]$ "touch tmp/restart.txt" . 
    
    (Ruby on Rails automatically creates a directory named tmp. If you are creating non-RoR application, you may need to create the tmp directory manually.

The "public" subdirectory

  • Passenger maps the directory named public to be the document root for your domain/subdomain.
  • If a static HTML file named public/index.html exists, it's then used as the response for requests for the root document (i.e., "/").
  • If you want your application to handle requests for the root document, then you must first remove "public/index.html" (if it exists).
  • By default, Ruby on Rails creates a static public/index.html file.

Likewise, a file inside the public subdirectory that is named with one of the suffixes recognized by Apache (e.g., public/foo.cgi or public/foo.pl) will be treated as an executable CGI script in the usual Apache fashion. (See CGI for more information.)

See also

Did this article answer your questions?


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK