FastCGI module

Fast Common Gateway Interface support

Overview
FastCGI is an open standard for generating dynamic web content. It is an extension of the existing CGI standard which is already familiar to most web programmers. FastCGI retains all the benefits of CGI programs, but eliminates a number of weaknesses inherent to CGI.

Reference

Configuration

Local Responders

To run local FastCGI responders, simply enable the FastCGI module and create a FastCGI alias in the map module. All programs in these directories will be executed as FastCGI responders. The first time a request to the program is made, the FastCGI module will automatically start the responder. Any subsequent requests will be passed directly to the responder. If, for any reason, the responder exits, the FastCGI module will seamlessly restart the program on the next request.

Remote Responders

Remote responders can run on different machines to that which runs your Zeus Web Server. This can lower the demands on the web server machine and increase performance. Remote responders are contacted by the webserver via a TCP/IP connection.

Like local responders, remote responders also require a FastCGI alias to be configured in the map module. This associates the location of the FastCGI program within the document root, the file system directory field is redundant when only using remote responders and can be set to /dev/null.

Unlike local responders, remote responders need to have machine and port information associated with each responder. This is set within the FastCGI Configuration page. To add a new remote responder, enter the URL of the responder into the "Docroot path" field. This should be the URL which is used to access the responder, and should be inside a FastCGI alias directory. In the "Remote machine" field you should enter either the machine name or IP address of the remote machine, followed by a ":" character, then the port number of the remote responder. Click on the "Add" button to update the changes.

To delete a remote FastCGI responder, simply click on the "Delete" button.

You may, in some instances, want to run remote responders locally on the web server. This has a few drawbacks, but one large advantage, it allows different virtual servers to share the same FastCGI responder. In this case simply enter localhost as the FastCGI hostname.

Authorizers

FastCGI authorizers do not require a URL from which to be accessed, so unlike responders they do not need to reside in a FastCGI alias directory. To configure a FastCGI authorizer enter in the "Docroot path" field, the location in the document tree to which the authorizer should apply. In the "FastCGI location" field enter the program location in the filesystem for local authorizers. For remote authorisers, you should enter either the machine name or IP address of the remote machine, followed by a ":" character, then the port number on which the remote authorizer runs. Click on the "Add" button to update the changes.

To delete a remote FastCGI responder, simply click on the "Delete" button.

When two FastCGI authorizers have overlapping portions of the document tree, both would need to return an allow result for access to be granted.

Starting remote responders and authorizers

As remote responders and authorizers run on a separate machine to the webserver, the webserver can not start them automatically as it does local FastCGI programs. Remote programs have to be started using the fcgirunner PERL script. As fcgirunner is written in PERL you should be able to run it on almost any platform, not just those on which you run Zeus Web Server, just ensure PERL5 is installed on the remote machine and copy over the fcgirunner script. The fcgirunner script can be found in $ZEUSHOME/web/bin directory. The fcgirunner program takes two arguments, the port number to listen on, and the name of the FastCGI program to run.