Apache FAQ FastCGI

LoadModule fastcgi_module modules/mod_fastcgi.so

<IfModule mod_fastcgi.c>
    # URIs that begin with /fcgi-bin/, are found in /var/www/fcgi-bin/
    Alias /fcgi-bin/ /var/www/fcgi-bin/

    # Anything in here is handled as a "dynamic" server if not defined as "static" or "external"

    <Directory /var/www/fcgi-bin/>
        SetHandler fastcgi-script
        Options +ExecCGI
    </Directory>

    # Anything with one of these extensions is handled as a "dynamic"  server if not defined as
    # "static" or "external". Note: "dynamic" servers require ExecCGI to be on in their directory.
    AddHandler fastcgi-script .fcgi .fpl

    # Start a "static" server at httpd initialization inside the scope of the SetHandler
    FastCgiServer /var/www/fcgi-bin/echo -processes 5

    # Start a "static" server at httpd initialization inside the scope of the AddHandler

    FastCgiServer /var/www/htdocs/some/path/echo.fcgi

    # Start a "static" server at httpd initialization outside the scope of the Set/AddHandler
    FastCgiServer /var/www/htdocs/some/path/coolapp
    <Directory /var/www/htdocs/some/path/coolapp>
        SetHandler fastcgi-script
    </Directory>
</IfModule>