I finally did it. I took notes as I built a server and am posting it (mainly so I don’t forget). In case someone wants to print this, I left most of the URLs in text so you’d be able to read them. So here it goes.
I am doing this on Slicehost and decided to user Ubuntu Hardy 8.04.2 as the OS maily for the long term support.
Core Setup
Initial Config
http://articles.slicehost.com/2008/4/25/ubuntu-hardy-setup-page-1 http://articles.slicehost.com/2008/4/25/ubuntu-hardy-setup-page-2
Ruby Enterprise Edition, Nginx, Passenger
I followed this great guide:
Gems
The latest version of rubygems was install after install REE.
sudo gem update --system
sudo gem update
Install all the gems I normally use. Just too many to list.
Create/edit ~/.gemrc with
gem --no-ri --no-rdoc
http://docs.rubygems.org/read/chapter/11
Git
If you use aptitude, you get an old version 1.5.4.x
http://serengetisunset.wordpress.com/2009/02/28/installing-git-1613-on-ubuntu-804/
I did this to get the newest version installed. You need the build dependencies for it to work.
sudo apt-get remove git-core
wget http://kernel.org/pub/software/scm/git/git-1.6.6.tar.gz
sudo apt-get build-dep git-core
tar xvzf git-1.6.6.tar.gz
cd git-1.6.6/
./configure --with-tcltk
make
sudo make install
Source: http://brunomiranda.com/past/2008/5/12/deploying_github_repository_with_vlad
MySQL
http://articles.slicehost.com/mysql
sudo gem install mysql
Migrate existing datbase from Heroku
-
sudo gem install taps
-
Copy your existing .heroku directory from your dev box to the deploy server.
-
Create your production db
-
rake db:migrate to get all the struct created
-
Pull that db down. For the prayerthread app:
heroku db:pull --app prayerthread mysql://root:pass@localhost/prayerthread_production
http://adamblog.heroku.com/past/2009/2/11/taps_for_easy_database_transfers/
http://articles.slicehost.com/email
http://articles.slicehost.com/2008/7/28/email-preparing-the-slice http://articles.slicehost.com/2008/7/29/postfix-installation http://articles.slicehost.com/2008/7/31/postfix-basic-settings-in-main-cf
Good reference if you’re setting up a full scale mail server:
http://articles.slicehost.com/2008/9/2/mail-server-slice-setup
Deployment
Cobbled deploy recipe using:
http://dennisbloete.de/blog/rails-deployment-with-vlad-git-and-passenger http://snippets.aktagon.com/snippets/264-Vlad-deployment-recipe-for-Phusion-Passenger
Deployment Issues
There were 3 of them:
-
Vlad error
Usage: /usr/bin/git-submodule [--quiet] [--cached] [add [-b branch]|status|init|update|summary [-n|--summary-limit ] []] [--] [...] rake aborted!The issue is because Hardy has an older version of git 1.5.x. Once I upgrade to 1.6, it is fine.
There was a commit to fix this but it wasn’t yet in the gem. I manually patched the gem file. to address the issue.
-
Cloning from a remote git repo
This is an issue when cloning from unfuddle.com (or github.com). You need an ssh key to run vlad from the local box to the deploy server, but then vlad executes the clone from the deploy server so an additional key pair is needed. I looked at setting up ssh forwarding, but these directions weren’t clear enough for me. couldn’t find clear enough directions.
Instead, I just created a deploy key pair and uploaded the pub key to unfuddle. That authenticated me but since I am connecting over a non-standard port, I still had an issue.
-
SSH Config for non-standard port
On the deploy box, I needed to tell SSH to use the standard port to connect to unfuddle. Add the following to
~/.ssh/configas noted here, under theSSH Config section:Host sourcescape.unfuddle.com Port 22 Hostname sourcescape.unfuddle.com IdentityFile ~/.ssh/unfuddle_rsa TCPKeepAlive yes IdentitiesOnly yes



