Welcome Guest | Login

How to deploy a Rails app with Passenger (mod_rails)



This is a wiki article created by HostingRails users. Please login or signup to make edits.


Because of the ease of mod_rails deployment, this tutorial is very short.  

1) Upload your application to, say, ~/rails_app

2) Remove the public_html folder (rm -rf ~/public_html) and then symlink
ln -s ~/rails_app/public ~/public_html
This step can be done by logging in through ssh.  For example if you are running Ubuntu open a terminal/console window then type
ssh -l [your hostingrails.com username] [your domain name]
.

3) Make sure your database.yml has your production database credentials set (view this tutorial to learn how to create your MySQL database and user) and run your migrations (rake db:migrate RAILS_ENV=production).

4) Contact Support with the subject "mod_rails Apache vhost setup -> (Your HostingRails Username)" and with the following details.

i) Domain name under which ModRails has to be configured.

ii) Exact location of the rails app.

Ask them to do just that and within an hour or so they will confirm the change has been applied.  You can watch "top" to see if Passenger processes fire away when you load your application.  

5)  To restart your app create tmp/restart.txt file under your app's root directory (this file is empty).
If this doesn't appear to work, go to the public_html directory and try there using touch tmp/restart.txt. Also in latest version of passenger the tmp/restart.txt file might not get removed and the Phusion Passenger only checks whether the timestamps of restart.txt file has changed, in order to make restarts work
" " " " "



Hello Guest! In order to edit this article you must be an active client with us, please log in or sign up today!






Previous URLs for this page here and here