mod_cgi.html revision e3d0ad4177632a17c3f1fa733a9623abf54cd289
2454dfa32c93c20a8522c6ed42fe057baaac9f9aStephan Bosch
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen<html>
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen<head>
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen<title>Apache module mod_cgi</title>
fa33df8230c2f27ae863ff83d4251923428d53c7Aki Tuomi</head>
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen
fa33df8230c2f27ae863ff83d4251923428d53c7Aki Tuomi<body>
c5f932968281763df360b9c97cef60f5f80d5e3dTimo Sirainen<!--#include virtual="header.html" -->
bdd36cfdba3ff66d25570a9ff568d69e1eb543cfTimo Sirainen
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen<h1>Module mod_cgi</h1>
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen
d951320d498ae0800b677b754dde71574102123bTimo SirainenThis module is contained in the <code>mod_cgi.c</code> file, and
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenis compiled in by default. It provides for execution of CGI scripts.
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo SirainenAny file with mime type <code>application/x-httpd-cgi</code> will be
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenprocessed by this module.
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen<!--%plaintext &lt;?INDEX {\tt application/x-httpd-cgi} mime type&gt; -->
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen<!--%plaintext &lt;?INDEX CGI scripts&gt; -->
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen<h2>Summary</h2>
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo SirainenAny file that has the mime type <code>application/x-httpd-cgi</code>
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenwill be treated as a CGI script, and run by the server, with its output
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenbeing returned to the client. Files acquire this type either by
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenhaving a name ending in an extension defined by the
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen<A HREF="mod_mime.html#addtype">AddType</A> directive, or by being in
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainena <A HREF="mod_alias.html#scriptalias">ScriptAlias</A> directory. <p>
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo SirainenWhen the server invokes a CGI script, it will add a variable called
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen<code>DOCUMENT_ROOT</code> to the environment. This variable will contain the
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenvalue of the <A HREF="core.html#documentroot">DocumentRoot</A>
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenconfiguration variable.
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen<h2>CGI Environment variables</h2>
091a2dea9d89734a7c1225eed511b3851693a757Timo SirainenThe server will set the CGI environment variables as described in the CGI
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainenspecification, with the following provisos:
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen<dl>
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen<dt>REMOTE_HOST
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen<dd>This will only be set if the server has not been compiled with
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen<code>MINIMAL_DNS</code>.
a21f618de284dc22a480af1371d5f5cea50a39dfTimo Sirainen<dt>REMOTE_IDENT
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen<dd>This will only be set if
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen<A HREF="core.html#identitycheck">IdentityCheck</A> is set to <code>on</code>.
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen<dt>REMOTE_USER
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen<dd>This will only be set if the CGI script is subject to authentication.
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen</dl>
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen<P>
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen
091a2dea9d89734a7c1225eed511b3851693a757Timo Sirainen<!--#include virtual="footer.html" -->
96f89d51e8315f644f46804a9f0fc4f685ac48bfTimo Sirainen</BODY>
091a2dea9d89734a7c1225eed511b3851693a757Timo Sirainen</HTML>
091a2dea9d89734a7c1225eed511b3851693a757Timo Sirainen
091a2dea9d89734a7c1225eed511b3851693a757Timo Sirainen