Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to serve a FastCGI based Perl script using Snow Leopard's built-in Apache server (2.2.14 apparently).

I've heard something called MacPorts is required; which is some sort of 'apt'-like package manager for Macs.

Previously, I've configured FastCGI for Apache on Debian and Fedora.

What's the difference between configuring FastCGI for Apache in Linux versus OS X?

Are there any gotchas I need to be aware of before I begin?


share|improve this question

migrated from Aug 20 '10 at 0:10

This question came from our site for professional and enthusiast programmers.

OK, agree this is a SF question. I'm voting to move it there. – GeneQ Aug 18 '10 at 11:44

Install MacPorts (it's free), go to a Terminal window and type

sudo port install mod_fastcgi

To enable it:

echo LoadModule fastcgi_module modules/ | sudo tee -a /opt/local/apache2/conf/httpd.conf

Note this will build and install its own version of Apache. To switch from the default Apache install, go to System Preferences -> Sharing and uncheck Web Sharing, then in Terminal

sudo launchctl load -w /Library/LaunchDaemons/org.macports.apache2.plist

You can figure most of this out from the output that "port" gives you. To find more Apache modules try

port search apache

share|improve this answer
I strongly recommend leaving the system Perl alone and installing a new perl (Macports has bundles for 5.8.9, 5.10.1 and 5.12.1, or you can always build your own from source) to use with FastCGI. Subsequent updates from Apple could tread on your system Perl install, and (I speak from experience) it can all end in tears. It's much better to perform your customizations on a separate build that you control (and if you screw up something, you can always wipe it all and start over without fear). – Ether Aug 18 '10 at 16:19
Yeah, Apple specific directories such as /Library/Perl/Updates/5.10.0/darwin-thread-multi-2level give me goosebumps. Took a while to realize their prupose. – GeneQ Aug 20 '10 at 0:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.