Ruby environment set up and configured, including passenger gem nginx source downloaded and extracted to /usr/local/src or wherever build-essential, curl and other basic development packages installed
passenger-install-nginx-module
Pick the 2nd (custom) option when it asks for how to install. It'll subsequently ask for your nginx source directory. Type in wherever you extracted it (see prerequisites above) When the install asks for custom configuration options, I like to use:
--with-http_ssl_module --with-debug --conf-path=/etc/nginx/nginx.conf --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --http-client-body-temp-path=/var/lib/nginx/body --http-proxy-temp-path=/var/lib/nginx/proxy --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --http-scgi-temp-path=/var/lib/nginx/scgi --with-http_stub_status_module --user=www-data --group=www-data --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --with-ipv6
wget http://nginx-init-ubuntu.googlecode.com/files/nginx-init-ubuntu_v2.0.0-RC2.tar.bz2
tar --use-compress-program bzip2 -xvf nginx-init-ubuntu_v2.0.0-RC2.tar.bz2
mv nginx /etc/init.d
chmod +x /etc/init.d/nginx
update-rc.d -f nginx defaults
vi /etc/logrotate.d/nginx
/var/log/nginx/*.log {
weeklymissingok
rotate 52
compress
delaycompress
notifempty
create 640 root adm
sharedscripts
postrotate
[ ! -f /var/run/nginx.pid ] || kill -USR1 `cat /var/run/nginx.pid`
endscript
}