FCGI

| | Comments (1) | TrackBacks (0)

Today I took a waist-deep plunge into the mud puddle that is FastCGI. I use this metaphor advisedly, because the puddle didn’t look very deep (mud puddles never do), and it wasn’t really very deep (they rarely are), but it was deeper than I thought at first (as one invariably discovers after ruining one’s shoes). I’ll spare you the full discussion of my failed attempts; the upshot is that the site is now a lot faster when a script is executed (e.g., when a search is performed), thanks to some clever techniques employed by FastCGI. In case you care to replicate my results, keep on reading.

The internet abounds with guides to installing FastCGI for MovableType on DreamHost, and some of them are close to correct, but none of them told me quite what I needed to know. For the record, I had to

  1. Install FastCGI for perl (Dreamhost enables it for ruby and python, but not perl). Note that /home/ben/benjamn.com/lib is where my installation of MovableType looks for libraries. Alter your PREFIX if your lib lives elsewhere.

    mkdir -p ~/src && cd ~/src
    curl -O http://search.cpan.org/CPAN/authors/id/S/SK/SKIMO/FCGI-0.67.tar.gz
    tar zxvf FCGI-0.67.tar.gz
    cd FCGI-0.67
    perl Makefile.pl PREFIX=/home/ben/benjamn.com/ --use-installed
    make && make test && make install
    
  2. Install the latest perl wrapper for SQLite (since I use SQLite for my database). Nearly the same as above, but using a different .tar.gz file:

    http://search.cpan.org/CPAN/authors/id/M/MS/MSERGEANT/DBD-SQLite-1.14.tar.gz
    
  3. Add the following section to my mt-config.cgi file:

    ##### FastCGI #####
    AdminScript mt.fcgi
    CommentScript mt-comments.fcgi
    TrackbackScript mt-tb.fcgi
    SearchScript mt-search.fcgi
    ViewScript mt-view.fcgi
    XMLRPCScript mt-xmlrpc.fcgi
    AtomScript mt-atom.fcgi
    UpgradeScript mt-upgrade.fcgi
    ActivityFeedScript mt-feed.fcgi
    LaunchBackgroundTasks 0
    
  4. For each of the .fcgi filenames listed in the previous step, rename the corresponding .cgi file to have the .fcgi extension.

Now I use /mt.fcgi to access the administrative interface, and everything else just works (quickly).

0 TrackBacks

Listed below are links to blogs that reference this entry: FCGI.

TrackBack URL for this entry: http://benjamn.com/mt-tb.cgi/20

1 Comments

thanks! I'm on dreamhost too and after seeing MT on your site, I'm giving it a try too :).

Leave a comment

About this Entry

This page contains a single entry by Ben Newman published on May 19, 2008 4:49 PM.

Goodtime Jesus was the previous entry in this blog.

Two cranes is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Categories

Pages

Powered by Movable Type 4.1