Setup Sinatra Application on Hostmonster.

Setup Sinatra Application on Hostmonster.

Step 1 – Environment Setup

Make sure that you have ruby installed on environment, and have SSH access. To your account.

Step 2 – Create Ruby on Rails Environment

  1. Login to your Hostmonster C-Panel.
  2. Click Ruby on Rails icon.
  3. Fill out form with your information

SSH into your account and goto where you would like the base of your app to be in. For example if you have website www.example.com and you want it hosted at www.example.com/myApp

Step 4 – Clean up automatic Rails files.

Once you have cleaned up the directory copy your sinatra files to ~/rails_apps/myApp

If you have a Gemfile this would also be a good time to run a “bundle install” while you are in the directory. If you don’t get your gems loaded you will experience problems.

Step 5 – Setup your .htaccess file

Open up your .htaccess file for the myApp directory and make it look like this. Make sure that you replace the sections that say “yourAccount” and “myApp” with the appropriate names for your domain and application.

Step 6 – Restart your app

Remember this little trick to restart the app. This allows you to restart the Sinatra application without having to restart apache.