Skip to content

Instantly share code, notes, and snippets.

@charly-vega
Last active October 14, 2016 14:03
Show Gist options
  • Save charly-vega/c4067d4e5f5d29835cf0764603424398 to your computer and use it in GitHub Desktop.
Save charly-vega/c4067d4e5f5d29835cf0764603424398 to your computer and use it in GitHub Desktop.
# root
adduser deploy-user
# ...
visudo
# ...
# deploy-user
sudo apt-get update
sudo apt-get install git
# Install rbenv, together with rbenv-build and rbenv-gem-rehash plugins
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
git clone https://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo `~/.rbenv/bin/rbenv init` >> ~/.bash_profile
source ~/.bash_profile
# Install Ruby 2.3.0
sudo apt-get install -y libssl-dev libreadline-dev zlib1g-dev
rbenv install 2.3.0 --verbose
rbenv global 2.3.0
# Disable apache2
sudo update-rc.d -f apache2 remove
# via https://www.phusionpassenger.com/library/install/nginx/install/oss/trusty/#step-1:-install-passenger-packages
# Install our PGP key and add HTTPS support for APT
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 561F9B9CAC40B2F7
sudo apt-get install -y apt-transport-https ca-certificates
# Add our APT repository
sudo sh -c 'echo deb https://oss-binaries.phusionpassenger.com/apt/passenger trusty main > /etc/apt/sources.list.d/passenger.list'
sudo apt-get update
# Install Passenger + Nginx
sudo apt-get install -y nginx-extras passenger
# TODO include nginx passenger module at /etc/nginx/nginx.conf
# details at https://www.phusionpassenger.com/library/install/nginx/install/oss/trusty/#step-2:-enable-the-passenger-nginx-module-and-restart-nginx
sudo ufw allow ssh
sudo ufw allow http
sudo ufw allow https
sudo ufw enable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment