1.Install
$> gem install sinatra
$> gem install unicorn
2.SinatraApplication
$> vi app.rb
require 'rubygems'
require 'sinatra'
get '/' do
"Hello World!"
end
3.Config.ru
$> vi config.ru
require 'app.rb'
run Sinatra::Application
4.Unicorn.conf
$> vi unicorn.conf
# ワーカーの数
worker_processes 2
# ソケット
listen '/tmp/unicorn.sock'
listen 80, :tcp_nopush => false
# ログ
stderr_path 'tmp/log/unicorn.log'
stdout_path 'tmp/log/unicorn.log'
5.Work Directory
$> mkdir tmp
$> mkdir tmp/log
6.Run
$> sudo unicorn -c unicorn.conf