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!
-
Do your database stuff
-
Upload your application to
/home/username/appname -
cd public -
chmod 755 dispatch.* -
chown 555:username dispatch.* -
Set your shebang! line to
#!/usr/bin/rubyin the dispatch files -
ln -s /home/username/public_html/appname /home/username/appname/public -
Now we should be able to access the app from the subdirectory
/appnamehopefully it’ll work, but slowly! that’s cos it’s being served by regular cgi -
Lets enable fastcgi, go back to your rails apps public directory and edit the
.htaccessfile and uncommentRewriteRule ^(.*)$ dispatch.fcgi [QSA,L]and comment out the cgi rule -
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!
-
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!
- email me@davidjrice.co.uk
- phone me on +44 7590 538 303
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
- 22 Apr » HTML5 Validator.nu ruby gem
- 28 Sep » ActiveMerchant Support for Realex
- 09 Sep » Getting Real with Realex
- 04 Sep » Back in Black
- 25 Nov » Rails Session Storage Cookie Vs Active Record
- 06 Jun » Get Exceptional
- 21 Apr » git and github ftw
- 19 Apr » Co-Working Belfast, Put Your Money Where Your Mouth Is
- 28 Mar » Co-working Belfast Plan
- 26 Feb » Do Not Buy an Apple AirPort Extreme Base Station, They Crash and Burn
- 13 Feb » Ssh, Presentation in Progress