Last active
November 29, 2021 01:42
-
-
Save johnrees/1985879 to your computer and use it in GitHub Desktop.
Standard Rails 5.* setup for Ubuntu 14.04 LTS
This file contains hidden or 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 | |
| sudo apt-get update -y | |
| # Add this to ~/.bashrc to remove timezone warnings | |
| echo 'export LC_ALL="en_US.UTF-8"' >> ~/.bashrc | |
| source ~/.bashrc | |
| # Install Rails Requirements w/ NGINX & NODE repo | |
| sudo apt-get install build-essential zlib1g-dev curl git-core libgeoip-dev python-software-properties libssl-dev openssl libreadline-dev -y | |
| # Install Nginx | |
| sudo apt-get install nginx -y | |
| sudo service nginx restart | |
| # Install Node | |
| curl -sL https://deb.nodesource.com/setup | sudo bash - | |
| sudo apt-get update -y | |
| sudo apt-get install nodejs -y | |
| # 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 (brew install ssh-copy-id) | |
| # 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.2.2 | |
| rbenv global 2.2.2 | |
| # Check installation went OK | |
| ruby -v | |
| # Install Bundler | |
| echo "gem: --no-ri --no-rdoc" > ~/.gemrc | |
| gem install bundler | |
| rbenv rehash | |
| # ... | |
| # Install postgres, redis, varnish etc | |
| # postgres 9.4 | |
| sudo sh -c "echo 'deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main' > /etc/apt/sources.list.d/pgdg.list" | |
| wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add - | |
| sudo apt-get update -y --fix-missing | |
| sudo apt-get install -y libpq-dev postgresql-9.4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment