Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
/usr/bin/env bash
mkdir -p ~/.tmux/logs
echo '-> Backup /etc/fstab and ~/.bashrc (root)'
cp /etc/fstab /etc/fstab.backup
cp ~/.bashrc ~/.bashrc.backup
echo '-> Make swap file /var/swap.img'
swapon -s
touch /var/swap.img
chmod 600 /var/swap.img
dd if=/dev/zero of=/var/swap.img bs=1024k count=2000
mkswap /var/swap.img
echo '-> Enable swap'
echo '/var/swap.img
none
swapon /var/swap.img
sysctl -w vm.swappiness=30
swap
sw
ALL=NOPASSWD:
ALL=NOPASSWD:
ALL=NOPASSWD:
ALL=NOPASSWD:
ALL=NOPASSWD:
ALL=NOPASSWD:
ALL=NOPASSWD:
ALL=NOPASSWD:
ALL=NOPASSWD:
/usr/sbin/service
/usr/sbin/service
/usr/sbin/service
/usr/sbin/service
/usr/sbin/service
/usr/sbin/service
/usr/sbin/service
/usr/sbin/service
/usr/sbin/service
nginx
nginx
nginx
nginx
nginx
nginx
nginx
nginx
nginx
start
stop
restart
reload
force-reload
status
configtest
rotate
upgrade
/etc/nginx/sites-enabled/ngin
/etc/init.d/puma-*
/etc/n
/etc/i
/home/deploy/*/shared/log/*.log {
weekly
rotate 5
missingok
notifempty
compress
create 666 deploy deploy
copytruncate
}
/home/deploy/pgbackup/*.log {
weekly
rotate 5
missingok
notifempty
compress
create 666 deploy deploy
copytruncate
}
CODE
echo '-> Setup rbenv and ps1.sh for deploy user'
su - deploy -c <<CODE /bin/bash
mkdir -p ~/.tmux/logs
cp ~/.bashrc ~/.bashrc.backup
echo 'gem: --no-rdoc --no-ri' > ~/.gemrc
echo '.. Install rbenv'
git clone --quiet https://github.com/sstephenson/rbenv.git
git clone --quiet https://github.com/sstephenson/ruby-build.git
/ruby-build
git clone --quiet https://github.com/jf/rbenv-gemset.git
/rbenv-gemset
git clone --quiet https://github.com/rkh/rbenv-update.git
/rbenv-update
~/.rbenv
~/.rbenv/plugins
~/.rbenv/plugins
~/.rbenv/plugins
Config /etc/nginx/nginx.conf'
$ vim /etc/nginx/nginx.conf'
Change worker_processes from "auto" to "1"'
Uncomment line # server_names_hash_bucket_size 64; (remove #)'
echo
echo '-> Done!'