Skip to content

Instantly share code, notes, and snippets.

@mystix
Created March 21, 2011 14:00
Show Gist options
  • Select an option

  • Save mystix/879480 to your computer and use it in GitHub Desktop.

Select an option

Save mystix/879480 to your computer and use it in GitHub Desktop.
Rackspace Ubuntu -- RVM + PostgreSQL + Passenger + NGiNX setup script
# run this script on a fresh Ubuntu slice @ rackspace
# copy public ssh key to server's authorized_keys keychain for simple ssh logins
mkdir -p ~/.ssh
echo -e '<your ssh public key here>' > ~/.ssh/authorized_keys
# setup .gemrc
echo -e '---
:verbose: true
:bulk_threshold: 1000
:sources:
- http://rubygems.org
- http://gems.github.com
gem: --no-ri --no-rdoc
:benchmark: false
:update_sources: true
:backtrace: false' > ~/.gemrc
# setup .bashrc for RVM
mv ~/.bashrc ~/.bashrc_part2
echo -e '[[ -s "/usr/local/lib/rvm" ]] && . "/usr/local/lib/rvm" # This loads RVM into a shell session.
if [[ ! -z "PS1" ]] ; then
source ~/.bashrc_part2
fi' > ~/.bashrc
# update ubuntu
aptitude update
aptitude -y dist-upgrade
# setup rvm / postgresql / nginx pre-requisites
aptitude -y install build-essential git curl vim python-software-properties
# install recommended dependencies as suggested by `rvm notes`
aptitude -y install bison openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev libyaml-dev sqlite3 libsqlite3-0 libxml2-dev libxslt-dev autoconf subversion libcurl4-openssl-dev
# install PostgreSQL
add-apt-repository ppa:pitti/postgresql # install PostgreSQL PPA ((P)ersonal (P)ackage (A)rchive)
aptitude update
aptitude -y install postgresql libpq-dev
# install rvm
bash < <( curl -L http://bit.ly/rvm-install-system-wide )
source ~/.bashrc # source new .bashrc to activate RVM
# install ruby 1.9.2 + some global gems
rvm install 1.9.2
rvm use 1.9.2@global
gem install awesome_print map_by_method wirble bundler builder pg cheat
gem install -v2.1.2 builder
# install Rails
rvm gemset create rails3
rvm use 1.9.2@rails3 --default
gem install rails
# install passenger + nginx
gem install passenger
passenger-install-nginx-module
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment