public
Last active

Standard Rails 4.* setup for Ubuntu 12.04 LTS 32

  • Download Gist
ubuntu_steps.sh
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
# As root user
 
sudo su
 
# Update the OS
apt-get update -y
 
# Add this to ~/.bashrc to remove timezone warnings
export LC_ALL="en_US.UTF-8"
source ~/.bashrc
 
# Install Rails Requirements w/ NGINX & NODE repo
apt-get install build-essential zlib1g-dev curl git-core libgeoip-dev python-software-properties libssl-dev openssl libreadline-dev -y
 
# Add Nginx and Node
add-apt-repository ppa:nginx/stable
add-apt-repository ppa:chris-lea/node.js
apt-get update
apt-get install nginx nodejs -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
 
# logout
# ssh-copy-id keys to server
# login as deployer
 
# Say hello to git
ssh git@github.com
 
# Install rbenv
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.profile
echo 'eval "$(rbenv init -)"' >> ~/.profile
exec $SHELL -l
 
# Install Ruby build
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
rbenv rehash
rbenv install 2.0.0-p247
rbenv global 2.0.0-p247
 
# Check installation went OK
ruby -v
 
# Install Bundler
vim ~/.gemrc
gem: --no-ri --no-rdoc
gem install bundler
rbenv rehash
 
# ...
# Install postgres, redis, varnish etc

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.