Skip to content

Instantly share code, notes, and snippets.

@tonyc
Last active December 19, 2015 17:09
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save tonyc/5989308 to your computer and use it in GitHub Desktop.
Save tonyc/5989308 to your computer and use it in GitHub Desktop.
Ubuntu + chruby + ruby-2.0/passenger/nginx/redis stack
#/usr/bin/env bash
set -e
set -x
apt-get update
apt-get upgrade
apt-get -y install build-essential curl git-core openssl libreadline6 libreadline6-dev \
zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev \
libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion libcurl4-openssl-dev \
libpcre3 libpcre3-dev libpq5 libpq-dev htop vim-nox redis-server imagemagick
wget -O chruby-0.3.6.tar.gz https://github.com/postmodern/chruby/archive/v0.3.6.tar.gz
tar -xzvf chruby-0.3.6.tar.gz
cd chruby-0.3.6/
make install
cd ..
wget -O ruby-install-0.2.1.tar.gz https://github.com/postmodern/ruby-install/archive/v0.2.1.tar.gz
tar -xzvf ruby-install-0.2.1.tar.gz
cd ruby-install-0.2.1/
make install
ruby-install -i /usr/local ruby 2.0.0-p195
echo "source /usr/local/share/chruby/chruby.sh" >> /etc/profile.d/chruby.sh && chmod u+x /etc/profile.d/chruby.sh
gem install passenger --verbose --no-ri --no-rdoc
passenger-install-nginx-module --prefix=/opt/nginx --auto --auto-download --extra-configure-flags="--with-http_ssl_module"
echo "pid /var/run/nginx.pid;" >> /opt/nginx/conf/nginx.conf
curl -o /etc/init.d/nginx https://raw.github.com/gist/1405605
chmod +x /etc/init.d/nginx
/usr/sbin/update-rc.d -f nginx defaults
/etc/init.d/nginx start
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment