Skip to content

Instantly share code, notes, and snippets.

@mrsweaters
Forked from erotte/server_setup.md
Created February 5, 2012 04:18
Show Gist options
  • Star 16 You must be signed in to star a gist
  • Fork 9 You must be signed in to fork a gist
  • Save mrsweaters/1742642 to your computer and use it in GitHub Desktop.
Save mrsweaters/1742642 to your computer and use it in GitHub Desktop.
Vagrant Box Setup Ruby 1.9.3/Nginx/Passenger/MySQL
#!/usr/bin/env bash
# login as root and run this script via bash & curl:
apt-get update
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
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
cd && echo "[[ -s "/usr/local/rvm/scripts/rvm" ]] && . "/usr/local/rvm/scripts/rvm"" >> .bashrc
source /usr/local/rvm/scripts/rvm
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 &&
mv rails-nginx-passenger-ubuntu/nginx/nginx /etc/init.d/nginx &&
chown root:root /etc/init.d/nginx
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