mod_proxy_fcgi.xml revision af821737aacf3ed6f419732f7420b331bae80ba7
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
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi >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>
af821737aacf3ed6f419732f7420b331bae80ba7trawick 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>
629efd2575d82e4678778e408bf932685a021d70trawick ProxyPass /myapp/ fcgi://localhost:4000/
629efd2575d82e4678778e408bf932685a021d70trawick </example>
629efd2575d82e4678778e408bf932685a021d70trawick
af821737aacf3ed6f419732f7420b331bae80ba7trawick <p>This application should be able to handle multiple concurrent
af821737aacf3ed6f419732f7420b331bae80ba7trawick 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
af821737aacf3ed6f419732f7420b331bae80ba7trawick 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>
af821737aacf3ed6f419732f7420b331bae80ba7trawick ProxyPass /myapp/ fcgi://localhost:4000/ disablereuse=on
af821737aacf3ed6f419732f7420b331bae80ba7trawick </example>
af821737aacf3ed6f419732f7420b331bae80ba7trawick
fd961f7871d2a909f75baf2769652e59c360f16etrawick <p>The balanced gateway needs <module>mod_proxy_balancer</module> and
fd961f7871d2a909f75baf2769652e59c360f16etrawick 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>
629efd2575d82e4678778e408bf932685a021d70trawick ProxyPass /myapp/ balancer://myappcluster/<br />
629efd2575d82e4678778e408bf932685a021d70trawick &lt;Proxy balancer://myappcluster/&gt;<br />
629efd2575d82e4678778e408bf932685a021d70trawick <indent>
629efd2575d82e4678778e408bf932685a021d70trawick BalancerMember fcgi://localhost:4000/<br />
629efd2575d82e4678778e408bf932685a021d70trawick BalancerMember fcgi://localhost:4001/<br />
629efd2575d82e4678778e408bf932685a021d70trawick </indent>
629efd2575d82e4678778e408bf932685a021d70trawick &lt;/Proxy&gt;
629efd2575d82e4678778e408bf932685a021d70trawick </example>
629efd2575d82e4678778e408bf932685a021d70trawick</section>
629efd2575d82e4678778e408bf932685a021d70trawick
0efb708c6ae04a014ab52b50fb0b3961473296d3takashi</modulesynopsis>