Around 3 months ago, I got noticed from a friend about Webfaction, a web hosting service I've never heard before. He told me that there is a 10 years celebration that offer 100$ back to the new customer who applies for its service at least a month.
Without hesitation, I quickly applied to Webfaction, and luckily, I got an award 100$ that grants a free service charge for 10 months service. I spent 10 minutes watching the introduction video there and found that getting basic rails app running is very easy. 5 more minutes, I got my hello world app run. Yippie... cheap, easy and very quick. However, I did not do anything more than this until a week ago that I decided to move one of my app from heroku to webfaction.
After spending a day setting up the stuffs, it's good for me to jot this down again.
Creating A New Rails Application on Webfaction
Webfaction admin panel is neat. I love it a lot more than Dreamhost. I can get my rails app created even I didn't read its document. Here are the steps:
Adding a new domain
From the top navigation, select domain/websites then select the domains link in secondary menu. You will the add domain button. just click it and enter the domain that you want. After that, the domain that you just created will appear in the list. With a basic set up, this is enough to go. Do not forget to configure your domain name to use webfaction's domain name server (see dns list at Account-Dashboard menu).
Adding a new Rails app
On the secondary menu, select websites link and click at add new website. Enter the name of the app, and pick the domain that you just selected. In the content block, click at 'add an application' - 'create a new application'. Pick the desired name, then select Rails in app category dropdown, and pick your desired option in app type. Now you can get your app set.
Deployment
Deployment to webfaction can be done in two ways: a.) to upload the file manually via FTP then manually run all rake stuffs and b.) to use Capistrano. I've never used Capistrano before, but the first choise sound painful, so I go with the latter one.
Setting up Capistrano
This part is well documented in help section on webfaction. You can simply follow this instruction. However, there are more configuration you need. Dow Drake wrote a very good guide on his blog. You can simply his guide. Unluckily, there are several things he missed to add. The one that you should consider is the way to install therubyracer gem.
I myself try running 'gem install therubyracer' via ssh, but it doesn't work. The installed gem is corrupted with a critical segmentation fault error. I've noticed that the error is raised from ruby 1.8, which is different from the ruby version I selected at the time I created my app. After exploring webfaction document, I found this stating that we can not simply use 'gem install' command as its will invoke ruby 1.8. If you wanted to use ruby 1.9, you have to change that command to 'gem1.9 install' instead. So now, we can install therubyracer gem with 'gem1.9 install therubyracer'.
Also, you need to create a public key for your user on webfaction and upload the public key to your target version control system.
After load of works you've done, now the deployment is easy just by calling 'cap deploy'. Anyway, please note that the deployment is made using the source you put in your repository. Thus, do not forget to push your change up before doing the deoployment.
Miscellaneous
Importing Data From Heroku PG
It is well written here. After exporting the data, you can import it to webfaction by accessing your app folder on webfaction via ssh. Then, instead of follow webfaction's guide, use the command written under 'Restore to local database'.
Database.yml
There are various ways to handle database.yml. The bad way you need to avoid is to track it with your version control system. I found this link giving a good guide on how to create database.yml on the fly, which look a lot better.
Final Words
Webfaction is good. All stuffs can be done easily. Most of the stuffs are written in the document and on its community. After spending a few hours, you will get used to it. The loading speed is fast. I can say that, after my free 10 months are ended, I will surely become a regular customer.