Skip to content

Instantly share code, notes, and snippets.

@thehenster
Forked from johnrees/_ubuntu_steps.sh
Last active December 10, 2015 06:58
Show Gist options
  • Save thehenster/4397828 to your computer and use it in GitHub Desktop.
Save thehenster/4397828 to your computer and use it in GitHub Desktop.
# As root user
sudo su
# Update the OS
apt-get update -y
# Setup Hostname & TimeZone
echo "{{HOSTNAME}}" > /etc/hostname
hostname -F /etc/hostname
dpkg-reconfigure tzdata
# Install Rails Requirements
apt-get install build-essential zlib1g-dev curl git-core libgeoip-dev libxml2-dev libxslt-dev libmysqlclient-dev imagemagick libmagickwand-dev -y
apt-get install mysql-server
# Install NGINX & NODE
apt-get install python-software-properties -y
add-apt-repository ppa:nginx/stable
apt-get update
apt-get install nginx -y
sudo service nginx restart
# Install Firewall
apt-get install ufw -y
ufw enable
ufw allow 22
ufw allow 80
# Add Deployment User
groupadd admin
adduser deployer --ingroup admin
su deployer
# ssh-copy-id keys to server
# Setup GIT
ssh git@github.com
# Install Ruby (RBENV) as per http://bit.ly/yr6Sw6
curl -L https://raw.github.com/fesplugas/rbenv-installer/master/bin/rbenv-installer | bash
vi ~/.bash_profile
export RBENV_ROOT="${HOME}/.rbenv"
if [ -d "${RBENV_ROOT}" ]; then
export PATH="${RBENV_ROOT}/bin:${PATH}"
eval "$(rbenv init -)"
fi
alias b='bundle exec'
source ~/.bash_profile
rbenv bootstrap-ubuntu-12-04
rbenv install 1.9.3-p327
rbenv global 1.9.3-p327
# Check installation went OK
ruby -v
# Install Bundler
vim ~/.gemrc
gem: --no-ri --no-rdoc
gem install bundler
rbenv rehash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment