Autonomous Machine

Posts tagged with Installation

Install Passenger and nginx from source on Ubuntu

Passenger 2.2.3 came out this week, and while up until now I was using the Ubuntu packages from Brightbox (great blokes, really), I was having some problems with serving caches files and I didn't want to wait for the package to be updated. The package itself can be found on Github if you'd like to see it in more detail.

I used a combination of two guides to get everything working: one at Slicehost's wiki and another blog post by someone whose name may or may not be Johnny Pez.

It can be a little confusing to jump back and forth between the two, so I've posted a compiled set of steps here. After working through this article, you can continue on with the second Slicehost article for setting up the rest of your environment.


I'm going to assume you have Ruby and RubyGems installed. If not, do that first before continuing.

Install the Passenger gem:

sudo gem install passenger

Then you need to build the nginx extension, which will be needed when we compile it.

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


You'll need to install nginx's prerequisites:

sudo apt-get install libpcre3 libpcre3-dev libpcrecpp0 libssl-dev

Then, download the nginx source and unpack it. Everyone seems to be using the legacy stable version of nginx, and I haven't tried any of the newer ones yet.

tar xzvf nginx-0.6.37.tar.gz

Now we need to configure nginx.

cd nginx-0.6.37
./configure --sbin-path=/usr/local/sbin --with-http_ssl_module  \
--add-module=`passenger-config --root`/ext/nginx

You can change the configure flags if you want (see the comments on the Slicehost article), but I've left them alone so the rest of Slicehost's articles can be followed without modification.

Assuming the configure succeeded, all that's left is to compile and install.

sudo make install

All Systems Go

To make sure everything is working, start nginx:

sudo /usr/local/sbin/nginx

Visit your server's IP, and you should see the nginx welcome screen. This is good! Kill nginx:

sudo kill `cat /usr/local/nginx/logs/`

Now continue on with the Slicehost series to complete your nginx configuration. You'll also probably want to mirror the default configuration layout (these articles specify Intrepid, but the steps will be pretty close on most recent versions of Ubuntu).

  • June 19, 2009
  • Article
  • Code, Installation, Rails, Ruby

Building Sphinx 0.9.9RC1 with PostgreSQL 8.3 support via MacPorts on Mac OS 10.5

Up until today I was using the version of Sphinx provided by MacPorts, 0.9.8, as a lot of developers probably are. It installed painlessly, but I'm in the process of auditioning several different search engine options for a project and I wanted to make sure I was using the latest in my comparisons. I'm also using a PostgreSQL 8.3 database, which requires specifying a few additional options to configure.

Here are the commands I used to install Sphinx 0.9.9RC1 (run inside the Sphinx source directory after you download it):

export LDFLAGS="-L/usr/lib"
./configure --with-pgsql --with-pgsql-includes=/opt/local/include/postgresql83/ \
sudo make install

The first line ensures that make can find the system iconv libraries. Otherwise, it's a pretty straight forward process.


A simpler solution is to make sure that the pg_config executable can be found on your path. Add /opt/local/lib/postgresql83/bin/ to your path, and then you can simply use:

export LDFLAGS="-L/usr/lib"
./configure --with-pgsql
sudo make install
  • January 24, 2009
  • Article
  • Installation, Mac