mod_proxy_fcgi.html.en revision 9a58dc6a2b26ec128b1270cf48810e705f1a90db
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi<?xml version="1.0" encoding="ISO-8859-1"?>
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 -->
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi<title>mod_proxy_fcgi - Apache HTTP Server</title>
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" />
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi<link href="/style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi<link href="/images/favicon.ico" rel="shortcut icon" /></head>
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi<body>
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi<div id="page-header">
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="/faq/">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p>
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi<p class="apache">Apache HTTP Server Version 2.3</p>
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi<img alt="" src="/images/feather.gif" /></div>
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi<div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="/images/left.gif" /></a></div>
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi<div id="path">
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.3</a> &gt; <a href="./">Modules</a></div>
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi<div id="page-content">
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi<div id="preamble"><h1>Apache Module mod_proxy_fcgi</h1>
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi<div class="toplang">
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi<p><span>Available Languages: </span><a href="/en/mod/mod_proxy_fcgi.html" title="English">&nbsp;en&nbsp;</a></p>
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi</div>
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>
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi<h3>Summary</h3>
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi
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>
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi
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>
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick <p>Unlike <a href="http://httpd.apache.org/mod_fcgid/">mod_fcgid</a>
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf and <a href="http://www.fastcgi.com/">mod_fastcgi</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>
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi <div class="warning"><h3>Warning</h3>
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 large.</p>
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi </div>
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi</div>
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi<div id="quickview"><h3 class="directives">Directives</h3>
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi<p>This module provides no
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi directives.</p>
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick<h3>Topics</h3>
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick<ul id="topics">
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>
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick</ul><h3>See also</h3>
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi<ul class="seealso">
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>
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi</ul></div>
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick<div class="section">
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>
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick <div class="example"><h3>Single application instance</h3><p><code>
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick ProxyPass /myapp/ fcgi://localhost:4000/
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick </code></p></div>
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick
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>
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick <div class="example"><h3>Single application instance, no connection reuse</h3><p><code>
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick ProxyPass /myapp/ fcgi://localhost:4000/ disablereuse=on
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick </code></p></div>
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick
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>
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick <div class="example"><h3>Balanced gateway to multiple application instances</h3><p><code>
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick ProxyPass /myapp/ balancer://myappcluster/<br />
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick &lt;Proxy balancer://myappcluster/&gt;<br />
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick <span class="indent">
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick BalancerMember fcgi://localhost:4000/<br />
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick BalancerMember fcgi://localhost:4001/<br />
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick </span>
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick &lt;/Proxy&gt;
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick </code></p></div>
f538c1c51c0d8d53be040a5b8e93fffcce4dba34jim</div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
f538c1c51c0d8d53be040a5b8e93fffcce4dba34jim<div class="section">
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 <dl>
f538c1c51c0d8d53be040a5b8e93fffcce4dba34jim <dt>proxy-fcgi-pathinfo</dt>
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>
f538c1c51c0d8d53be040a5b8e93fffcce4dba34jim </dl>
c8fa0a6b7b2b6beb23bf4684720100e60e4e5764trawick</div>
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi</div>
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi<div class="bottomlang">
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi<p><span>Available Languages: </span><a href="/en/mod/mod_proxy_fcgi.html" title="English">&nbsp;en&nbsp;</a></p>
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi</div><div id="footer">
9c1260efa52c82c2a58e5b5f20cd6902563d95f5rbowen<p class="apache">Copyright 2011 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>
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="/faq/">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p></div>
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi</body></html>