]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_proxy_fcgi.xml
Update transforms
[apache] / docs / manual / mod / mod_proxy_fcgi.xml
1 <?xml version="1.0"?>
2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
4 <!-- $LastChangedRevision$ -->
5
6 <!--
7  Licensed to the Apache Software Foundation (ASF) under one or more
8  contributor license agreements.  See the NOTICE file distributed with
9  this work for additional information regarding copyright ownership.
10  The ASF licenses this file to You under the Apache License, Version 2.0
11  (the "License"); you may not use this file except in compliance with
12  the License.  You may obtain a copy of the License at
13
14      http://www.apache.org/licenses/LICENSE-2.0
15
16  Unless required by applicable law or agreed to in writing, software
17  distributed under the License is distributed on an "AS IS" BASIS,
18  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  See the License for the specific language governing permissions and
20  limitations under the License.
21 -->
22
23 <modulesynopsis metafile="mod_proxy_fcgi.xml.meta">
24
25 <name>mod_proxy_fcgi</name>
26 <description>FastCGI support module for
27 <module>mod_proxy</module></description>
28 <status>Extension</status>
29 <sourcefile>mod_proxy_fcgi.c</sourcefile>
30 <identifier>proxy_fcgi_module</identifier>
31 <compatibility>Available in version 2.3 and later</compatibility>
32
33 <summary>
34     <p>This module <em>requires</em> the service of <module
35     >mod_proxy</module>. It provides support for the 
36     <a href="http://www.fastcgi.com/">FastCGI</a> protocol.</p>
37
38     <p>Thus, in order to get the ability of handling the <code>FastCGI</code>
39     protocol, <module>mod_proxy</module> and
40     <module>mod_proxy_fcgi</module> have to be present in the server.</p>
41
42     <p>Unlike <a href="http://httpd.apache.org/mod_fcgid/">mod_fcgid</a>
43     and <a href="http://www.fastcgi.com/">mod_fastcgi</a>, 
44     <module>mod_proxy_fcgi</module> has no provision for starting the
45     application process; <program>fcgistarter</program> is provided for
46     that purpose.</p>
47
48     <note type="warning"><title>Warning</title>
49       <p>Do not enable proxying until you have <a
50       href="mod_proxy.html#access">secured your server</a>. Open proxy
51       servers are dangerous both to your network and to the Internet at
52       large.</p>
53     </note>
54 </summary>
55
56 <seealso><program>fcgistarter</program></seealso>
57 <seealso><module>mod_proxy</module></seealso>
58
59 <section id="examples"><title>Examples</title>
60     <p>Remember, in order to make the following examples work, you have to
61     enable <module>mod_proxy</module> and <module>mod_proxy_fcgi</module>.</p>
62
63     <example><title>Single application instance</title>
64       ProxyPass /myapp/ fcgi://localhost:4000/
65     </example>
66
67     <p>This application should be able to handle multiple concurrent
68     connections.  <module>mod_proxy</module> enables connection reuse by 
69     default, so after a request has been completed the connection will be
70     held open by that httpd child process and won't be reused until that
71     httpd process routes another request to the application.  If the 
72     FastCGI application is unable to handle enough concurrent connections
73     from httpd, requests can block waiting for the application to close
74     an existing connection.  One way to resolve this is to disable connection
75     reuse on the <directive>ProxyPass</directive> directive, as shown in
76     the following example:</p>
77
78     <example><title>Single application instance, no connection reuse</title>
79       ProxyPass /myapp/ fcgi://localhost:4000/ disablereuse=on
80     </example>
81
82     <p>The balanced gateway needs <module>mod_proxy_balancer</module> and
83     at least one load balancer algorithm module, such as 
84     <module>mod_lbmethod_byrequests</module>, in addition to the proxy
85     modules listed above.  <module>mod_lbmethod_byrequests</module> is the
86     default, and will be used for this example configuration.</p>
87
88     <example><title>Balanced gateway to multiple application instances</title>
89     ProxyPass /myapp/ balancer://myappcluster/<br />
90     &lt;Proxy balancer://myappcluster/&gt;<br />
91     <indent>
92         BalancerMember fcgi://localhost:4000/<br />
93         BalancerMember fcgi://localhost:4001/<br />
94     </indent>
95     &lt;/Proxy&gt;
96     </example>
97 </section>
98
99 <section id="env"><title>Environment Variables</title>
100     <p>In addition to the configuration directives that control the
101     behaviour of <module>mod_proxy</module>, there are a number of
102     <dfn>environment variables</dfn> that control the FCGI protocol
103     provider:</p>
104     <dl>
105         <dt>proxy-fcgi-pathinfo</dt>
106         <dd>By default <module>mod_proxy_fcgi</module> will neither create
107         nor export the <var>PATH_INFO</var> environment variable. This allows
108         the backend FCGI server to correctly determine <var>SCRIPT_NAME</var>
109         and <var>Script-URI</var> and be compliant with RFC 3875 section 3.3.
110         If instead you need <module>mod_proxy_fcgi</module> to generate
111         a "best guess" for <var>PATH_INFO</var>, set this env-var.
112         This is a workaround for a bug in some FCGI implementations.</dd>
113     </dl>
114 </section>
115
116 </modulesynopsis>