Create droplet of your liking (ubuntu 12.10 x32)
On Digital Ocean, create a DNS entry for your server (xyz.com)
Make sure it has NS records that use digital oceans nameservers
# This library fixes common problems with turbolinks | |
# - Overwrite setTimeout and setInterval to intercept generated ID's | |
# - Keep track of Ajax requests | |
# | |
# When turbolinks' unload event is called, we: | |
# - Cancel all setTimeouts and setIntervals | |
# - Abort all still running Ajax requests | |
$.turboTurbo = |
# for redirecting hhtp traffic to https version of the site | |
server { | |
listen 80; | |
server_name example.com; | |
return 301 https://$server_name$request_uri; | |
} | |
# for redirecting to non-www version of the site | |
server { | |
listen 80; |
# paths | |
app_path = "/home/deployer/qna" | |
working_directory "#{app_path}/current" | |
pid "#{app_path}/current/tmp/pids/unicorn.pid" | |
# listen | |
listen "/tmp/unicorn.qna.sock", :backlog => 64 | |
# logging | |
stderr_path "log/unicorn.stderr.log" |
### Nginx ### | |
check process nginx with pidfile /opt/nginx/logs/nginx.pid | |
start program = "/etc/init.d/nginx start" | |
stop program = "/etc/init.d/nginx stop" | |
if cpu > 60% for 2 cycles then alert | |
if cpu > 80% for 5 cycles then restart | |
if memory usage > 80% for 5 cycles then restart | |
if failed host 127.0.0.1 port 80 protocol http | |
then restart | |
if 3 restarts within 5 cycles then timeout |