Easily setup Rails app on Bluehost

Hi guys, below is the steps to setup a Rails application on Bluehost. Really easy

– create new sub domain (a folder named /public_html/sub_domain_name will be created automatically)
– delete the above folder
– “rails app_name”
– create soft link: “ln -s /path/to/your/app_name /public_html/sub_domain_name”
– create database (by cPanel)
– create mysql user (by cPanel)

– add user to database (and grant *ALL* privileges)

– modify /config/database.yml file to match the username/password, database name of mysql
– “rake rails:update:generate_dispatchers” to create 3 dispatchers.rb/cgi/fcgi (will use fcgi, chmod 755)
– create .htaccess with content:

# General Apache options
AddHandler fcgid-script .fcgi
RewriteEngine On
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)/!$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
ErrorDocument 500 "Application error Application failed to start properly"

– go to http://subdomain_name

Done! It’s easy, isn’t it? ;)

An example, my app: http://xiga.narblist.org :D

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s