Module mod_cgi

This module is contained in the mod_cgi.c file, and is compiled in by default. It provides for execution of CGI scripts. Any file with mime type application/x-httpd-cgi will be processed by this module.


Any file that has the mime type application/x-httpd-cgi will be treated as a CGI script, and run by the server, with its output being returned to the client. Files acquire this type either by having a name ending in an extension defined by the AddType directive, or by being in a ScriptAlias directory.

When the server invokes a CGI script, it will add a variable called DOCUMENT_ROOT to the environment. This variable will contain the value of the DocumentRoot configuration variable.

CGI Environment variables

The server will set the CGI environment variables as described in the CGI specification, with the following provisos:
This will only be set if the server has not been compiled with MINIMAL_DNS.
This will only be set if IdentityCheck is set to on.
This will only be set if the CGI script is subject to authentication.

Home Index