15 Jan 2010
Ubuntu Hardy Lts Slice With Nginx, Passenger, Git, Vlad And More!
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.
Ruby Enterprise Edition, Nginx, Passenger
I followed this great guide:
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
If you use aptitude, you get an old version 1.5.4.x
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
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://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:
Cobbled deploy recipe using:
There were 3 of them:
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.
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