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 have written two C++ fastcgi applications (foo and foobar). I am running apache 2.2 (prefork) with mod_fcgid on Ubuntu 10.x.

I want to be able to setup apache so that:


will run the fastcgi app foo



will run the fastcgi app foobar

Note: The url above is intentionally invalid (missing the protocol type), since I cant post more than 1 link in this question.

How do I setup apache to achieve this?

share|improve this question

The easiest way is to use a FcgidWrapper directive with 'virtual' turned on. This means Apache won't even try to find the "real" file, just call the fcgi script instead.

DocumentRoot /whatever

<Directory /whatever/some/path1>
    FcgidWrapper /elsewhere/bin/foo virtual

<Directory /whatever/another/path1>
    FcgidWrapper /elsewhere/bin/foobar virtual

Alternatively, you could use mod_rewrite something like this:

DocumentRoot /whatever

<Directory /whatever>
    RewriteRule /some/path1 /fcgi/foo 
    RewriteRule /another/path1 /fcgi/foobar

<Directory /whatever/fcgi>
    SetHandler fcgid-script
share|improve this answer

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.