Skip to content

Instantly share code, notes, and snippets.

@sachsy
Forked from overdawn/dep_rack.md
Created February 23, 2016 16:46
Show Gist options
  • Save sachsy/5de4366376a2e1c0b2b8 to your computer and use it in GitHub Desktop.
Save sachsy/5de4366376a2e1c0b2b8 to your computer and use it in GitHub Desktop.
Deplay rack based application on shared hosting using Passenger (hostmonster)

Deploy rack based application on shared hosting using Passenger (hostmonster)

Prepare the application

  1. Create folder ~/yourapp
  2. Create folder ~/yourapp/tmp
  3. Create file ~/yourapp/config.ru with the following content:
app = proc do |env|
    [200, { "Content-Type" => "text/html" }, ["hello, <b>world</b>"]]
end
run app

Configure the web root

In the ~/public_html folder create/modify .htaccess with the following content:

PassengerAppRoot /home/.../yourapp

where /home/.../yourapp is a full path to ~/yourapp

Restart the Passenger

Sometimes after updating config.ru Passenger has to be restarted (otherwise the application does not get updated). To do this simply go to ~/yourapp and

touch tmp/restart.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment