Digital Ocean Second app - maxflex/codering GitHub Wiki
cd /etc/default and clone the unicorn file.
Open up a newly created unicorn file and edit the APP_ROOT and PID variables. Also, export all the variables needed at the end of this file.
Create a file within the app's config directory called unicorn.rb
cd /etc/init.d and clone the unicron file. Open up a newly created file and replace everything with your new app's name
:%s/old_app_name/new_app_name/g
The last step is to add autostart on server reboot.
Check the current runlevel using runlevel
cd into /etc/rc[runlevel].d and create a new symlink for the app.
ln -s /etc/init.d/unicorn_courses S[runlevel]unicorn_courses
NGINX CONFIG
cd /etc/nginx/sites-enabled and cp old_app new_app
:%s/old_app_name/new_app_name/g
Specify the new domain name in server_name
THE LAST STEPS
cd into the new app's current folder and run bundle, rake db:create, rake db:migrate