-
-
Save july-12/7523839 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 Postgresql | |
add-apt-repository ppa:pitti/postgresql | |
apt-get update | |
apt-get -y install postgresql libpq-dev | |
## Setting postgresql | |
sudo -u postgres psql | |
\password ## set password for login postgres | |
create user <appname> with password 'secret'; | |
create database <appname>_production owner <appname>; | |
# Install telnet postfix | |
apt-get install telnet postfix | |
# 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 [email protected] | |
# Install rbenv | |
curl https://raw.github.com/fesplugas/rbenv-installer/master/bin/rbenv-installer | bash | |
vim ~/.bashrc # parst follow config on it | |
export RBENV_ROOT="${HOME}/.rbenv" | |
if [ -d "${RBENV_ROOT}" ]; then | |
export PATH="${RBENV_ROOT}/bin:${PATH}" | |
eval "$(rbenv init -)" | |
fi | |
. ~/.bashrc | |
rbenv bootstrap-ubuntu-12.04 | |
# Install ruby | |
## change ruby source from rubygem to taobao | |
cd ~/.rbenv/plugins/ruby-build/share/ruby-build/ | |
vi 2.0.0-p247 | |
change url: http://ruby.taobao.org/mirrors/ruby/ruby-2.0.0-p247.tar.gz | |
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 | |
# Change gem source -- http://ruby.taobao.org/ | |
gem sources --remove https://rubygems.org/ | |
gem sources -a http://ruby.taobao.org/ | |
gem sources -l | |
gem install bundler | |
rbenv rehash | |
# ... | |
# Install redis, varnish etc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment