Skip to content

Instantly share code, notes, and snippets.

@ipepe
Last active February 9, 2017 21:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ipepe/d2776d255372f86e45acabd7ac066ed4 to your computer and use it in GitHub Desktop.
Save ipepe/d2776d255372f86e45acabd7ac066ed4 to your computer and use it in GitHub Desktop.
Setup rails production server with rbenv, postgres nginx and passenger
sudo locale-gen "en_US.UTF-8"
sudo nano /etc/environment
#LC_ALL=en_US.UTF-8
#LANG=en_US.UTF-8
sudo reboot
adduser webapp
usermod -a -G admin webapp
nano /etc/apt/sources.list.d/pgdg.list
#deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-client-9.6 postgresql-9.6 postgresql-contrib-9.6 libpq-dev postgresql-server-dev-9.6
sudo -u postgres createuser -s webapp
sudo nano /etc/postgresql/9.5/main/pg_hba.conf
local all webapp trust
sudo -u postgres psql -c "ALTER USER webapp WITH superuser;"
#TODO: https://www.digitalocean.com/community/tutorials/how-to-deploy-a-rails-app-with-git-hooks-on-ubuntu-14-04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment