sudo apt-get update sudo apt-get upgrade
useradd deployer -G admin -m -s /bin/bash passwd deployer
#if digital ocean droplet may need to change PasswordAuthentication from no to yes in /etc/ssh/sshd_config before you can ssh-copy-id PasswordAuthentication yes sudo service sshd restart
ssh-copy-id [email protected]
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev libffi-dev nodejs yarn
#install RVM via https://github.com/rvm/ubuntu_rvm Edit .bashrc; add 'source /etc/profile.d/rvm.sh' to the end of the file Add user deployer to rvm group; sudo usermod -a -G rvm deployer; logout and login again Add symlink so rvm_capisrano works; mkdir .rvm && mkdir .rvm/bin && ln -s /usr/share/rvm/bin/rvm .rvm/bin/rvm
#https://www.phusionpassenger.com/library/install/nginx/install/oss/bionic/ as of 7Aug18 sudo apt-get install -y dirmngr gnupg sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 561F9B9CAC40B2F7 sudo apt-get install -y apt-transport-https ca-certificates sudo sh -c 'echo deb https://oss-binaries.phusionpassenger.com/apt/passenger bionic main > /etc/apt/sources.list.d/passenger.list' sudo apt-get update sudo apt-get install -y libnginx-mod-http-passenger sudo apt install -y nginx sudo server nginx restart
#edit /etc/nginx/sites-enabled/default server_name localhost; passenger_enabled on; rails_env production; root /home/deployer/remotegig/current/public;
install mysql or postgres
mysql sudo apt-get install mysql-server mysql-client libmysqlclient-dev mysql -u root -p CREATE DATABASE shift_manager_staging;
postgres sudo apt install postgresql postgresql-contrib libpq-dev sudo -i -u postgres createuser --interactive Enter name of role to add: pguser Shall the new role be a superuser? (y/n) y #set user password sudo -i -u postgres psql \password pguser \q to exit
install capistrano
cap production deploy #to create app folder on remote server
create /home/deployer/app/shared/config/database.yml production: adapter: postgresql encoding: unicode database: remotegig_production pool: 5 username: pguser password: pa$5wor9 host: localhost #create prod db sudo -i -u postgres psql create database app_production; \q
create /home/deployer/app/shared/config/secrets.yml production: secret_key_base: 7fbd5a0ab9541f96f3bbe00ce347075f8 sudo vim /etc/environment #to set environmet var PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games" SECRET_KEY_BASE="7fbd5a0ab9541f96f3bbe00ce347075f8"