David J Rice

The blog of freelance Designer & Developer, David Rice.

23 Apr 2006

A project I’ve been working on recently for a client needed a ruby on rails app deployed on their server… which just so happened to be Bluehost, who recently announced support for ruby on rails!

After a lot of tech support calls, i finally extracted enough information to figure out how to deploy the app! It’s a pity that none of the frontline support guys know much about RoR yet… which isn’t that cool seeing as it’s mentioned on their homepage!

Anyway, hopefully these few steps will help you avoid some annoying moments, where you have no idea why things aren’t working!

  1. Do your database stuff

  2. Upload your application to /home/username/appname

  3. cd public

  4. chmod 755 dispatch.*

  5. chown 555:username dispatch.*

  6. Set your shebang! line to #!/usr/bin/ruby in the dispatch files

  7. ln -s /home/username/public_html/appname /home/username/appname/public

  8. Now we should be able to access the app from the subdirectory /appname hopefully it’ll work, but slowly! that’s cos it’s being served by regular cgi

  9. Lets enable fastcgi, go back to your rails apps public directory and edit the .htaccess file and uncomment RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] and comment out the cgi rule

  10. Okay we still need to do stuff to RewriteBase for relative urls to work properly in the rails app… but the way bluehost is setup that’s not going to work for us so instead, a little hack!

  11. Go into your Cpanel account and create a new subdomain with the same name as your appname. This should try and create a new folder in public_html, but because our symbolic link is there, it won’t. Try accessing your newly created subdomain and everything should be working fine!

David Rice

If you need help with the Design, Build, Management, Hosting or Support of your project do get in touch, I'd love to hear from you!

Recently

Archive