| <?xml version="1.0" encoding="ISO-8859-1"?> |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head> |
| <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" /> |
| <!-- |
| XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX |
| This file is generated from xml source: DO NOT EDIT |
| XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX |
| --> |
| <title>mod_fcgid - Apache HTTP Server Version 2.5</title> |
| <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> |
| <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> |
| <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" /> |
| <script src="../style/scripts/prettify.min.js" type="text/javascript"> |
| </script> |
| |
| <link href="../images/favicon.ico" rel="shortcut icon" /></head> |
| <body> |
| <div id="page-header"> |
| <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/quickreference.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p> |
| <p class="apache">Apache HTTP Server Version 2.5</p> |
| <img alt="" src="../images/feather.gif" /></div> |
| <div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div> |
| <div id="path"> |
| <a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs/">Documentation</a> > <a href="../">Version 2.5</a> > <a href="./">Modules</a></div> |
| <div id="page-content"> |
| <div id="preamble"><h1>Apache Module mod_fcgid</h1> |
| <div class="toplang"> |
| <p><span>Available Languages: </span><a href="../en/mod/mod_fcgid.html" title="English"> en </a></p> |
| </div> |
| <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Provides for execution of FastCGI applications</td></tr> |
| <tr><th><a href="module-dict.html#Status">Status:</a></th><td>External</td></tr> |
| <tr><th><a href="module-dict.html#ModuleIdentifier">Module Identifier:</a></th><td>fcgid_module</td></tr> |
| <tr><th><a href="module-dict.html#SourceFile">Source File:</a></th><td>mod_fcgid.c</td></tr> |
| <tr><th><a href="module-dict.html#Compatibility">Compatibility:</a></th><td>Apache 2.0 and higher</td></tr></table> |
| <h3>Summary</h3> |
| |
| <p>Any program assigned to the handler <code>fcgid-script</code> is processed |
| using the FastCGI protocol; <code class="module"><a href="../mod/mod_fcgid.html">mod_fcgid</a></code> starts a sufficient |
| number instances of the program to handle concurrent requests, and these |
| programs remain running to handle further incoming requests. This is |
| significantly faster than using the default |
| <a href="//httpd.apache.org/docs/current/mod/mod_cgi.html">mod_cgi</a> or |
| <a href="//httpd.apache.org/docs/current/mod/mod_cgid.html">mod_cgid</a> |
| modules to launch the program upon each request. |
| However, the programs invoked by <code class="module"><a href="../mod/mod_fcgid.html">mod_fcgid</a></code> continue to |
| consume resources, so the administrator must weigh the impact of invoking |
| a particular program once per request against the resources required to |
| leave a sufficient number of instances running continuously.</p> |
| |
| <p>The pool of fcgid-invoked programs is shared between all httpd workers. |
| Configuration directives below let the administrator tune the number of |
| instances of the program that will run concurrently.</p> |
| |
| <p>Specific executables are assigned this handler either by having a name |
| containing an extension defined by the |
| <a href="//httpd.apache.org/docs/current/mod/mod_mime.html#addhandler">AddHandler</a> |
| directive, or with an override using the |
| <a href="//httpd.apache.org/docs/current/mod/mod_mime.html#sethandler">SetHandler</a> |
| directive (e.g., for all files in a specific directory such as cgi-bin).</p> |
| |
| <p>Some changes have been made in the ASF release of mod_fcgid which |
| can affect existing configurations. All documentation refers to new |
| names for the directives. (The old names still work but are now |
| deprecated.) Please read the <a href="#upgrade">Upgrade Notes</a> for |
| details.</p> |
| |
| <p>For an introduction to using CGI scripts with Apache, see |
| the generic tutorial on <a href="//httpd.apache.org/docs/howto/cgi.html">Dynamic Content |
| with CGI</a>.</p> |
| |
| <p><code class="module"><a href="../mod/mod_fcgid.html">mod_fcgid</a></code> requires <a href="//httpd.apache.org/docs/current/mod/mod_unixd.html">mod_unixd</a> |
| to be loaded before itself in the httpd config.</p> |
| |
| </div> |
| <div id="quickview"><h3>Topics</h3> |
| <ul id="topics"> |
| <li><img alt="" src="../images/down.gif" /> <a href="#upgrade">Upgrade Notes</a></li> |
| <li><img alt="" src="../images/down.gif" /> <a href="#errordocuments">Fcgid and Apache ErrorDocument</a></li> |
| <li><img alt="" src="../images/down.gif" /> <a href="#examples">Examples</a></li> |
| <li><img alt="" src="../images/down.gif" /> <a href="#process-mgmt">Process Management</a></li> |
| </ul><h3 class="directives">Directives</h3> |
| <ul id="toc"> |
| <li><img alt="" src="../images/down.gif" /> <a href="#fcgidaccesschecker">FcgidAccessChecker</a></li> |
| <li><img alt="" src="../images/down.gif" /> <a href="#fcgidaccesscheckerauthoritative">FcgidAccessCheckerAuthoritative</a></li> |
| <li><img alt="" src="../images/down.gif" /> <a href="#fcgidauthenticator">FcgidAuthenticator</a></li> |
| <li><img alt="" src="../images/down.gif" /> <a href="#fcgidauthenticatorauthoritative">FcgidAuthenticatorAuthoritative</a></li> |
| <li><img alt="" src="../images/down.gif" /> <a href="#fcgidauthorizer">FcgidAuthorizer</a></li> |
| <li><img alt="" src="../images/down.gif" /> <a href="#fcgidauthorizerauthoritative">FcgidAuthorizerAuthoritative</a></li> |
| <li><img alt="" src="../images/down.gif" /> <a href="#fcgidbusyscaninterval">FcgidBusyScanInterval</a></li> |
| <li><img alt="" src="../images/down.gif" /> <a href="#fcgidbusytimeout">FcgidBusyTimeout</a></li> |
| <li><img alt="" src="../images/down.gif" /> <a href="#fcgidcmdoptions">FcgidCmdOptions</a></li> |
| <li><img alt="" src="../images/down.gif" /> <a href="#fcgidconnecttimeout">FcgidConnectTimeout</a></li> |
| <li><img alt="" src="../images/down.gif" /> <a href="#fcgiderrorscaninterval">FcgidErrorScanInterval</a></li> |
| <li><img alt="" src="../images/down.gif" /> <a href="#fcgidfixpathinfo">FcgidFixPathinfo</a></li> |
| <li><img alt="" src="../images/down.gif" /> <a href="#fcgididlescaninterval">FcgidIdleScanInterval</a></li> |
| <li><img alt="" src="../images/down.gif" /> <a href="#fcgididletimeout">FcgidIdleTimeout</a></li> |
| <li><img alt="" src="../images/down.gif" /> <a href="#fcgidinitialenv">FcgidInitialEnv</a></li> |
| <li><img alt="" src="../images/down.gif" /> <a href="#fcgidiotimeout">FcgidIOTimeout</a></li> |
| <li><img alt="" src="../images/down.gif" /> <a href="#fcgidipcdir">FcgidIPCDir</a></li> |
| <li><img alt="" src="../images/down.gif" /> <a href="#fcgidmaxprocesses">FcgidMaxProcesses</a></li> |
| <li><img alt="" src="../images/down.gif" /> <a href="#fcgidmaxprocessesperclass">FcgidMaxProcessesPerClass</a></li> |
| <li><img alt="" src="../images/down.gif" /> <a href="#fcgidmaxrequestinmem">FcgidMaxRequestInMem</a></li> |
| <li><img alt="" src="../images/down.gif" /> <a href="#fcgidmaxrequestlen">FcgidMaxRequestLen</a></li> |
| <li><img alt="" src="../images/down.gif" /> <a href="#fcgidmaxrequestsperprocess">FcgidMaxRequestsPerProcess</a></li> |
| <li><img alt="" src="../images/down.gif" /> <a href="#fcgidminprocessesperclass">FcgidMinProcessesPerClass</a></li> |
| <li><img alt="" src="../images/down.gif" /> <a href="#fcgidoutputbuffersize">FcgidOutputBufferSize</a></li> |
| <li><img alt="" src="../images/down.gif" /> <a href="#fcgidpassheader">FcgidPassHeader</a></li> |
| <li><img alt="" src="../images/down.gif" /> <a href="#fcgidprocesslifetime">FcgidProcessLifeTime</a></li> |
| <li><img alt="" src="../images/down.gif" /> <a href="#fcgidprocesstablefile">FcgidProcessTableFile</a></li> |
| <li><img alt="" src="../images/down.gif" /> <a href="#fcgidspawnscore">FcgidSpawnScore</a></li> |
| <li><img alt="" src="../images/down.gif" /> <a href="#fcgidspawnscoreuplimit">FcgidSpawnScoreUpLimit</a></li> |
| <li><img alt="" src="../images/down.gif" /> <a href="#fcgidterminationscore">FcgidTerminationScore</a></li> |
| <li><img alt="" src="../images/down.gif" /> <a href="#fcgidtimescore">FcgidTimeScore</a></li> |
| <li><img alt="" src="../images/down.gif" /> <a href="#fcgidwin32preventorphans">FcgidWin32PreventOrphans</a></li> |
| <li><img alt="" src="../images/down.gif" /> <a href="#fcgidwrapper">FcgidWrapper</a></li> |
| <li><img alt="" src="../images/down.gif" /> <a href="#fcgidzombiescaninterval">FcgidZombieScanInterval</a></li> |
| </ul> |
| <h3>See also</h3> |
| <ul class="seealso"> |
| <li><a href="//httpd.apache.org/docs/howto/cgi.html">Dynamic Content With CGI</a></li> |
| <li><a href="//httpd.apache.org/docs/mod/mod_cgi.html">mod_cgi</a></li> |
| <li><a href="//httpd.apache.org/docs/mod/mod_cgid.html">mod_cgid</a></li> |
| </ul><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div> |
| <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> |
| <div class="section"> |
| <h2><a name="upgrade" id="upgrade">Upgrade Notes</a></h2> |
| |
| <p>The following changes have been made in the ASF release of mod_fcgid |
| and should be considered when upgrading from the original version by |
| Ryan Pan (Pan Qingfeng).</p> |
| <ul> |
| <li>All directives have been renamed in order to use a common prefix "Fcgid". |
| Underscores in directive names have been eliminated in favor of |
| CamelCase. The old directive names will still work but are deprecated. |
| To fix your configuration you can use the sed script build/fixconf.sed. |
| The following table contains old and new directive names: |
| <table class="bordered"><tr class="header"><th>Old Name</th><th>New Name</th></tr> |
| <tr> |
| <td><code class="directive">BusyScanInterval</code></td> |
| <td><code class="directive"><a href="#fcgidbusyscaninterval">FcgidBusyScanInterval</a></code></td> |
| </tr> |
| <tr class="odd"> |
| <td><code class="directive">BusyTimeout</code></td> |
| <td><code class="directive"><a href="#fcgidbusytimeout">FcgidBusyTimeout</a></code></td> |
| </tr> |
| <tr> |
| <td><code class="directive">DefaultInitEnv</code></td> |
| <td><code class="directive"><a href="#fcgidinitialenv">FcgidInitialEnv</a></code></td> |
| </tr> |
| <tr class="odd"> |
| <td><code class="directive">DefaultMaxClassProcessCount</code></td> |
| <td><code class="directive"><a href="#fcgidmaxprocessesperclass">FcgidMaxProcessesPerClass</a></code></td> |
| </tr> |
| <tr> |
| <td><code class="directive">DefaultMinClassProcessCount</code></td> |
| <td><code class="directive"><a href="#fcgidminprocessesperclass">FcgidMinProcessesPerClass</a></code></td> |
| </tr> |
| <tr class="odd"> |
| <td><code class="directive">ErrorScanInterval</code></td> |
| <td><code class="directive"><a href="#fcgiderrorscaninterval">FcgidErrorScanInterval</a></code></td> |
| </tr> |
| <tr> |
| <td><code class="directive">FastCgiAccessChecker</code></td> |
| <td><code class="directive"><a href="#fcgidaccesschecker">FcgidAccessChecker</a></code></td> |
| </tr> |
| <tr class="odd"> |
| <td><code class="directive">FastCgiAccessCheckerAuthoritative</code></td> |
| <td><code class="directive"><a href="#fcgidaccesscheckerauthoritative">FcgidAccessCheckerAuthoritative</a></code></td> |
| </tr> |
| <tr> |
| <td><code class="directive">FastCgiAuthenticator</code></td> |
| <td><code class="directive"><a href="#fcgidauthenticator">FcgidAuthenticator</a></code></td> |
| </tr> |
| <tr class="odd"> |
| <td><code class="directive">FastCgiAuthenticatorAuthoritative</code></td> |
| <td><code class="directive"><a href="#fcgidauthenticatorauthoritative">FcgidAuthenticatorAuthoritative</a></code></td> |
| </tr> |
| <tr> |
| <td><code class="directive">FastCgiAuthorizer</code></td> |
| <td><code class="directive"><a href="#fcgidauthorizer">FcgidAuthorizer</a></code></td> |
| </tr> |
| <tr class="odd"> |
| <td><code class="directive">FastCgiAuthorizerAuthoritative</code></td> |
| <td><code class="directive"><a href="#fcgidauthorizerauthoritative">FcgidAuthorizerAuthoritative</a></code></td> |
| </tr> |
| <tr> |
| <td><code class="directive">FCGIWrapper</code></td> |
| <td><code class="directive"><a href="#fcgidwrapper">FcgidWrapper</a></code></td> |
| </tr> |
| <tr class="odd"> |
| <td><code class="directive">IdleScanInterval</code></td> |
| <td><code class="directive"><a href="#fcgididlescaninterval">FcgidIdleScanInterval</a></code></td> |
| </tr> |
| <tr> |
| <td><code class="directive">IdleTimeout</code></td> |
| <td><code class="directive"><a href="#fcgididletimeout">FcgidIdleTimeout</a></code></td> |
| </tr> |
| <tr class="odd"> |
| <td><code class="directive">IPCCommTimeout</code></td> |
| <td><code class="directive"><a href="#fcgidiotimeout">FcgidIOTimeout</a></code></td> |
| </tr> |
| <tr> |
| <td><code class="directive">IPCConnectTimeout</code></td> |
| <td><code class="directive"><a href="#fcgidconnecttimeout">FcgidConnectTimeout</a></code></td> |
| </tr> |
| <tr class="odd"> |
| <td><code class="directive">MaxProcessCount</code></td> |
| <td><code class="directive"><a href="#fcgidmaxprocesses">FcgidMaxProcesses</a></code></td> |
| </tr> |
| <tr> |
| <td><code class="directive">MaxRequestInMem</code></td> |
| <td><code class="directive"><a href="#fcgidmaxrequestinmem">FcgidMaxRequestInMem</a></code></td> |
| </tr> |
| <tr class="odd"> |
| <td><code class="directive">MaxRequestLen</code></td> |
| <td><code class="directive"><a href="#fcgidmaxrequestlen">FcgidMaxRequestLen</a></code></td> |
| </tr> |
| <tr> |
| <td><code class="directive">MaxRequestsPerProcess</code></td> |
| <td><code class="directive"><a href="#fcgidmaxrequestsperprocess">FcgidMaxRequestsPerProcess</a></code></td> |
| </tr> |
| <tr class="odd"> |
| <td><code class="directive">OutputBufferSize</code></td> |
| <td><code class="directive"><a href="#fcgidoutputbuffersize">FcgidOutputBufferSize</a></code></td> |
| </tr> |
| <tr> |
| <td><code class="directive">PassHeader</code></td> |
| <td><code class="directive"><a href="#fcgidpassheader">FcgidPassHeader</a></code></td> |
| </tr> |
| <tr class="odd"> |
| <td><code class="directive">PHP_Fix_Pathinfo_Enable</code></td> |
| <td><code class="directive"><a href="#fcgidfixpathinfo">FcgidFixPathinfo</a></code></td> |
| </tr> |
| <tr> |
| <td><code class="directive">ProcessLifeTime</code></td> |
| <td><code class="directive"><a href="#fcgidprocesslifetime">FcgidProcessLifeTime</a></code></td> |
| </tr> |
| <tr class="odd"> |
| <td><code class="directive">SharememPath</code></td> |
| <td><code class="directive"><a href="#fcgidprocesstablefile">FcgidProcessTableFile</a></code></td> |
| </tr> |
| <tr> |
| <td><code class="directive">SocketPath</code></td> |
| <td><code class="directive"><a href="#fcgidipcdir">FcgidIPCDir</a></code></td> |
| </tr> |
| <tr class="odd"> |
| <td><code class="directive">SpawnScore</code></td> |
| <td><code class="directive"><a href="#fcgidspawnscore">FcgidSpawnScore</a></code></td> |
| </tr> |
| <tr> |
| <td><code class="directive">SpawnScoreUpLimit</code></td> |
| <td><code class="directive"><a href="#fcgidspawnscoreuplimit">FcgidSpawnScoreUpLimit</a></code></td> |
| </tr> |
| <tr class="odd"> |
| <td><code class="directive">TerminationScore</code></td> |
| <td><code class="directive"><a href="#fcgidterminationscore">FcgidTerminationScore</a></code></td> |
| </tr> |
| <tr> |
| <td><code class="directive">TimeScore</code></td> |
| <td><code class="directive"><a href="#fcgidtimescore">FcgidTimeScore</a></code></td> |
| </tr> |
| <tr class="odd"> |
| <td><code class="directive">ZombieScanInterval</code></td> |
| <td><code class="directive"><a href="#fcgidzombiescaninterval">FcgidZombieScanInterval</a></code></td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| |
| </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> |
| <div class="section"> |
| <h2><a name="errordocuments" id="errordocuments">Fcgid and Apache ErrorDocument</a></h2> |
| |
| <p>The core directive <a href="//httpd.apache.org/docs/current/mod/core.html#errordocument">ErrorDocument</a> |
| allows the user to specify custom error pages for specific HTTP error codes. |
| An important note must be made: if the error page is generated by the fastcgi script, <code>mod_fcgid</code> will |
| pass the response down to the output filter chain bypassing the Apache's |
| ErrorDocuments. Conversely, if the error is generated by Apache itself (for example, a HTTP 404 |
| due to a missing resource) then the ErrorDocument set will be used. |
| This behaviour is the most conservative one to interfere as little as |
| possible with the fastcgi's response generation logic. <code>mod_proxy</code> shows the same |
| behaviour but it offers |
| <a href="//httpd.apache.org/docs/current/mod/mod_proxy.html#proxyerroroverride">ProxyErrorOverride</a> |
| to force the use of ErrorDocuments, meanwhile <code>mod_fcgid</code> does not. |
| A common workaround is to instruct the fcgi script to generate the ErrorDocuments |
| to have full control of the response content.</p> |
| </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> |
| <div class="section"> |
| <h2><a name="examples" id="examples">Examples</a></h2> |
| |
| |
| <div class="note"><h3>Note</h3> |
| <p>The examples assume that mod_fcgid and other necessary |
| modules are loaded into the server already, either built-in or |
| via the <a href="//httpd.apache.org/docs/current/mod/mod_so.html#loadmodule">LoadModule</a> |
| directive.</p> |
| |
| <p>Additionally, the example configurations provide full access |
| to the applications using access control directives which work |
| with Apache 2.0 and 2.2. These directives are not appropriate |
| for all environments, and they do not work for development |
| levels of Apache HTTP Server (Subversion trunk).</p> |
| </div> |
| |
| <p>The first example is a very simple Perl FastCGI application, |
| and its configuration directives. This is typical for FastCGI |
| applications which require no special configuration.</p> |
| |
| <div class="example"><h3>Perl FastCGI application - /usr/local/apache/fcgi-bin/foo.pl</h3><p><code> |
| #!/usr/bin/perl<br /> |
| use CGI::Fast;<br /> |
| <br /> |
| while (my $q = CGI::Fast->new) {<br /> |
| <span class="indent"> |
| print("Content-Type: text/plain\n\n");<br /> |
| foreach $var (sort(keys(%ENV))) {<br /> |
| <span class="indent"> |
| $val = $ENV{$var};<br /> |
| $val =~ s|\n|\\n|g;<br /> |
| $val =~ s|"|\\"|g;<br /> |
| print "${var}=\"${val}\"\n";<br /> |
| </span> |
| }<br /> |
| </span> |
| }<br /> |
| </code></p></div> |
| |
| <div class="example"><h3>Configuration directives</h3><p><code> |
| <Directory /usr/local/apache/fcgi-bin/><br /> |
| <span class="indent"> |
| SetHandler fcgid-script<br /> |
| Options +ExecCGI<br /> |
| <br /> |
| # Customize the next two directives for your requirements.<br /> |
| Order allow,deny<br /> |
| Allow from all<br /> |
| </span> |
| </Directory><br /> |
| </code></p></div> |
| |
| <p>PHP applications are usually configured using the |
| <code class="directive"><a href="#fcgidwrapper">FcgidWrapper</a></code> directive |
| and a corresponding wrapper script. The wrapper script can be |
| an appropriate place to define any environment variables required |
| by the application, such as <code>PHP_FCGI_MAX_REQUESTS</code> |
| or anything else. (Environment variables can also be set with |
| <code class="directive"><a href="#fcgidinitialenv">FcgidInitialEnv</a></code>, |
| but they then apply to all applications.)</p> |
| |
| <p>Here is an example that uses a wrapper script to invoke PHP:</p> |
| |
| <div class="example"><h3>PHP application - /usr/local/phpapp/phpinfo.php</h3><p><code> |
| <?php<br /> |
| <span class="indent"> |
| phpinfo();<br /> |
| </span> |
| ?><br /> |
| </code></p></div> |
| |
| <div class="example"><h3>Configuration directives</h3><p><code> |
| # FcgidMaxRequestsPerProcess should be <= PHP_FCGI_MAX_REQUESTS<br /> |
| # The example PHP wrapper script overrides the default PHP setting.<br /> |
| FcgidMaxRequestsPerProcess 10000<br /> |
| <br /> |
| # Uncomment the following line if cgi.fix_pathinfo is set to 1 in<br /> |
| # php.ini:<br /> |
| # FcgidFixPathinfo 1<br /> |
| <br /> |
| Alias /phpapp/ /usr/local/phpapp/<br /> |
| <Location /phpapp/><br /> |
| <span class="indent"> |
| AddHandler fcgid-script .php<br /> |
| Options +ExecCGI<br /> |
| FcgidWrapper /usr/local/bin/php-wrapper .php<br /> |
| <br /> |
| # Customize the next two directives for your requirements.<br /> |
| Order allow,deny<br /> |
| Allow from all<br /> |
| </span> |
| </Location><br /> |
| </code></p></div> |
| |
| <div class="example"><h3>PHP wrapper script - /usr/local/bin/php-wrapper</h3><p><code> |
| #!/bin/sh<br /> |
| # Set desired PHP_FCGI_* environment variables.<br /> |
| # Example:<br /> |
| # PHP FastCGI processes exit after 500 requests by default.<br /> |
| PHP_FCGI_MAX_REQUESTS=10000<br /> |
| export PHP_FCGI_MAX_REQUESTS<br /> |
| <br /> |
| # Replace with the path to your FastCGI-enabled PHP executable<br /> |
| exec /usr/local/bin/php-cgi<br /> |
| </code></p></div> |
| |
| <div class="note"><h3>Special PHP considerations</h3> |
| <p>By default, PHP FastCGI processes exit after handling 500 |
| requests, and they may exit after this module has already |
| connected to the application and sent the next request. When that |
| occurs, an error will be logged and <code>500 Internal Server |
| Error</code> will be returned to the client. This PHP behavior |
| can be disabled by setting <code>PHP_FCGI_MAX_REQUESTS</code> to |
| 0, but that can be a problem if the PHP application leaks |
| resources. Alternatively, <code>PHP_FCGI_MAX_REQUESTS</code> can |
| be set to a much higher value than the default to reduce the |
| frequency of this problem. |
| <code class="directive"><a href="#fcgidmaxrequestsperprocess">FcgidMaxRequestsPerProcess</a></code> |
| can be set to a value less than or equal to |
| <code>PHP_FCGI_MAX_REQUESTS</code> to resolve the problem.</p> |
| |
| <p>PHP child process management (<code>PHP_FCGI_CHILDREN</code>) |
| should always be disabled with mod_fcgid, which will only route |
| one request at a time to application processes it has spawned; |
| thus, any child processes created by PHP will not be used |
| effectively. (Additionally, the PHP child processes may not be |
| terminated properly.) By default, and with the environment |
| variable setting <code>PHP_FCGI_CHILDREN=0</code>, PHP child |
| process management is disabled.</p> |
| |
| <p>The popular APC opcode cache for PHP cannot share a cache |
| between PHP FastCGI processes unless PHP manages the child |
| processes. Thus, the effectiveness of the cache is limited with |
| mod_fcgid; concurrent PHP requests will use different opcode |
| caches.</p> |
| </div> |
| |
| </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> |
| <div class="section"> |
| <h2><a name="process-mgmt" id="process-mgmt">Process Management</a></h2> |
| |
| |
| <p>mod_fcgid has several types of controls which affect the creation |
| of additional application processes:</p> |
| |
| <table class="bordered"><tr class="header"><th>Type of control</th><th>Directive</th></tr> |
| <tr> |
| <td>global limit on number of processes</td> |
| <td><code class="directive"><a href="#fcgidmaxprocesses">FcgidMaxProcesses</a></code></td> |
| </tr> |
| <tr class="odd"> |
| <td>limit on number of processes per application</td> |
| <td><code class="directive"><a href="#fcgidmaxprocessesperclass">FcgidMaxProcessesPerClass</a></code></td> |
| </tr> |
| <tr> |
| <td>limit on rate of spawning new application processes</td> |
| <td><code class="directive"><a href="#fcgidspawnscoreuplimit">FcgidSpawnScoreUpLimit</a></code> and |
| other score-related directives</td> |
| </tr> |
| </table> |
| |
| <p>mod_fcgid has several types of controls which affect the termination |
| of existing application processes:</p> |
| |
| <table class="bordered"><tr class="header"><th>Type of control</th><th>Directive</th></tr> |
| <tr> |
| <td>termination after an idle period</td> |
| <td><code class="directive"><a href="#fcgididletimeout">FcgidIdleTimeout</a></code></td> |
| </tr> |
| <tr class="odd"> |
| <td>termination after it handles a certain number of requests</td> |
| <td><code class="directive"><a href="#fcgidmaxrequestsperprocess">FcgidMaxRequestsPerProcess</a></code></td> |
| </tr> |
| <tr> |
| <td>termination after a certain lifetime</td> |
| <td><code class="directive"><a href="#fcgidprocesslifetime">FcgidProcessLifetime</a></code></td> |
| </tr> |
| </table> |
| |
| <p>Several of the directives control processing for a <em>process |
| class</em>. A process class is the set of processes which were started |
| with the same executable file and share certain other characteristics such |
| as virtual host and identity. Two commands which are links to or otherwise |
| refer to the same executable file share the same process class.</p> |
| |
| <div class="note"><h3>Note</h3> |
| <p>Certain settings or other concepts that depend on the virtual host, |
| such as <code class="directive"><a href="#fcgidinitialenv">FcgidInitialEnv</a></code> |
| or process classes, distinguish between virtual hosts only if they |
| have distinct server names. (See the <code class="directive">ServerName</code> |
| documentation for more information.) In the case of |
| <code class="directive"><a href="#fcgidinitialenv">FcgidInitialEnv</a></code>, if two |
| virtual hosts have the same server name but different environments as |
| defined by |
| <code class="directive"><a href="#fcgidinitialenv">FcgidInitialEnv</a></code>, the |
| environment used for a particular request will be that defined for the |
| virtual host of the request that caused the FastCGI process to be |
| started.</p> |
| </div> |
| |
| <p>Information about each process will be displayed in the |
| <code class="module"><a href="../mod/mod_status.html">mod_status</a></code> server-status page.</p> |
| </div> |
| <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> |
| <div class="directive-section"><h2><a name="FcgidAccessChecker" id="FcgidAccessChecker">FcgidAccessChecker</a> <a name="fcgidaccesschecker" id="fcgidaccesschecker">Directive</a></h2> |
| <table class="directive"> |
| <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>full path to FastCGI access checker</td></tr> |
| <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FcgidAccessChecker <em>command</em></code></td></tr> |
| <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>none</code></td></tr> |
| <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr> |
| <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr> |
| <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>External</td></tr> |
| <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_fcgid</td></tr> |
| </table> |
| <p>Access checking or, more formally, access control, is a procedure |
| which verifies that the client is allowed to access a resource, using |
| some mechanism other than authentication and authorization.</p> |
| |
| <p>Key environment variables passed to the application for access |
| checking are:</p> |
| |
| <dl> |
| <dt><code>FCGI_APACHE_ROLE</code></dt> |
| <dd>set to <code>ACCESS_CHECKER</code>; by checking the current role, |
| the same FastCGI application can handle multiple stages of request |
| processing</dd> |
| </dl> |
| |
| <p>The application must output a <code>Status</code> line to indicate |
| the result of the check.</p> |
| |
| <div class="warning"><h3>Warning</h3> |
| <p>Before 2.3.6, only one FastCGI application of any type (AAA or handler) |
| can be used for a particular request URI. Otherwise, the wrong FastCGI |
| application may be invoked for one or more phases of request processing.</p> |
| </div> |
| |
| </div> |
| <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> |
| <div class="directive-section"><h2><a name="FcgidAccessCheckerAuthoritative" id="FcgidAccessCheckerAuthoritative">FcgidAccessCheckerAuthoritative</a> <a name="fcgidaccesscheckerauthoritative" id="fcgidaccesscheckerauthoritative">Directive</a></h2> |
| <table class="directive"> |
| <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Set to 'off' to allow access control to be passed along to lower modules upon failure</td></tr> |
| <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FcgidAccessCheckerAuthoritative <em>On|Off</em></code></td></tr> |
| <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>FcgidAccessCheckerAuthoritative On</code></td></tr> |
| <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr> |
| <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr> |
| <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>External</td></tr> |
| <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_fcgid</td></tr> |
| </table> |
| <p>This directive controls whether or not other access checkers |
| are allowed to run when this module has an access checker configured |
| and it fails a request. If this directive is <code>On</code> (default) |
| and a FastCGI access checker returns a failure status, a failure is |
| returned to the client without giving other access checkers a chance to |
| allow access. If this directive is <code>Off</code>, other access |
| checkers will be called.</p> |
| |
| </div> |
| <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> |
| <div class="directive-section"><h2><a name="FcgidAuthenticator" id="FcgidAuthenticator">FcgidAuthenticator</a> <a name="fcgidauthenticator" id="fcgidauthenticator">Directive</a></h2> |
| <table class="directive"> |
| <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>full path to FastCGI authenticator</td></tr> |
| <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FcgidAuthenticator <em>command</em></code></td></tr> |
| <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>none</code></td></tr> |
| <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr> |
| <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr> |
| <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>External</td></tr> |
| <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_fcgid</td></tr> |
| </table> |
| <p>Authentication is the procedure which verifies that the user is |
| who they claim they are. This directive specifies the full path to |
| a FastCGI application which will handle authentication for a particular |
| context, such as a directory.</p> |
| |
| <p>Key environment variables passed to the application on authentication |
| are:</p> |
| |
| <dl> |
| <dt><code>REMOTE_USER</code></dt> |
| <dd>set to the user id of the client</dd> |
| |
| <dt><code>REMOTE_PASSWD</code></dt> |
| <dd>set to the plain text password provided by the client</dd> |
| |
| <dt><code>FCGI_APACHE_ROLE</code></dt> |
| <dd>set to <code>AUTHENTICATOR</code>; by checking the current role, |
| the same FastCGI application can handle multiple stages of request |
| processing</dd> |
| </dl> |
| |
| <p>The application must output a <code>Status</code> line to indicate |
| the result of authentication.</p> |
| |
| <div class="warning"><h3>Warning</h3> |
| <p>Before 2.3.6, only one FastCGI application of any type (AAA or handler) |
| can be used for a particular request URI. Otherwise, the wrong FastCGI |
| application may be invoked for one or more phases of request processing.</p> |
| </div> |
| |
| </div> |
| <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> |
| <div class="directive-section"><h2><a name="FcgidAuthenticatorAuthoritative" id="FcgidAuthenticatorAuthoritative">FcgidAuthenticatorAuthoritative</a> <a name="fcgidauthenticatorauthoritative" id="fcgidauthenticatorauthoritative">Directive</a></h2> |
| <table class="directive"> |
| <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Set to 'off' to allow authentication to be passed along to lower modules upon failure</td></tr> |
| <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FcgidAuthenticatorAuthoritative <em>On|Off</em></code></td></tr> |
| <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>FcgidAuthenticatorAuthoritative On</code></td></tr> |
| <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr> |
| <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr> |
| <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>External</td></tr> |
| <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_fcgid</td></tr> |
| </table> |
| <p>This directive controls whether or not other authenticators |
| are allowed to run when this module has an authenticator configured |
| and it fails a request. If this directive is <code>On</code> (default) |
| and a FastCGI authenticator returns a failure status, a failure is |
| returned to the client without giving other authenticators a chance to |
| validate the client identity. If this directive is <code>Off</code>, |
| other authenticators will be called.</p> |
| |
| </div> |
| <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> |
| <div class="directive-section"><h2><a name="FcgidAuthorizer" id="FcgidAuthorizer">FcgidAuthorizer</a> <a name="fcgidauthorizer" id="fcgidauthorizer">Directive</a></h2> |
| <table class="directive"> |
| <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>full path to FastCGI authorizer</td></tr> |
| <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FcgidAuthorizer <em>command</em></code></td></tr> |
| <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>none</code></td></tr> |
| <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr> |
| <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr> |
| <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>External</td></tr> |
| <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_fcgid</td></tr> |
| </table> |
| <p>Authorization is the procedure which verifies that the user is |
| allowed to access a particular resource. This directive specifies |
| the full path to a FastCGI application which will handle authorization |
| for a particular context, such as a directory.</p> |
| |
| <p>Key environment variables passed to the application on authorization |
| are:</p> |
| |
| <dl> |
| <dt><code>REMOTE_USER</code></dt> |
| <dd>set to the user id of the client, which has already been |
| authenticated</dd> |
| |
| <dt><code>FCGI_APACHE_ROLE</code></dt> |
| <dd>set to <code>AUTHORIZER</code>; by checking the current role, the |
| same FastCGI application can handle multiple stages of request |
| processing</dd> |
| </dl> |
| |
| <p>The application must output a <code>Status</code> line to indicate |
| the result of authorization.</p> |
| |
| <div class="warning"><h3>Warning</h3> |
| <p>Before 2.3.6, only one FastCGI application of any type (AAA or handler) |
| can be used for a particular request URI. Otherwise, the wrong FastCGI |
| application may be invoked for one or more phases of request processing.</p> |
| </div> |
| |
| </div> |
| <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> |
| <div class="directive-section"><h2><a name="FcgidAuthorizerAuthoritative" id="FcgidAuthorizerAuthoritative">FcgidAuthorizerAuthoritative</a> <a name="fcgidauthorizerauthoritative" id="fcgidauthorizerauthoritative">Directive</a></h2> |
| <table class="directive"> |
| <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Set to 'off' to allow authorization to be passed along to lower modules upon failure</td></tr> |
| <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FcgidAuthorizerAuthoritative <em>On|Off</em></code></td></tr> |
| <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>FcgidAuthorizerAuthoritative On</code></td></tr> |
| <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr> |
| <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr> |
| <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>External</td></tr> |
| <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_fcgid</td></tr> |
| </table> |
| <p>This directive controls whether or not other authorizers |
| are allowed to run when this module has an authorizer configured |
| and it fails a request. If this directive is <code>On</code> (default) |
| and a FastCGI authorizer returns a failure status, a failure is |
| returned to the client without giving other authorizer a chance to |
| access the resource. If this directive is <code>Off</code>, other |
| authorizers will be called.</p> |
| |
| </div> |
| <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> |
| <div class="directive-section"><h2><a name="FcgidBusyScanInterval" id="FcgidBusyScanInterval">FcgidBusyScanInterval</a> <a name="fcgidbusyscaninterval" id="fcgidbusyscaninterval">Directive</a></h2> |
| <table class="directive"> |
| <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>scan interval for busy timeout process</td></tr> |
| <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FcgidBusyScanInterval <em>seconds</em></code></td></tr> |
| <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>FcgidBusyScanInterval 120</code></td></tr> |
| <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr> |
| <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>External</td></tr> |
| <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_fcgid</td></tr> |
| </table> |
| <p>The module performs the |
| <code class="directive"><a href="#fcgidbusytimeout">FcgidBusyTimeout</a></code> check at this |
| interval.</p> |
| |
| </div> |
| <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> |
| <div class="directive-section"><h2><a name="FcgidBusyTimeout" id="FcgidBusyTimeout">FcgidBusyTimeout</a> <a name="fcgidbusytimeout" id="fcgidbusytimeout">Directive</a></h2> |
| <table class="directive"> |
| <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>a FastCGI application will be killed after handling a request for FcgidBusyTimeout</td></tr> |
| <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FcgidBusyTimeout <em>seconds</em></code></td></tr> |
| <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>FcgidBusyTimeout 300</code></td></tr> |
| <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr> |
| <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>External</td></tr> |
| <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_fcgid</td></tr> |
| </table> |
| <p>This is the maximum time limit for request handling. If a FastCGI |
| request does not complete within FcgidBusyTimeout seconds, it will be |
| subject to termination. Because the check is performed at the |
| interval defined by <code class="directive"><a href="#fcgidbusyscaninterval">FcgidBusyScanInterval</a></code>, |
| request handling may be allowed to proceed for a longer period of time.</p> |
| |
| <p>The purpose of this directive is to terminate hung applications. |
| The default timeout may need to be increased for applications that |
| can take longer to process the request.</p> |
| |
| </div> |
| <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> |
| <div class="directive-section"><h2><a name="FcgidCmdOptions" id="FcgidCmdOptions">FcgidCmdOptions</a> <a name="fcgidcmdoptions" id="fcgidcmdoptions">Directive</a></h2> |
| <table class="directive"> |
| <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Set processing options for a FastCGI |
| command</td></tr> |
| <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FcgidCmdOptions <em>command</em> <em>option</em> |
| [<em>option</em>] ...</code></td></tr> |
| <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr> |
| <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>External</td></tr> |
| <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_fcgid</td></tr> |
| </table> |
| <p>This directive allows processing options to be specified for |
| a specific command spawned by mod_fcgid. Each option for the |
| command corresponds to another directive that normally applies to |
| all commands started within a particular context. If a |
| particular option is not specified on this directive, the |
| default will be used.</p> |
| |
| <p>The following table provides a list of options and |
| corresponding directives:</p> |
| |
| <table class="bordered"><tr class="header"><th>Option name and syntax</th><th>Corresponding directive</th></tr> |
| <tr> |
| <td><code>ConnectTimeout <em>seconds</em></code></td> |
| <td><code class="directive"><a href="#fcgidconnecttimeout">FcgidConnectTimeout</a></code></td> |
| </tr> |
| <tr class="odd"> |
| <td><code>IdleTimeout <em>seconds</em></code></td> |
| <td><code class="directive"><a href="#fcgididletimeout">FcgidIdleTimeout</a></code></td> |
| </tr> |
| <tr> |
| <td><code>InitialEnv <em>name[=value]</em></code></td> |
| <td><code class="directive"><a href="#fcgidinitialenv">FcgidInitialEnv</a></code></td> |
| </tr> |
| <tr class="odd"> |
| <td><code>IOTimeout <em>seconds</em></code></td> |
| <td><code class="directive"><a href="#fcgidiotimeout">FcgidIOTimeout</a></code></td> |
| </tr> |
| <tr> |
| <td><code>MaxProcesses <em>value</em></code></td> |
| <td><code class="directive"><a href="#fcgidmaxprocessesperclass">FcgidMaxProcessesPerClass</a></code></td> |
| </tr> |
| <tr class="odd"> |
| <td><code>MaxProcessLifeTime <em>seconds</em></code></td> |
| <td><code class="directive"><a href="#fcgidprocesslifetime">FcgidProcessLifeTime</a></code></td> |
| </tr> |
| <tr> |
| <td><code>MaxRequestsPerProcess <em>value</em></code></td> |
| <td><code class="directive"><a href="#fcgidmaxrequestsperprocess">FcgidMaxRequestsPerProcess</a></code></td> |
| </tr> |
| <tr class="odd"> |
| <td><code>MinProcesses <em>value</em></code></td> |
| <td><code class="directive"><a href="#fcgidminprocessesperclass">FcgidMinProcessesPerClass</a></code></td> |
| </tr> |
| </table> |
| |
| <p>Multiple environment variables are defined by repeating |
| the <code>InitialEnv</code> option.</p> |
| |
| <div class="example"><h3>Example</h3><p><code> |
| FcgidCmdOptions /usr/local/bin/wrapper \<br /> |
| <span class="indent"> |
| InitialEnv MAX_REQUESTS=2000 \<br /> |
| MaxRequestsPerProcess 2000 \<br /> |
| IOTimeout 90<br /> |
| </span> |
| </code></p></div> |
| |
| <p>When <code>/usr/local/bin/wrapper</code> is spawned, its initial |
| environment contains the <code>MAX_REQUESTS=2000</code> |
| environment variable setting; additionally, mod_fcgid will |
| terminate it after it has handled 2000 requests, and I/O |
| operations will time out after 90 seconds. Directives |
| corresponding to other options, such as |
| <code class="directive"><a href="#fcgididletimeout">FcgidIdleTimeout</a></code> or |
| <code class="directive"><a href="#fcgidprocesslifetime">FcgidProcessLifeTime</a></code>, |
| will be ignored for this command; defaults will be used for options |
| not specified on <code class="directive">FcgidCmdOptions</code>.</p> |
| |
| </div> |
| <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> |
| <div class="directive-section"><h2><a name="FcgidConnectTimeout" id="FcgidConnectTimeout">FcgidConnectTimeout</a> <a name="fcgidconnecttimeout" id="fcgidconnecttimeout">Directive</a></h2> |
| <table class="directive"> |
| <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Connect timeout to FastCGI server</td></tr> |
| <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FcgidConnectTimeout <em>seconds</em></code></td></tr> |
| <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>FcgidConnectTimeout 3</code></td></tr> |
| <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr> |
| <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>External</td></tr> |
| <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_fcgid</td></tr> |
| </table> |
| <p>This is the maximum period of time the module will wait |
| while trying to connect to a FastCGI application on Windows. |
| (This directive is not respected on Unix, where AF_UNIX defaults |
| will apply.)</p> |
| |
| <p>This setting will apply to all applications spawned for this |
| server or virtual host. Use |
| <code class="directive"><a href="#fcgidcmdoptions">FcgidCmdOptions</a></code> to apply |
| this setting to a single application.</p> |
| |
| </div> |
| <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> |
| <div class="directive-section"><h2><a name="FcgidErrorScanInterval" id="FcgidErrorScanInterval">FcgidErrorScanInterval</a> <a name="fcgiderrorscaninterval" id="fcgiderrorscaninterval">Directive</a></h2> |
| <table class="directive"> |
| <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>scan interval for exited process</td></tr> |
| <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FcgidErrorScanInterval <em>seconds</em></code></td></tr> |
| <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>FcgidErrorScanInterval 3</code></td></tr> |
| <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr> |
| <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>External</td></tr> |
| <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_fcgid</td></tr> |
| </table> |
| <p>This is the interval at which the module will handle |
| pending process termination. Termination is pending for |
| any processes which have exceeded |
| <code class="directive"><a href="#fcgididletimeout">FcgidIdleTimeout</a></code> or |
| <code class="directive"><a href="#fcgidprocesslifetime">FcgidProcessLifeTime</a></code>.</p> |
| |
| <p>Unix: mod_fcgid will terminate such processes with SIGTERM; |
| if the process is still active during the next scan, the process |
| will be terminated with SIGKILL. Thus, this directive controls the |
| amount of time for orderly process terminate before being forcibly |
| killed.</p> |
| |
| </div> |
| <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> |
| <div class="directive-section"><h2><a name="FcgidFixPathinfo" id="FcgidFixPathinfo">FcgidFixPathinfo</a> <a name="fcgidfixpathinfo" id="fcgidfixpathinfo">Directive</a></h2> |
| <table class="directive"> |
| <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Mirror the PHP <code>cgi.fix_pathinfo</code> |
| setting</td></tr> |
| <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FcgidFixPathinfo 1</code></td></tr> |
| <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>FcgidFixPathinfo 0</code></td></tr> |
| <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr> |
| <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>External</td></tr> |
| <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_fcgid</td></tr> |
| </table> |
| <p>This directive enables special <code>SCRIPT_NAME</code> |
| processing which allows PHP to provide additional path information. |
| The setting of <code class="directive">FcgidFixPathinfo</code> |
| should mirror the <code>cgi.fix_pathinfo</code> setting in |
| <code>php.ini</code>.</p> |
| |
| </div> |
| <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> |
| <div class="directive-section"><h2><a name="FcgidIdleScanInterval" id="FcgidIdleScanInterval">FcgidIdleScanInterval</a> <a name="fcgididlescaninterval" id="fcgididlescaninterval">Directive</a></h2> |
| <table class="directive"> |
| <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>scan interval for idle timeout process</td></tr> |
| <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FcgidIdleScanInterval <em>seconds</em></code></td></tr> |
| <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>FcgidIdleScanInterval 120</code></td></tr> |
| <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr> |
| <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>External</td></tr> |
| <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_fcgid</td></tr> |
| </table> |
| <p>This is the interval at which the module will search for |
| processes which have exceeded |
| <code class="directive"><a href="#fcgididletimeout">FcgidIdleTimeout</a></code> or |
| <code class="directive"><a href="#fcgidprocesslifetime">FcgidProcessLifeTime</a></code>.</p> |
| |
| </div> |
| <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> |
| <div class="directive-section"><h2><a name="FcgidIdleTimeout" id="FcgidIdleTimeout">FcgidIdleTimeout</a> <a name="fcgididletimeout" id="fcgididletimeout">Directive</a></h2> |
| <table class="directive"> |
| <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>An idle FastCGI application will be killed after FcgidIdleTimeout</td></tr> |
| <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FcgidIdleTimeout <em>seconds</em></code></td></tr> |
| <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>FcgidIdleTimeout 300</code></td></tr> |
| <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr> |
| <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>External</td></tr> |
| <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_fcgid</td></tr> |
| </table> |
| <p>Application processes which have not handled a request for this |
| period of time will be terminated, if the number of processses for the |
| class exceeds |
| <code class="directive"><a href="#fcgidminprocessesperclass">FcgidMinProcessesPerClass</a></code>. |
| A value of <code>0</code> disables the check.</p> |
| |
| <p>This idle timeout check is performed at the frequency of the configured |
| <code class="directive"><a href="#fcgididlescaninterval">FcgidIdleScanInterval</a></code>.</p> |
| |
| <p>This setting will apply to all applications spawned for this |
| server or virtual host. Use |
| <code class="directive"><a href="#fcgidcmdoptions">FcgidCmdOptions</a></code> to apply |
| this setting to a single application.</p> |
| |
| </div> |
| <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> |
| <div class="directive-section"><h2><a name="FcgidInitialEnv" id="FcgidInitialEnv">FcgidInitialEnv</a> <a name="fcgidinitialenv" id="fcgidinitialenv">Directive</a></h2> |
| <table class="directive"> |
| <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>an environment variable name and optional value to pass to FastCGI.</td></tr> |
| <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FcgidInitialEnv <em>name</em> [ <em>value</em> ]</code></td></tr> |
| <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>none</code></td></tr> |
| <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr> |
| <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>External</td></tr> |
| <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_fcgid</td></tr> |
| </table> |
| <p>Use <code class="directive">FcgidInitialEnv</code> to define environment |
| variables to pass to the FastCGI application. This directive can |
| be used multiple times.</p> |
| |
| <p>This setting will apply to all applications spawned for this |
| server or virtual host. Use |
| <code class="directive"><a href="#fcgidcmdoptions">FcgidCmdOptions</a></code> to apply |
| this setting to a single application.</p> |
| |
| </div> |
| <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> |
| <div class="directive-section"><h2><a name="FcgidIOTimeout" id="FcgidIOTimeout">FcgidIOTimeout</a> <a name="fcgidiotimeout" id="fcgidiotimeout">Directive</a></h2> |
| <table class="directive"> |
| <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Communication timeout to FastCGI server</td></tr> |
| <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FcgidIOTimeout <em>seconds</em></code></td></tr> |
| <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>FcgidIOTimeout 40</code></td></tr> |
| <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr> |
| <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>External</td></tr> |
| <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_fcgid</td></tr> |
| </table> |
| <p>This is the maximum period of time the module will wait |
| while trying to read from or write to a FastCGI application.</p> |
| |
| <div class="note"><h3>Note</h3> |
| <p>The FastCGI application must begin generating the response within |
| this period of time. Increase this directive as necessary to handle |
| applications which take a relatively long period of time to respond.</p> |
| </div> |
| |
| <p>This setting will apply to all applications spawned for this |
| server or virtual host. Use |
| <code class="directive"><a href="#fcgidcmdoptions">FcgidCmdOptions</a></code> to apply |
| this setting to a single application.</p> |
| |
| </div> |
| <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> |
| <div class="directive-section"><h2><a name="FcgidIPCDir" id="FcgidIPCDir">FcgidIPCDir</a> <a name="fcgidipcdir" id="fcgidipcdir">Directive</a></h2> |
| <table class="directive"> |
| <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>directory for AF_UNIX sockets (Unix) or pipes (Windows)</td></tr> |
| <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FcgidIPCDir <em>pathname</em></code></td></tr> |
| <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>FcgidIPCDir logs/fcgidsock</code></td></tr> |
| <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr> |
| <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>External</td></tr> |
| <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_fcgid</td></tr> |
| </table> |
| <p>This module uses AF_UNIX sockets or named pipes, depending on the |
| platform, to communicate with FastCGI applications. This directive |
| specifies the directory where those sockets or named pipes will be |
| created.</p> |
| |
| </div> |
| <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> |
| <div class="directive-section"><h2><a name="FcgidMaxProcesses" id="FcgidMaxProcesses">FcgidMaxProcesses</a> <a name="fcgidmaxprocesses" id="fcgidmaxprocesses">Directive</a></h2> |
| <table class="directive"> |
| <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>maximum number of FastCGI application processes</td></tr> |
| <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FcgidMaxProcesses <em>value</em></code></td></tr> |
| <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>FcgidMaxProcesses 1000</code></td></tr> |
| <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr> |
| <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>External</td></tr> |
| <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_fcgid</td></tr> |
| </table> |
| <p>This directive sets the maximum number of FastCGI application |
| processes which can be active at one time.</p> |
| |
| </div> |
| <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> |
| <div class="directive-section"><h2><a name="FcgidMaxProcessesPerClass" id="FcgidMaxProcessesPerClass">FcgidMaxProcessesPerClass</a> <a name="fcgidmaxprocessesperclass" id="fcgidmaxprocessesperclass">Directive</a></h2> |
| <table class="directive"> |
| <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Max process count of one class of FastCGI application</td></tr> |
| <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FcgidMaxProcessesPerClass <em>value</em></code></td></tr> |
| <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>FcgidMaxProcessesPerClass 100</code></td></tr> |
| <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr> |
| <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>External</td></tr> |
| <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_fcgid</td></tr> |
| </table> |
| <p>This directive sets the maximum number of processes that can be |
| started for each process class.</p> |
| |
| <p>This setting will apply to all applications spawned for this |
| server or virtual host. Use |
| <code class="directive"><a href="#fcgidcmdoptions">FcgidCmdOptions</a></code> to apply |
| this setting to a single application.</p> |
| |
| </div> |
| <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> |
| <div class="directive-section"><h2><a name="FcgidMaxRequestInMem" id="FcgidMaxRequestInMem">FcgidMaxRequestInMem</a> <a name="fcgidmaxrequestinmem" id="fcgidmaxrequestinmem">Directive</a></h2> |
| <table class="directive"> |
| <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>maximum size of a request which will be held in memory</td></tr> |
| <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FcgidMaxRequestInMem <em>bytes</em></code></td></tr> |
| <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>FcgidMaxRequestInMem 65536</code></td></tr> |
| <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr> |
| <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>External</td></tr> |
| <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_fcgid</td></tr> |
| </table> |
| <p>This module reads the entire request body from the client |
| before sending it to the application. Normally the request body |
| will be stored in memory. Once the amount of request body read |
| from the client exceeds <code class="directive">FcgidMaxRequestInMem</code> |
| bytes, the remainder of the request body will be stored in a |
| temporary file.</p> |
| |
| </div> |
| <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> |
| <div class="directive-section"><h2><a name="FcgidMaxRequestLen" id="FcgidMaxRequestLen">FcgidMaxRequestLen</a> <a name="fcgidmaxrequestlen" id="fcgidmaxrequestlen">Directive</a></h2> |
| <table class="directive"> |
| <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>maximum HTTP request length</td></tr> |
| <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FcgidMaxRequestLen <em>bytes</em></code></td></tr> |
| <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>FcgidMaxRequestLen 131072</code></td></tr> |
| <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr> |
| <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>External</td></tr> |
| <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_fcgid</td></tr> |
| </table> |
| <p>If the size of the request body exceeds this amount, the |
| request will fail with <code>500 Server Error</code>.</p> |
| |
| <p>Administrators should change this to an appropriate value for their site based |
| on application requirements.</p> |
| |
| <div class="warning"><h3>Warning</h3> |
| <p>Before 2.3.6, this defaulted to 1GB. Most users of earlier versions should |
| use this directive to set a more reasonable limit.</p> |
| </div> |
| |
| <h3>See also</h3> |
| <ul> |
| <li><code class="directive"><a href="#fcgidmaxrequestinmem">FcgidMaxRequestInMem</a></code></li> |
| </ul> |
| </div> |
| <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> |
| <div class="directive-section"><h2><a name="FcgidMaxRequestsPerProcess" id="FcgidMaxRequestsPerProcess">FcgidMaxRequestsPerProcess</a> <a name="fcgidmaxrequestsperprocess" id="fcgidmaxrequestsperprocess">Directive</a></h2> |
| <table class="directive"> |
| <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Max requests handled by each FastCGI application</td></tr> |
| <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FcgidMaxRequestsPerProcess <em>value</em></code></td></tr> |
| <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>FcgidMaxRequestsPerProcess 0</code></td></tr> |
| <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr> |
| <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>External</td></tr> |
| <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_fcgid</td></tr> |
| </table> |
| <p>FastCGI application processes will be terminated after handling |
| the specified number of requests. A value of <code>0</code> |
| disables the check.</p> |
| <div class="note"><h3>Note</h3> |
| <p>A value of <code>-1</code> is currently accepted for ease of |
| migration for existing configurations. It is treated the same as |
| <code>0</code>.</p> |
| </div> |
| <p>Certain applications, notably PHP as FastCGI, have their own |
| facility for terminating after handling a certain number of |
| requests. This directive can be used to avoid sending |
| additional requests to the application after it has handled its |
| limit.</p> |
| <div class="note"><h3>Note</h3> |
| <p>If this is set such that frequent process creation will be |
| required, you will likely need to adjust |
| <code class="directive"><a href="#fcgidspawnscoreuplimit">FcgidSpawnScoreUpLimit</a></code> |
| or other score-related directives to allow more frequent process |
| creation.</p> |
| </div> |
| |
| <p>This setting will apply to all applications spawned for this |
| server or virtual host. Use |
| <code class="directive"><a href="#fcgidcmdoptions">FcgidCmdOptions</a></code> to apply |
| this setting to a single application.</p> |
| |
| </div> |
| <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> |
| <div class="directive-section"><h2><a name="FcgidMinProcessesPerClass" id="FcgidMinProcessesPerClass">FcgidMinProcessesPerClass</a> <a name="fcgidminprocessesperclass" id="fcgidminprocessesperclass">Directive</a></h2> |
| <table class="directive"> |
| <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Min process count of one class of FastCGI application</td></tr> |
| <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FcgidMinProcessesPerClass <em>value</em></code></td></tr> |
| <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>FcgidMinProcessesPerClass 3</code></td></tr> |
| <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr> |
| <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>External</td></tr> |
| <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_fcgid</td></tr> |
| </table> |
| <p>This directive sets the minimum number of processes that will be |
| retained in a process class after finishing requests.</p> |
| |
| <p>This setting will apply to all applications spawned for this |
| server or virtual host. Use |
| <code class="directive"><a href="#fcgidcmdoptions">FcgidCmdOptions</a></code> to apply |
| this setting to a single application.</p> |
| |
| </div> |
| <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> |
| <div class="directive-section"><h2><a name="FcgidOutputBufferSize" id="FcgidOutputBufferSize">FcgidOutputBufferSize</a> <a name="fcgidoutputbuffersize" id="fcgidoutputbuffersize">Directive</a></h2> |
| <table class="directive"> |
| <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>CGI output buffer size</td></tr> |
| <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FcgidOutputBufferSize <em>bytes</em></code></td></tr> |
| <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>FcgidOutputBufferSize 65536</code></td></tr> |
| <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr> |
| <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>External</td></tr> |
| <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_fcgid</td></tr> |
| </table> |
| <p>This is the maximum amount of response data the module will read |
| from the FastCGI application before flushing the data to the client.</p> |
| |
| </div> |
| <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> |
| <div class="directive-section"><h2><a name="FcgidPassHeader" id="FcgidPassHeader">FcgidPassHeader</a> <a name="fcgidpassheader" id="fcgidpassheader">Directive</a></h2> |
| <table class="directive"> |
| <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Header name which will be passed to FastCGI as environment variable.</td></tr> |
| <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FcgidPassHeader <em>name</em></code></td></tr> |
| <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>none</code></td></tr> |
| <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr> |
| <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>External</td></tr> |
| <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_fcgid</td></tr> |
| </table> |
| <p>This directive specifies the name of a request header which |
| will be passed to the FastCGI application as an environment |
| variable. The name of the environment variable is derived from |
| the value specified on this directive, as discussed below:</p> |
| |
| <p>The legacy behavior is to use the value specified on this directive |
| as the environment variable name, converting hyphens to underscores. |
| No case conversion is performed.</p> |
| |
| <p>Beginning with release 2.3.6, an additional environment variable |
| is created. The value specified on this directive is converted to |
| upper case, prefixed with <code>HTTP_</code>, and hyphens are |
| converted to underscores.</p> |
| |
| <div class="note"><h3>Note</h3> |
| <p>Most request headers are already available to the application |
| as environment variables, and generally are prefixed with |
| <code>HTTP_</code>. (Notable exceptions are <code>Content-type</code> |
| and <code>Content-length</code>, which do not have the |
| <code>HTTP_</code> prefix.) Thus, this directive is only required |
| for request headers that are purposefully omitted, such as |
| <code>Authorization</code> and <code>Proxy-Authorization</code>. |
| Only pass these request headers if absolutely required.</p> |
| </div> |
| |
| </div> |
| <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> |
| <div class="directive-section"><h2><a name="FcgidProcessLifeTime" id="FcgidProcessLifeTime">FcgidProcessLifeTime</a> <a name="fcgidprocesslifetime" id="fcgidprocesslifetime">Directive</a></h2> |
| <table class="directive"> |
| <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>maximum FastCGI application process lifetime</td></tr> |
| <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FcgidProcessLifeTime <em>seconds</em></code></td></tr> |
| <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>FcgidProcessLifeTime 3600</code></td></tr> |
| <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr> |
| <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>External</td></tr> |
| <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_fcgid</td></tr> |
| </table> |
| <p>Idle application processes which have existed for greater |
| than this time will be terminated, if the number of processses for the |
| class exceeds |
| <code class="directive"><a href="#fcgidminprocessesperclass">FcgidMinProcessesPerClass</a></code>. |
| A value of <code>0</code> disables the check.</p> |
| |
| <p>This process lifetime check is performed at the frequency of the configured |
| <code class="directive"><a href="#fcgididlescaninterval">FcgidIdleScanInterval</a></code>.</p> |
| |
| <p>This setting will apply to all applications spawned for this |
| server or virtual host. Use |
| <code class="directive"><a href="#fcgidcmdoptions">FcgidCmdOptions</a></code> to apply |
| this setting to a single application.</p> |
| |
| </div> |
| <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> |
| <div class="directive-section"><h2><a name="FcgidProcessTableFile" id="FcgidProcessTableFile">FcgidProcessTableFile</a> <a name="fcgidprocesstablefile" id="fcgidprocesstablefile">Directive</a></h2> |
| <table class="directive"> |
| <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>shared memory file path</td></tr> |
| <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FcgidProcessTableFile <em>pathname</em></code></td></tr> |
| <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>FcgidProcessTableFile logs/fcgid_shm</code></td></tr> |
| <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr> |
| <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>External</td></tr> |
| <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_fcgid</td></tr> |
| </table> |
| <p>This module uses shared memory on Unix to maintain state which |
| is shared between httpd processes. This directive specifies the |
| name of the shared memory file.</p> |
| |
| </div> |
| <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> |
| <div class="directive-section"><h2><a name="FcgidSpawnScore" id="FcgidSpawnScore">FcgidSpawnScore</a> <a name="fcgidspawnscore" id="fcgidspawnscore">Directive</a></h2> |
| <table class="directive"> |
| <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Each spawn adds this value to the process activity score.</td></tr> |
| <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FcgidSpawnScore <em>value</em></code></td></tr> |
| <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>FcgidSpawnScore 1</code></td></tr> |
| <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr> |
| <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>External</td></tr> |
| <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_fcgid</td></tr> |
| </table> |
| <p>Lower values of this directive increase the allowed spawn rate.</p> |
| |
| <p>Refer to the <code class="directive"><a href="#fcgidspawnscoreuplimit">FcgidSpawnScoreUpLimit</a></code> |
| directive for more information.</p> |
| |
| </div> |
| <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> |
| <div class="directive-section"><h2><a name="FcgidSpawnScoreUpLimit" id="FcgidSpawnScoreUpLimit">FcgidSpawnScoreUpLimit</a> <a name="fcgidspawnscoreuplimit" id="fcgidspawnscoreuplimit">Directive</a></h2> |
| <table class="directive"> |
| <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maximum value of the process activity score which allows |
| a spawn to occur</td></tr> |
| <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FcgidSpawnScoreUpLimit <em>value</em></code></td></tr> |
| <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>FcgidSpawnScoreUpLimit 10</code></td></tr> |
| <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr> |
| <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>External</td></tr> |
| <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_fcgid</td></tr> |
| </table> |
| <p>A process activity score is maintained for each FastCGI application; |
| the score is used to control the rate of spawning in order to avoid |
| placing too much load on the system, particularly for applications that |
| are repeatedly exiting abnormally.</p> |
| |
| <p>The value of <code class="directive"><a href="#fcgidspawnscore">FcgidSpawnScore</a></code> |
| is added to the score for every spawned application process. The value of |
| <code class="directive"><a href="#fcgidterminationscore">FcgidTerminationScore</a></code> is added |
| to the score for every terminated application process. The value of |
| <code class="directive"><a href="#fcgidtimescore">FcgidTimeScore</a></code> is subtracted |
| from the score every second.</p> |
| |
| <p>When the current score is higher than the value of |
| <code class="directive">FcgidSpawnScoreUpLimit</code>, no additional application |
| processes will be spawned; subsequent requests must wait until an existing |
| process is free or until the score decreases below the limit.</p> |
| |
| <p>If the limit is reached under normal load, it may not be sufficient to |
| simply increase the limit, as that would only delay the amount of time |
| before the limit is reached again. Decrease the value of |
| <code class="directive"><a href="#fcgidspawnscore">FcgidSpawnScore</a></code> and/or |
| <code class="directive"><a href="#fcgidterminationscore">FcgidTerminationScore</a></code>, or |
| increase the value of <code class="directive"><a href="#fcgidtimescore">FcgidTimeScore</a></code>, |
| to allow a higher rate of spawning.</p> |
| |
| </div> |
| <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> |
| <div class="directive-section"><h2><a name="FcgidTerminationScore" id="FcgidTerminationScore">FcgidTerminationScore</a> <a name="fcgidterminationscore" id="fcgidterminationscore">Directive</a></h2> |
| <table class="directive"> |
| <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Each terminated process adds this value to the process activity |
| score.</td></tr> |
| <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FcgidTerminationScore <em>value</em></code></td></tr> |
| <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>FcgidTerminationScore 2</code></td></tr> |
| <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr> |
| <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>External</td></tr> |
| <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_fcgid</td></tr> |
| </table> |
| <p>Lower values of this directive increase the allowed spawn rate. Negative |
| values can be useful in some circumstances, such as allowing process |
| replacement without increasing the score.</p> |
| |
| <p>Refer to the <code class="directive"><a href="#fcgidspawnscoreuplimit">FcgidSpawnScoreUpLimit</a></code> |
| directive for more information.</p> |
| |
| </div> |
| <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> |
| <div class="directive-section"><h2><a name="FcgidTimeScore" id="FcgidTimeScore">FcgidTimeScore</a> <a name="fcgidtimescore" id="fcgidtimescore">Directive</a></h2> |
| <table class="directive"> |
| <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Amount subtracted from process activity score each |
| second</td></tr> |
| <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FcgidTimeScore <em>value</em></code></td></tr> |
| <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>FcgidTimeScore 1</code></td></tr> |
| <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr> |
| <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>External</td></tr> |
| <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_fcgid</td></tr> |
| </table> |
| <p>Higher values of this directive increase the allowed spawn rate.</p> |
| |
| <p>Refer to the <code class="directive"><a href="#fcgidspawnscoreuplimit">FcgidSpawnScoreUpLimit</a></code> |
| directive for more information.</p> |
| |
| </div> |
| <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> |
| <div class="directive-section"><h2><a name="FcgidWin32PreventOrphans" id="FcgidWin32PreventOrphans">FcgidWin32PreventOrphans</a> <a name="fcgidwin32preventorphans" id="fcgidwin32preventorphans">Directive</a></h2> |
| <table class="directive"> |
| <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Job Control orphan prevention for fcgi workers.</td></tr> |
| <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FcgidWin32PreventOrphans <em>On|Off</em></code></td></tr> |
| <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>FcgidWin32PreventOrphans Off</code></td></tr> |
| <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr> |
| <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>External</td></tr> |
| <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_fcgid</td></tr> |
| </table> |
| <p>Uses Job Control Objects on Windows, only, to enforce shutdown of all |
| fcgi processes created by the httpd worker when the httpd worker has been |
| terminated. Processes terminated in this way do not have the opportunity |
| to clean up gracefully, complete pending disk writes, or similar closure |
| transactions, therefore this behavior is experimental and disabled, by |
| default.</p> |
| |
| </div> |
| <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> |
| <div class="directive-section"><h2><a name="FcgidWrapper" id="FcgidWrapper">FcgidWrapper</a> <a name="fcgidwrapper" id="fcgidwrapper">Directive</a></h2> |
| <table class="directive"> |
| <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>The CGI wrapper setting</td></tr> |
| <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FcgidWrapper <em>command</em> [ <em>suffix</em> ] [ virtual ]</code></td></tr> |
| <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>none</code></td></tr> |
| <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr> |
| <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr> |
| <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>External</td></tr> |
| <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_fcgid</td></tr> |
| </table> |
| <p>The given command is used to spawn FCGI server processes. If this directive |
| is not used, the file pointed to by the request URL will be used instead. |
| Options for the command can be included using quotation marks surrounding |
| the command and options.</p> |
| <p>The optional <code>suffix</code> argument restricts the use of this FCGI |
| server to all URLs with the given exact path suffix. A suffix needs to start |
| with '<code>.</code>'.</p> |
| <p>The <code>virtual</code> flag signals that there will be no check |
| whether the request URL actually points to an existing file. The only |
| file which needs to exist is the wrapper itself.</p> |
| <p>The directive can be used multiple times. A wrapper defined without a suffix |
| is used as a default in case no suffix matches.</p> |
| |
| </div> |
| <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> |
| <div class="directive-section"><h2><a name="FcgidZombieScanInterval" id="FcgidZombieScanInterval">FcgidZombieScanInterval</a> <a name="fcgidzombiescaninterval" id="fcgidzombiescaninterval">Directive</a></h2> |
| <table class="directive"> |
| <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>scan interval for zombie process</td></tr> |
| <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FcgidZombieScanInterval <em>seconds</em></code></td></tr> |
| <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>FcgidZombieScanInterval 3</code></td></tr> |
| <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr> |
| <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>External</td></tr> |
| <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_fcgid</td></tr> |
| </table> |
| <p>The module checks for exited FastCGI applications at this interval. |
| During this period of time, the application may exist in the process |
| table as a zombie (on Unix).</p> |
| |
| </div> |
| </div> |
| <div class="bottomlang"> |
| <p><span>Available Languages: </span><a href="../en/mod/mod_fcgid.html" title="English"> en </a></p> |
| </div><div class="top"><a href="#page-header"><img src="../images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div> |
| <script type="text/javascript"><!--//--><![CDATA[//><!-- |
| var comments_shortname = 'httpd'; |
| var comments_identifier = 'http://httpd.apache.org/docs/trunk/mod/mod_fcgid.html'; |
| (function(w, d) { |
| if (w.location.hostname.toLowerCase() == "httpd.apache.org") { |
| d.write('<div id="comments_thread"><\/div>'); |
| var s = d.createElement('script'); |
| s.type = 'text/javascript'; |
| s.async = true; |
| s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier; |
| (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s); |
| } |
| else { |
| d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>'); |
| } |
| })(window, document); |
| //--><!]]></script></div><div id="footer"> |
| <p class="apache">Copyright 2020 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> |
| <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/quickreference.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- |
| if (typeof(prettyPrint) !== 'undefined') { |
| prettyPrint(); |
| } |
| //--><!]]></script> |
| </body></html> |