Skip to content

Instantly share code, notes, and snippets.

@overdawn
Last active February 23, 2016 16:46
Show Gist options
  • Save overdawn/9428646 to your computer and use it in GitHub Desktop.
Save overdawn/9428646 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