"Archlinux + Nginx + Passenger"

July 11, 2009

UPDATE: I’ve added this package to AUR. You can grab it here if you prefer to build it from AUR. Note: it automatically builds passenger’s nginx module so step 2. is not needed for it, you only need to have passenger gem installed.

If someone needs to setup Nginx web server with Passenger support quick on Archlinux here are few simple steps to get it running in minutes.

1. Make sure you have the latest Passenger gem installed:

sudo gem install passenger

2. Compile Passenger module for Nginx:

cd `passenger-config --root`; sudo rake nginx

3. Download this PKGBUILD (modified PKGBUILD of nginx-0.7.61-1 from community repository with passenger module added)

4. Unpack and build package (if running as non-root be sure you have fakeroot package installed):

tar xf archlinux-nginx-passenger.tgz
cd nginx
makepkg

5. Install package:

sudo pacman -U nginx-0.7.61-1-i686.pkg.tar.gz

6. Set Passenger’s root directory in /etc/nginx/conf/nginx.conf:

http {
  ...
  passenger_root /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4;
  ...
}

7. Enable Passenger in your vhost:

server {
  listen 80;
  server_name foo.bar.net;
  root /var/www/foo.bar.net/public;
  passenger_enabled on;
}

Restart nginx and that’s it. Now your Arch can serve ruby apps under Passenger.

Kudos for Phusion guys for creating such simple and really good working solution for hassle-free deployment!

Read more about archlinux, deployment, nginx, passenger, ruby.
blog comments powered by Disqus