mod_proxy_fcgi.xml revision 49c1d45abbd5add003287667aa1e934444fa4974
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi<?xml version="1.0"?>
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi<!-- $LastChangedRevision$ -->
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi<!--
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi Licensed to the Apache Software Foundation (ASF) under one or more
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi contributor license agreements. See the NOTICE file distributed with
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi this work for additional information regarding copyright ownership.
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi The ASF licenses this file to You under the Apache License, Version 2.0
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi (the "License"); you may not use this file except in compliance with
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi the License. You may obtain a copy of the License at
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi http://www.apache.org/licenses/LICENSE-2.0
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi Unless required by applicable law or agreed to in writing, software
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi distributed under the License is distributed on an "AS IS" BASIS,
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi See the License for the specific language governing permissions and
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi limitations under the License.
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi-->
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi<modulesynopsis metafile="mod_proxy_fcgi.xml.meta">
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi
722110c962e63af83151d807f722b0fd8b9fd34btakashi<name>mod_proxy_fcgi</name>
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi<description>FastCGI support module for
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi<module>mod_proxy</module></description>
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi<status>Extension</status>
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi<sourcefile>mod_proxy_fcgi.c</sourcefile>
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi<identifier>proxy_fcgi_module</identifier>
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi<compatibility>Available in version 2.3 and later</compatibility>
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi<summary>
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi <p>This module <em>requires</em> the service of <module
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim >mod_proxy</module>. It provides support for the
629efd2575d82e4678778e408bf932685a021d70trawick <a href="http://www.fastcgi.com/">FastCGI</a> protocol.</p>
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi
629efd2575d82e4678778e408bf932685a021d70trawick <p>Thus, in order to get the ability of handling the <code>FastCGI</code>
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi protocol, <module>mod_proxy</module> and
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi <module>mod_proxy_fcgi</module> have to be present in the server.</p>
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi
629efd2575d82e4678778e408bf932685a021d70trawick <p>Unlike <a href="http://httpd.apache.org/mod_fcgid/">mod_fcgid</a>
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim and <a href="http://www.fastcgi.com/">mod_fastcgi</a>,
629efd2575d82e4678778e408bf932685a021d70trawick <module>mod_proxy_fcgi</module> has no provision for starting the
629efd2575d82e4678778e408bf932685a021d70trawick application process; <program>fcgistarter</program> is provided for
629efd2575d82e4678778e408bf932685a021d70trawick that purpose.</p>
629efd2575d82e4678778e408bf932685a021d70trawick
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi <note type="warning"><title>Warning</title>
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi <p>Do not enable proxying until you have <a
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi href="mod_proxy.html#access">secured your server</a>. Open proxy
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi servers are dangerous both to your network and to the Internet at
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi large.</p>
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi </note>
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi</summary>
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi<seealso><program>fcgistarter</program></seealso>
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi<seealso><module>mod_proxy</module></seealso>
629efd2575d82e4678778e408bf932685a021d70trawick
629efd2575d82e4678778e408bf932685a021d70trawick<section id="examples"><title>Examples</title>
629efd2575d82e4678778e408bf932685a021d70trawick <p>Remember, in order to make the following examples work, you have to
629efd2575d82e4678778e408bf932685a021d70trawick enable <module>mod_proxy</module> and <module>mod_proxy_fcgi</module>.</p>
629efd2575d82e4678778e408bf932685a021d70trawick
af821737aacf3ed6f419732f7420b331bae80ba7trawick <example><title>Single application instance</title>
626cbbae0d87d1e58fabf969ef6c55e3f5fcd544humbedooh <highlight language="config">
629efd2575d82e4678778e408bf932685a021d70trawick ProxyPass /myapp/ fcgi://localhost:4000/
626cbbae0d87d1e58fabf969ef6c55e3f5fcd544humbedooh </highlight>
629efd2575d82e4678778e408bf932685a021d70trawick </example>
629efd2575d82e4678778e408bf932685a021d70trawick
af821737aacf3ed6f419732f7420b331bae80ba7trawick <p>This application should be able to handle multiple concurrent
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim connections. <module>mod_proxy</module> enables connection reuse by
af821737aacf3ed6f419732f7420b331bae80ba7trawick default, so after a request has been completed the connection will be
af821737aacf3ed6f419732f7420b331bae80ba7trawick held open by that httpd child process and won't be reused until that
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim httpd process routes another request to the application. If the
af821737aacf3ed6f419732f7420b331bae80ba7trawick FastCGI application is unable to handle enough concurrent connections
af821737aacf3ed6f419732f7420b331bae80ba7trawick from httpd, requests can block waiting for the application to close
af821737aacf3ed6f419732f7420b331bae80ba7trawick an existing connection. One way to resolve this is to disable connection
af821737aacf3ed6f419732f7420b331bae80ba7trawick reuse on the <directive>ProxyPass</directive> directive, as shown in
af821737aacf3ed6f419732f7420b331bae80ba7trawick the following example:</p>
af821737aacf3ed6f419732f7420b331bae80ba7trawick
af821737aacf3ed6f419732f7420b331bae80ba7trawick <example><title>Single application instance, no connection reuse</title>
626cbbae0d87d1e58fabf969ef6c55e3f5fcd544humbedooh <highlight language="config">
af821737aacf3ed6f419732f7420b331bae80ba7trawick ProxyPass /myapp/ fcgi://localhost:4000/ disablereuse=on
626cbbae0d87d1e58fabf969ef6c55e3f5fcd544humbedooh </highlight>
af821737aacf3ed6f419732f7420b331bae80ba7trawick </example>
af821737aacf3ed6f419732f7420b331bae80ba7trawick
fd961f7871d2a909f75baf2769652e59c360f16etrawick <p>The balanced gateway needs <module>mod_proxy_balancer</module> and
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim at least one load balancer algorithm module, such as
fd961f7871d2a909f75baf2769652e59c360f16etrawick <module>mod_lbmethod_byrequests</module>, in addition to the proxy
fd961f7871d2a909f75baf2769652e59c360f16etrawick modules listed above. <module>mod_lbmethod_byrequests</module> is the
af821737aacf3ed6f419732f7420b331bae80ba7trawick default, and will be used for this example configuration.</p>
629efd2575d82e4678778e408bf932685a021d70trawick
af821737aacf3ed6f419732f7420b331bae80ba7trawick <example><title>Balanced gateway to multiple application instances</title>
626cbbae0d87d1e58fabf969ef6c55e3f5fcd544humbedooh <highlight language="config">
626cbbae0d87d1e58fabf969ef6c55e3f5fcd544humbedoohProxyPass /myapp/ balancer://myappcluster/
626cbbae0d87d1e58fabf969ef6c55e3f5fcd544humbedooh&lt;Proxy balancer://myappcluster/&gt;
49c1d45abbd5add003287667aa1e934444fa4974rjung BalancerMember fcgi://localhost:4000
49c1d45abbd5add003287667aa1e934444fa4974rjung BalancerMember fcgi://localhost:4001
626cbbae0d87d1e58fabf969ef6c55e3f5fcd544humbedooh&lt;/Proxy&gt;
626cbbae0d87d1e58fabf969ef6c55e3f5fcd544humbedooh </highlight>
629efd2575d82e4678778e408bf932685a021d70trawick </example>
629efd2575d82e4678778e408bf932685a021d70trawick</section>
629efd2575d82e4678778e408bf932685a021d70trawick
2935c06515b172db47bc622218179a22fa45437ejim<section id="env"><title>Environment Variables</title>
2935c06515b172db47bc622218179a22fa45437ejim <p>In addition to the configuration directives that control the
2935c06515b172db47bc622218179a22fa45437ejim behaviour of <module>mod_proxy</module>, there are a number of
2935c06515b172db47bc622218179a22fa45437ejim <dfn>environment variables</dfn> that control the FCGI protocol
2935c06515b172db47bc622218179a22fa45437ejim provider:</p>
2935c06515b172db47bc622218179a22fa45437ejim <dl>
2935c06515b172db47bc622218179a22fa45437ejim <dt>proxy-fcgi-pathinfo</dt>
2935c06515b172db47bc622218179a22fa45437ejim <dd>By default <module>mod_proxy_fcgi</module> will neither create
2935c06515b172db47bc622218179a22fa45437ejim nor export the <var>PATH_INFO</var> environment variable. This allows
2935c06515b172db47bc622218179a22fa45437ejim the backend FCGI server to correctly determine <var>SCRIPT_NAME</var>
2935c06515b172db47bc622218179a22fa45437ejim and <var>Script-URI</var> and be compliant with RFC 3875 section 3.3.
2935c06515b172db47bc622218179a22fa45437ejim If instead you need <module>mod_proxy_fcgi</module> to generate
2935c06515b172db47bc622218179a22fa45437ejim a "best guess" for <var>PATH_INFO</var>, set this env-var.
2935c06515b172db47bc622218179a22fa45437ejim This is a workaround for a bug in some FCGI implementations.</dd>
2935c06515b172db47bc622218179a22fa45437ejim </dl>
2935c06515b172db47bc622218179a22fa45437ejim</section>
2935c06515b172db47bc622218179a22fa45437ejim
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi</modulesynopsis>