mod_cgi.html revision e3d0ad4177632a17c3f1fa733a9623abf54cd289
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head>
<title>Apache module mod_cgi</title>
</head>
<body>
<!--#include virtual="header.html" -->
<h1>Module mod_cgi</h1>
This module is contained in the <code>mod_cgi.c</code> file, and
is compiled in by default. It provides for execution of CGI scripts.
Any file with mime type <code>application/x-httpd-cgi</code> will be
processed by this module.
<!--%plaintext &lt;?INDEX {\tt application/x-httpd-cgi} mime type&gt; -->
<!--%plaintext &lt;?INDEX CGI scripts&gt; -->
<h2>Summary</h2>
Any file that has the mime type <code>application/x-httpd-cgi</code>
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
<A HREF="mod_mime.html#addtype">AddType</A> directive, or by being in
a <A HREF="mod_alias.html#scriptalias">ScriptAlias</A> directory. <p>
When the server invokes a CGI script, it will add a variable called
<code>DOCUMENT_ROOT</code> to the environment. This variable will contain the
value of the <A HREF="core.html#documentroot">DocumentRoot</A>
configuration variable.
<h2>CGI Environment variables</h2>
The server will set the CGI environment variables as described in the CGI
specification, with the following provisos:
<dl>
<dt>REMOTE_HOST
<dd>This will only be set if the server has not been compiled with
<code>MINIMAL_DNS</code>.
<dt>REMOTE_IDENT
<dd>This will only be set if
<A HREF="core.html#identitycheck">IdentityCheck</A> is set to <code>on</code>.
<dt>REMOTE_USER
<dd>This will only be set if the CGI script is subject to authentication.
</dl>
<P>
<!--#include virtual="footer.html" -->
</BODY>
</HTML>