one-liner to install nginx with passenger and ssl

Just build this little guy for our puppet script, maybe someone needs it too 🙂

export V=0.7.67 && wget -O /tmp/nginx-$V.tar.gz$V.tar.gz && cd /tmp && tar xzvf nginx-$V.tar.gz && sudo passenger-install-nginx-module --nginx-source-dir /tmp/nginx-$V --extra-configure-flags="--with-http_ssl_module" --auto --prefix=/opt/nginx-$V && rm /opt/nginx && sudo ln -s  /opt/nginx-$V /opt/nginx

(If you like the stock nginx without ssl, youll need the –auto-download option)

Sinatra on Nginx on Ubuntu on Passenger

Just wanted to share our setup, as reminder and help for others 😉

(do not forget to create a tmp and public folder inside your projects folder)

server {
  listen 80;

  access_log /var/log/xxx_access.log  main;
  error_log /var/log/xxx_error.log debug;
  root /srv/xxx/public;   # <--- be sure to point to 'public'!
  passenger_use_global_queue on;

require 'app'
disable :run
set :root, Pathname(__FILE__).dirname
run Sinatra::Application

require 'rubygems'
require 'sinatra'

get "/" do
  "Hello world from xxx"