You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Latest version at http://www.postgresql.org/download/linux/ubuntu/
# list postgres packages
dpkg -l | grep postgres
[Visit if upgrading: https://wiki.postgresql.org/wiki/Using_pg_upgrade_on_Ubuntu/Debian]
sudo -u postgres createuser creative
# If you would like to set a password for the user, you can do the following
sudo -u postgres psql
\password creative
create database <appname> owner creative;
( if need drop use `DROP DATABASE "<appname>";`)
# Give create priviledges to creative
ALTER USER creative CREATEDB;
ALTER USER creative WITH SUPERUSER;
\q
sudo apt-get install fail2ban
sudo nano /etc/ssh/sshd_config # use Apple+W to search in nano
Port 57321
LoginGraceTime 25
PermitRootLogin no
AllowUsers deployer root dokku # this directive you have to add
PasswordAuthentication no
sudo service ssh restart
Setup oh-my-fish
sudo add-apt-repository ppa:fish-shell/nightly-master
sudo apt-get update
sudo apt-get install fish
curl -L https://github.com/oh-my-fish/oh-my-fish/raw/master/bin/install | fish
omf install rvm
omf install robbyrussell
omf theme robbyrussell
sudo nano ~/.config/fish/config.fish << Put server defaults in
===
# general aliases
set -g -x fish_greeting ''
echo -e "Proceed to \033[38;5;208mfishy\033[0;00m business!"
alias get="sudo apt-get -y install"
alias opsh="command nano ~/.config/fish/config.fish"
alias ls="command ls -ABC --color"
alias lookup="command ps aux | grep"
alias keys="cd /home/deployer/.ssh/"
alias to_nginx="cd /etc/nginx"
# app specific
alias app="cd ~/apps/<appname>"
alias co!="cd ~/apps/<appname>/current; and bundle exec rails c -e production"
alias logs="cd /home/deployer/apps/<appname>/shared/log"
alias dumpit="pg_dump --format=c -h localhost --username creative <dbname> > latest.dump"
# dokku
alias dok="cd /home/dokku; and ls"
===
Configure Nginx
sudo ln -s /opt/nginx/ /etc/nginx # links the nginx executable into etc
sudo nano /etc/init.d/nginx_start.sh
#!/bin/bash
sudo /etc/init.d/nginx start
sudo chmod +x /etc/init.d/nginx_start.sh
sudo update-rc.d nginx_start.sh defaults
sudo nano /etc/nginx/nginx.conf # and find "server_names_hash_bucket_size", set to 128
sudo chown deployer:sudo -R /etc/nginx
# Adapt mina deploy from https://gist.github.com/Epigene/3ec6635246be042fac90
$ mina setup
# fill out /shared/config/database.yml
$ mina deploy[initialize]
# ssh into server app current folder and try 'bundle exec pumactl start'
After first deploy
sudo rm /etc/nginx/sites-enabled/default
sudo rm /etc/nginx/sites-available/default
sudo service nginx stop
sudo service nginx start
+ If json complains, do `sudo apt-get install libgmp-dev` and reboot
+ If mina complains about bundle command not being present, cd into project forlder and `gem install bundler`
+ See if environment gets secret keybase in secrets.yml and has it in env
+ See if all shared folders exist (log, system, pids)
+ See if environment file is copied from production but considers all requests local
+ For staging, add to environment: staing.rb
# config.serve_static_assets = false
# config.assets.compile = true
# config.assets.digest = true