Using Digital Ocean as our PaaS
By the end of this lesson, you will have a server configured with the following:
It will also have the following gems pre-installed:
Finally, it creates a default /var/www/app directory for you to start with.
rm -v /etc/nginx/sites-available/default/etc/nginx/conf.d/default.conf/var/www/app/unicorn.rbnano setup.shchmod u+x setup.sh./setup.shThis script has been tested on Ubuntu 14.04.
service nginx stopbundle install to install your required gems.bundle exec rackup -p 80 --host 0.0.0.0 to run your application.nohup bundle exec rackup -p 80 --host 0.0.0.0bundle install to install your gems.unicorn -c unicorn.rb -DNow you need to restart nginx.
service nginx restart
And that's it! Your server should be browsable by IP/domain on port 80 unless you modified the config scripts.
service nginx start (starts the nginx server)service nginx stop (stops the nginx server)service nginx restart (restarts the nginx server)Have you made changes to your app but don't see them?
bundle from your app directory.unicorn -c unicorn.rb -Dservice nginx restart