mod_proxy_fcgi.html.en revision b09fcdfc59ada4712150e7bcc7b502bb9e4601d8
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi This file is generated from xml source: DO NOT EDIT
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi<link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen<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" />
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen<script src="/style/scripts/prettify.js" type="text/javascript">
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi<link href="/images/favicon.ico" rel="shortcut icon" /></head>
d229f940abfb2490dee17979e9a5ff31b7012eb5rbowen<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.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>
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi<div class="up"><a href="./"><img title="<-" alt="<-" src="/images/left.gif" /></a></div>
3f08db06526d6901aa08c110b5bc7dde6bc39905nd<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>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi<div id="preamble"><h1>Apache Module mod_proxy_fcgi</h1>
f086b4b402fa9a2fefc7dda85de2a3cc1cd0a654rjung<p><span>Available Languages: </span><a href="/en/mod/mod_proxy_fcgi.html" title="English"> en </a></p>
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi<table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>FastCGI support module for
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi<code class="module"><a href="/mod/mod_proxy.html">mod_proxy</a></code></td></tr>
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi<tr><th><a href="module-dict.html#Status">Status:</a></th><td>Extension</td></tr>
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi<tr><th><a href="module-dict.html#ModuleIdentifier">Module�Identifier:</a></th><td>proxy_fcgi_module</td></tr>
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi<tr><th><a href="module-dict.html#SourceFile">Source�File:</a></th><td>mod_proxy_fcgi.c</td></tr>
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi<tr><th><a href="module-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.3 and later</td></tr></table>
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf <p>This module <em>requires</em> the service of <code class="module"><a href="/mod/mod_proxy.html">mod_proxy</a></code>. It provides support for the
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick <a href="http://www.fastcgi.com/">FastCGI</a> protocol.</p>
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick <p>Thus, in order to get the ability of handling the <code>FastCGI</code>
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi protocol, <code class="module"><a href="/mod/mod_proxy.html">mod_proxy</a></code> and
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi <code class="module"><a href="/mod/mod_proxy_fcgi.html">mod_proxy_fcgi</a></code> have to be present in the server.</p>
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick <p>Unlike <a href="http://httpd.apache.org/mod_fcgid/">mod_fcgid</a>
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick <code class="module"><a href="/mod/mod_proxy_fcgi.html">mod_proxy_fcgi</a></code> has no provision for starting the
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick application process; <code class="program"><a href="/programs/fcgistarter.html">fcgistarter</a></code> is provided for
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick that purpose.</p>
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi <p>Do not enable proxying until you have <a href="mod_proxy.html#access">secured your server</a>. Open proxy
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi servers are dangerous both to your network and to the Internet at
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi<div id="quickview"><h3 class="directives">Directives</h3>
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi<p>This module provides no
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi directives.</p>
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick<li><img alt="" src="/images/down.gif" /> <a href="#examples">Examples</a></li>
f538c1c51c0d8d53be040a5b8e93fffcce4dba34jim<li><img alt="" src="/images/down.gif" /> <a href="#env">Environment Variables</a></li>
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi<li><code class="program"><a href="/programs/fcgistarter.html">fcgistarter</a></code></li>
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi<li><code class="module"><a href="/mod/mod_proxy.html">mod_proxy</a></code></li>
30471a4650391f57975f60bbb6e4a90be7b284bfhumbedooh</ul><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div>
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick<h2><a name="examples" id="examples">Examples</a></h2>
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick <p>Remember, in order to make the following examples work, you have to
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick enable <code class="module"><a href="/mod/mod_proxy.html">mod_proxy</a></code> and <code class="module"><a href="/mod/mod_proxy_fcgi.html">mod_proxy_fcgi</a></code>.</p>
e487d6c09669296f94a5190cc34586a98e624a00nd <div class="example"><h3>Single application instance</h3><pre class="prettyprint lang-config">
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick ProxyPass /myapp/ fcgi://localhost:4000/
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick <p>This application should be able to handle multiple concurrent
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf connections. <code class="module"><a href="/mod/mod_proxy.html">mod_proxy</a></code> enables connection reuse by
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick default, so after a request has been completed the connection will be
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick held open by that httpd child process and won't be reused until that
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf httpd process routes another request to the application. If the
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick FastCGI application is unable to handle enough concurrent connections
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick from httpd, requests can block waiting for the application to close
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick an existing connection. One way to resolve this is to disable connection
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick reuse on the <code class="directive">ProxyPass</code> directive, as shown in
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick the following example:</p>
e487d6c09669296f94a5190cc34586a98e624a00nd <div class="example"><h3>Single application instance, no connection reuse</h3><pre class="prettyprint lang-config">
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick ProxyPass /myapp/ fcgi://localhost:4000/ disablereuse=on
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick <p>The balanced gateway needs <code class="module"><a href="/mod/mod_proxy_balancer.html">mod_proxy_balancer</a></code> and
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf at least one load balancer algorithm module, such as
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick <code class="module"><a href="/mod/mod_lbmethod_byrequests.html">mod_lbmethod_byrequests</a></code>, in addition to the proxy
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick modules listed above. <code class="module"><a href="/mod/mod_lbmethod_byrequests.html">mod_lbmethod_byrequests</a></code> is the
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick default, and will be used for this example configuration.</p>
e487d6c09669296f94a5190cc34586a98e624a00nd <div class="example"><h3>Balanced gateway to multiple application instances</h3><pre class="prettyprint lang-config">
a4784b5a082381b03e972caf3aa052a64c68f06dhumbedoohProxyPass /myapp/ balancer://myappcluster/
a4784b5a082381b03e972caf3aa052a64c68f06dhumbedooh<Proxy balancer://myappcluster/>
b09fcdfc59ada4712150e7bcc7b502bb9e4601d8rjung BalancerMember fcgi://localhost:4000
b09fcdfc59ada4712150e7bcc7b502bb9e4601d8rjung BalancerMember fcgi://localhost:4001
a4784b5a082381b03e972caf3aa052a64c68f06dhumbedooh</Proxy>
f538c1c51c0d8d53be040a5b8e93fffcce4dba34jim</div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
f538c1c51c0d8d53be040a5b8e93fffcce4dba34jim<h2><a name="env" id="env">Environment Variables</a></h2>
f538c1c51c0d8d53be040a5b8e93fffcce4dba34jim <p>In addition to the configuration directives that control the
f538c1c51c0d8d53be040a5b8e93fffcce4dba34jim behaviour of <code class="module"><a href="/mod/mod_proxy.html">mod_proxy</a></code>, there are a number of
f538c1c51c0d8d53be040a5b8e93fffcce4dba34jim <dfn>environment variables</dfn> that control the FCGI protocol
f538c1c51c0d8d53be040a5b8e93fffcce4dba34jim provider:</p>
f538c1c51c0d8d53be040a5b8e93fffcce4dba34jim <dd>By default <code class="module"><a href="/mod/mod_proxy_fcgi.html">mod_proxy_fcgi</a></code> will neither create
f538c1c51c0d8d53be040a5b8e93fffcce4dba34jim nor export the <var>PATH_INFO</var> environment variable. This allows
f538c1c51c0d8d53be040a5b8e93fffcce4dba34jim the backend FCGI server to correctly determine <var>SCRIPT_NAME</var>
f538c1c51c0d8d53be040a5b8e93fffcce4dba34jim and <var>Script-URI</var> and be compliant with RFC 3875 section 3.3.
f538c1c51c0d8d53be040a5b8e93fffcce4dba34jim If instead you need <code class="module"><a href="/mod/mod_proxy_fcgi.html">mod_proxy_fcgi</a></code> to generate
f538c1c51c0d8d53be040a5b8e93fffcce4dba34jim a "best guess" for <var>PATH_INFO</var>, set this env-var.
f538c1c51c0d8d53be040a5b8e93fffcce4dba34jim This is a workaround for a bug in some FCGI implementations.</dd>
f086b4b402fa9a2fefc7dda85de2a3cc1cd0a654rjung<p><span>Available Languages: </span><a href="/en/mod/mod_proxy_fcgi.html" title="English"> en </a></p>
727872d18412fc021f03969b8641810d8896820bhumbedooh</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>
727872d18412fc021f03969b8641810d8896820bhumbedoohvar comments_shortname = 'httpd';
cc7e1025de9ac63bd4db6fe7f71c158b2cf09fe4humbedoohvar comments_identifier = 'http://httpd.apache.org/docs/trunk/mod/mod_proxy_fcgi.html';
0d0ba3a410038e179b695446bb149cce6264e0abnd(function(w, d) {
cc7e1025de9ac63bd4db6fe7f71c158b2cf09fe4humbedooh if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
727872d18412fc021f03969b8641810d8896820bhumbedooh d.write('<div id="comments_thread"><\/div>');
0d0ba3a410038e179b695446bb149cce6264e0abnd var s = d.createElement('script');
ac082aefa89416cbdc9a1836eaf3bed9698201c8humbedooh s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
0d0ba3a410038e179b695446bb149cce6264e0abnd (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
727872d18412fc021f03969b8641810d8896820bhumbedooh d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>');
0d0ba3a410038e179b695446bb149cce6264e0abnd})(window, document);
5effc8b39fae5cd169d17f342bfc265705840014rbowen<p class="apache">Copyright 2012 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>
d229f940abfb2490dee17979e9a5ff31b7012eb5rbowen<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.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[//><!--
0d0ba3a410038e179b695446bb149cce6264e0abndif (typeof(prettyPrint) !== 'undefined') {
7fec19672a491661b2fe4b29f685bc7f4efa64d4nd prettyPrint();