An Open Access Peon

25 October 2013

Passenger Fusion-Nginx Node.js App Server for Ubuntu

Download and install Passenger Fusion from Install nginx and passenger:

sudo apt-get install nginx-full passenger

Download and install node.js from

sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs

In /etc/nginx/nginx.conf uncomment passenger_root and passenger_ruby:

passenger_root /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini;
passenger_ruby /usr/bin/ruby;

In /etc/nginx/sites-available/default add at the end of the server {} block:

server {
       passenger_enabled on;
       location /app1/ {
               root /home/user/webapps/app1/public;
               passenger_enabled on;

Follow the instructions at to create the app structure under /home/user/webapps/app1:

./tmp/restart.txt [touch this to re-deploy application]

app.js is a normal Node.js Web application (something that uses 'http.createServer().server.listen()').

Restart nginx:

sudo /etc/init.d/nginx restart

Then test your app:

curl http://localhost/app1/