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?


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
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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