mod_proxy_fcgi.xml revision 626cbbae0d87d1e58fabf969ef6c55e3f5fcd544
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi<!-- $LastChangedRevision$ -->
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 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<description>FastCGI support module for
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi<compatibility>Available in version 2.3 and later</compatibility>
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>
629efd2575d82e4678778e408bf932685a021d70trawick <p>Thus, in order to get the ability of handling the <code>FastCGI</code>
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi <module>mod_proxy_fcgi</module> have to be present in the server.</p>
629efd2575d82e4678778e408bf932685a021d70trawick <p>Unlike <a href="http://httpd.apache.org/mod_fcgid/">mod_fcgid</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>
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
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 ProxyPass /myapp/ fcgi://localhost:4000/
626cbbae0d87d1e58fabf969ef6c55e3f5fcd544humbedooh </highlight>
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 <example><title>Single application instance, no connection reuse</title>
af821737aacf3ed6f419732f7420b331bae80ba7trawick ProxyPass /myapp/ fcgi://localhost:4000/ disablereuse=on
626cbbae0d87d1e58fabf969ef6c55e3f5fcd544humbedooh </highlight>
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>
af821737aacf3ed6f419732f7420b331bae80ba7trawick <example><title>Balanced gateway to multiple application instances</title>
626cbbae0d87d1e58fabf969ef6c55e3f5fcd544humbedoohProxyPass /myapp/ balancer://myappcluster/
626cbbae0d87d1e58fabf969ef6c55e3f5fcd544humbedooh<Proxy balancer://myappcluster/>
626cbbae0d87d1e58fabf969ef6c55e3f5fcd544humbedooh BalancerMember fcgi://localhost:4000/
626cbbae0d87d1e58fabf969ef6c55e3f5fcd544humbedooh BalancerMember fcgi://localhost:4001/
626cbbae0d87d1e58fabf969ef6c55e3f5fcd544humbedooh</Proxy>
626cbbae0d87d1e58fabf969ef6c55e3f5fcd544humbedooh </highlight>
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 <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>
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi</modulesynopsis>