Skip to content

Instantly share code, notes, and snippets.

@phcostabh
Forked from mrsweaters/setup.sh
Last active December 15, 2015 09:09
Show Gist options
  • Save phcostabh/5236787 to your computer and use it in GitHub Desktop.
Save phcostabh/5236787 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# login as root and run this script via bash & curl:
sudo apt-get update
sudo apt-get install -y build-essential bison openssl libreadline5 libreadline5-dev curl \
git-core zlib1g zlib1g-dev libopenssl-ruby libcurl4-openssl-dev libssl-dev \
libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libmysqlclient-dev \
mysql-client mysql-server
curl -L https://get.rvm.io | bash -s stable
[ ! -e ~/.bash_login ] && echo "source ~/.profile" > ~/.bash_login
source ~/.profile
rvm autolibs enable
rvm requirements
type rvm | head -n1
rvm install 1.9.3
rvm use 1.9.3 --default
echo "gem: --no-rdoc --no-ri" >> /etc/gemrc
gem install passenger
passenger-install-nginx-module --auto --auto-download
rvm wrapper 1.9.3 passenger
cd &&
git clone git://github.com/jnstq/rails-nginx-passenger-ubuntu.git &&
sudo mv rails-nginx-passenger-ubuntu/nginx/nginx /etc/init.d/nginx &&
sudo chown root:root /etc/init.d/nginx
sudo update-rc.d nginx defaults
echo "Nginx successfully installed!"
echo "add this section (or similar) to your nginx.conf and edit:"
echo
echo "server {"
echo " listen 80;"
# echo " server_name screencake.com;"
echo " root /vagrant/public;"
echo " passenger_enabled on;"
echo "}"
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment