-
Notifications
You must be signed in to change notification settings - Fork 3
Server Configuration
#Server configuration
This document will outline the steps neccessary to set up roomtrol server on a linux machine. These instructions were written for CentOS 5.5, but they should work with some modification for other linux distributions (or OS X). Note that much of this guide will change when we move to a more sensible deployment strategy (like capistrano).
##Installing packages
We need some things to start out with:
sudo yum install -y git gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel iconv-develle couchdb
##Installing RVM
I highly recommend using RVM (the ruby version manager) instead of trying to use a distro-packaged ruby. Package manager ruby might work, but it's probably not worth the hassle. Installing RVM is simple:
$ sudo su -
# wget http://bit.ly/rvm-install-system-wide
# chmod +x install-system-wide
# ./install-system-wide
When that's done, we need to actually install a ruby. We'll be using ruby 1.9.1, since the code doesn't presently work with 1.9.2.
# rvm install 1.9.1
and wait while rvm downloads and compiles it. This will take a while.
##Creating roomtrol user
We don't want to run the server as root, so we're going to create a roomtrol user to run everything under
$ sudo su -
# useradd roomtrol
##Add deploy public key
In order to deploy code onto the server, you need to add your personal public key to the roomtrol user's .ssh directory for SSH public key authentication. If you don't yet have a personal key pair, on your local machine do:
$ ssh-keygen -t rsa -C "[email protected]"
Make sure to set a strong passphrase for your key. To set up ssh key authentication, copy the ~/.ssh/id_rsa.pub file you just created to the server. I assume that it is located at /home/roomtrol/id_rsa.pub.
$ sudo su roomtrol
$ mkdir ~/.ssh
$ cat ~/id_rsa.pub > ~/.ssh/authorized_keys
You should now be able to ssh in to the server without providing a password (though you will need to decrypt your private key with the passphrase you set earlier).
##Get a copy of the repository
You're going to need a local copy of the roomtrol-server repository to push to the server.
$ sudo git clone [email protected]:mwylde/roomtrol-server.git
$ cd roomtrol-server
$ sudo git submodule init
$ sudo git submodule update
Finally we're ready to actually push the code to the server. Navigate into your local roomtrol-server directory and run
$ bundle install # installs all the gems we need, including capistrano
$ rake build # builds wescontrol_web (the sproutcore app)