You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by sl...@apache.org on 2007/08/01 16:00:43 UTC

svn commit: r561800 - in /httpd/httpd/branches/2.2.x/docs/manual: mod/mod_proxy.html.en mod/mod_proxy.xml mod/mod_rewrite.html.en mod/mod_rewrite.xml programs/httpd.html.en programs/httpd.xml

Author: slive
Date: Wed Aug  1 07:00:42 2007
New Revision: 561800

URL: http://svn.apache.org/viewvc?view=rev&rev=561800
Log:
Merge r561456, r561463, r561477, r561485, r561797 from trunk:

Explicitly mention how to do rewriting in a vhost.

PR: 36506


Document that PT implies L.

PR: 40046


Docuemnt the x- headers added by mod_proxy_http.

PR: 41097


Document some -D magic.

PR: 41148


A couple small fixes suggested by Vincent.


Modified:
    httpd/httpd/branches/2.2.x/docs/manual/mod/mod_proxy.html.en
    httpd/httpd/branches/2.2.x/docs/manual/mod/mod_proxy.xml
    httpd/httpd/branches/2.2.x/docs/manual/mod/mod_rewrite.html.en
    httpd/httpd/branches/2.2.x/docs/manual/mod/mod_rewrite.xml
    httpd/httpd/branches/2.2.x/docs/manual/programs/httpd.html.en
    httpd/httpd/branches/2.2.x/docs/manual/programs/httpd.xml

Modified: httpd/httpd/branches/2.2.x/docs/manual/mod/mod_proxy.html.en
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/docs/manual/mod/mod_proxy.html.en?view=diff&rev=561800&r1=561799&r2=561800
==============================================================================
--- httpd/httpd/branches/2.2.x/docs/manual/mod/mod_proxy.html.en (original)
+++ httpd/httpd/branches/2.2.x/docs/manual/mod/mod_proxy.html.en Wed Aug  1 07:00:42 2007
@@ -95,6 +95,7 @@
 <li><img alt="" src="../images/down.gif" /> <a href="#intranet">Intranet Proxy</a></li>
 <li><img alt="" src="../images/down.gif" /> <a href="#envsettings">Protocol Adjustments</a></li>
 <li><img alt="" src="../images/down.gif" /> <a href="#request-bodies">Request Bodys</a></li>
+<li><img alt="" src="../images/down.gif" /> <a href="#x-headers">Reverse Proxy Request Headers</a></li>
 </ul><h3>See also</h3>
 <ul class="seealso">
 <li><code class="module"><a href="../mod/mod_cache.html">mod_cache</a></code></li>
@@ -285,7 +286,37 @@
     <code>proxy-sendchunked</code> minimizes resource usage by using
     chunked encoding.</p>
 
-    </div>
+    </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
+<div class="section">
+<h2><a name="x-headers" id="x-headers">Reverse Proxy Request Headers</a></h2>
+
+    <p>When acting in a reverse-proxy mode (using the <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive, for example),
+    <code class="module"><a href="../mod/mod_proxy_http.html">mod_proxy_http</a></code> adds several request headers in
+    order to pass information to the origin server. These headers
+    are:</p>
+
+    <dl>
+      <dt><code>X-Forwarded-For</code></dt>
+      <dd>The IP address of the client.</dd>
+      <dt><code>X-Forwarded-Host</code></dt>
+      <dd>The original host requested by the client in the <code>Host</code> 
+       HTTP request header.</dd>
+      <dt><code>X-Forwarded-Server</code></dt>
+      <dd>The hostname of the proxy server.</dd>
+    </dl>
+
+    <p>Be careful when using these headers on the origin server, since
+    they will contain more than one (comma-separated) value if the
+    original request already contained one of these headers. For
+    example, you can use <code>%{X-Forwarded-For}i</code> in the log
+    format string of the origin server to log the original clients IP
+    address, but you may get more than one address if the request
+    passes through several proxies.</p>
+
+    <p>See also the <code class="directive"><a href="#proxypreservehost">ProxyPreserveHost</a></code> and <code class="directive"><a href="#proxyvia">ProxyVia</a></code> directives, which control
+    other request headers.</p>
+
+   </div>
 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
 <div class="directive-section"><h2><a name="AllowCONNECT" id="AllowCONNECT">AllowCONNECT</a> <a name="allowconnect" id="allowconnect">Directive</a></h2>
 <table class="directive">

Modified: httpd/httpd/branches/2.2.x/docs/manual/mod/mod_proxy.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/docs/manual/mod/mod_proxy.xml?view=diff&rev=561800&r1=561799&r2=561800
==============================================================================
--- httpd/httpd/branches/2.2.x/docs/manual/mod/mod_proxy.xml (original)
+++ httpd/httpd/branches/2.2.x/docs/manual/mod/mod_proxy.xml Wed Aug  1 07:00:42 2007
@@ -262,6 +262,40 @@
 
     </section> <!-- /request-bodies -->
 
+    <section id="x-headers"><title>Reverse Proxy Request Headers</title>
+
+    <p>When acting in a reverse-proxy mode (using the <directive
+    module="mod_proxy">ProxyPass</directive> directive, for example),
+    <module>mod_proxy_http</module> adds several request headers in
+    order to pass information to the origin server. These headers
+    are:</p>
+
+    <dl>
+      <dt><code>X-Forwarded-For</code></dt>
+      <dd>The IP address of the client.</dd>
+      <dt><code>X-Forwarded-Host</code></dt>
+      <dd>The original host requested by the client in the <code>Host</code> 
+       HTTP request header.</dd>
+      <dt><code>X-Forwarded-Server</code></dt>
+      <dd>The hostname of the proxy server.</dd>
+    </dl>
+
+    <p>Be careful when using these headers on the origin server, since
+    they will contain more than one (comma-separated) value if the
+    original request already contained one of these headers. For
+    example, you can use <code>%{X-Forwarded-For}i</code> in the log
+    format string of the origin server to log the original clients IP
+    address, but you may get more than one address if the request
+    passes through several proxies.</p>
+
+    <p>See also the <directive
+    module="mod_proxy">ProxyPreserveHost</directive> and <directive
+    module="mod_proxy">ProxyVia</directive> directives, which control
+    other request headers.</p>
+
+   </section> <!--/x-headers -->
+
+
 <directivesynopsis type="section">
 <name>Proxy</name>
 <description>Container for directives applied to proxied resources</description>

Modified: httpd/httpd/branches/2.2.x/docs/manual/mod/mod_rewrite.html.en
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/docs/manual/mod/mod_rewrite.html.en?view=diff&rev=561800&r1=561799&r2=561800
==============================================================================
--- httpd/httpd/branches/2.2.x/docs/manual/mod/mod_rewrite.html.en (original)
+++ httpd/httpd/branches/2.2.x/docs/manual/mod/mod_rewrite.html.en Wed Aug  1 07:00:42 2007
@@ -69,6 +69,7 @@
 <ul id="topics">
 <li><img alt="" src="../images/down.gif" /> <a href="#quoting">Quoting Special Characters</a></li>
 <li><img alt="" src="../images/down.gif" /> <a href="#EnvVar">Environment Variables</a></li>
+<li><img alt="" src="../images/down.gif" /> <a href="#vhosts">Rewriting in Virtual Hosts</a></li>
 <li><img alt="" src="../images/down.gif" /> <a href="#Solutions">Practical Solutions</a></li>
 </ul></div>
 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
@@ -110,6 +111,19 @@
 
 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
 <div class="section">
+<h2><a name="vhosts" id="vhosts">Rewriting in Virtual Hosts</a></h2>
+
+     <p>By default, <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> configuration
+     settings from the main server context are not inherited by
+     virtual hosts. To make the main server settings apply to virtual
+     hosts, you must place the following directives in each <code class="directive"><a href="../mod/core.html#virtualhost">&lt;VirtualHost&gt;</a></code> section:</p>
+
+     <div class="example"><p><code>
+     RewriteEngine On<br />
+     RewriteOptions Inherit
+     </code></p></div>
+</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
+<div class="section">
 <h2><a name="Solutions" id="Solutions">Practical Solutions</a></h2>
 
     <p>For numerous examples of common, and not-so-common, uses for
@@ -634,10 +648,10 @@
       <p>Use this directive to disable the module instead of
       commenting out all the <code class="directive"><a href="#rewriterule">RewriteRule</a></code> directives!</p>
 
-      <p>Note that, by default, rewrite configurations are not
-      inherited. This means that you need to have a
+      <p>Note that rewrite configurations are not
+      inherited by virtual hosts. This means that you need to have a
       <code>RewriteEngine on</code> directive for each virtual host
-      in which you wish to use it.</p>
+      in which you wish to use rewrite rules.</p>
 
 </div>
 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
@@ -1344,6 +1358,10 @@
           URL-to-filename translators</strong>. The typical example
           is the use of <code class="module"><a href="../mod/mod_alias.html">mod_alias</a></code> and
           <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>.</p>
+
+          <p>The <code>PT</code> flag implies the <code>L</code> flag:
+          rewriting will be stopped in order to pass the request to
+          the next phase of processing.</p>
         </li>
 
         <li>'<strong><code>qsappend|QSA</code></strong>'

Modified: httpd/httpd/branches/2.2.x/docs/manual/mod/mod_rewrite.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/docs/manual/mod/mod_rewrite.xml?view=diff&rev=561800&r1=561799&r2=561800
==============================================================================
--- httpd/httpd/branches/2.2.x/docs/manual/mod/mod_rewrite.xml (original)
+++ httpd/httpd/branches/2.2.x/docs/manual/mod/mod_rewrite.xml Wed Aug  1 07:00:42 2007
@@ -95,6 +95,20 @@
 
 </section>
 
+<section id="vhosts"><title>Rewriting in Virtual Hosts</title>
+
+     <p>By default, <module>mod_rewrite</module> configuration
+     settings from the main server context are not inherited by
+     virtual hosts. To make the main server settings apply to virtual
+     hosts, you must place the following directives in each <directive
+     module="core" type="section">VirtualHost</directive> section:</p>
+
+     <example>
+     RewriteEngine On<br />
+     RewriteOptions Inherit
+     </example>
+</section>
+
 <section id="Solutions"><title>Practical Solutions</title>
 
     <p>For numerous examples of common, and not-so-common, uses for
@@ -126,10 +140,10 @@
       commenting out all the <directive
       module="mod_rewrite">RewriteRule</directive> directives!</p>
 
-      <p>Note that, by default, rewrite configurations are not
-      inherited. This means that you need to have a
+      <p>Note that rewrite configurations are not
+      inherited by virtual hosts. This means that you need to have a
       <code>RewriteEngine on</code> directive for each virtual host
-      in which you wish to use it.</p>
+      in which you wish to use rewrite rules.</p>
 </usage>
 
 </directivesynopsis>
@@ -1361,6 +1375,10 @@
           URL-to-filename translators</strong>. The typical example
           is the use of <module>mod_alias</module> and
           <module>mod_rewrite</module>.</p>
+
+          <p>The <code>PT</code> flag implies the <code>L</code> flag:
+          rewriting will be stopped in order to pass the request to
+          the next phase of processing.</p>
         </li>
 
         <li>'<strong><code>qsappend|QSA</code></strong>'

Modified: httpd/httpd/branches/2.2.x/docs/manual/programs/httpd.html.en
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/docs/manual/programs/httpd.html.en?view=diff&rev=561800&r1=561799&r2=561800
==============================================================================
--- httpd/httpd/branches/2.2.x/docs/manual/programs/httpd.html.en (original)
+++ httpd/httpd/branches/2.2.x/docs/manual/programs/httpd.html.en Wed Aug  1 07:00:42 2007
@@ -94,8 +94,11 @@
 
 <dd>Sets a configuration <var>parameter </var>which can be used with
 <code class="directive"><a href="../mod/core.html#ifdefine">&lt;IfDefine&gt;</a></code> sections
-in the configuration files to conditionally skip or process
-commands at server startup and restart.</dd>
+in the configuration files to conditionally skip or process commands
+at server startup and restart. Also can be used to set certain
+less-common startup parameters including <code>-DNO_DETACH</code>
+(prevent the parent from forking) and <code>-DFOREGROUND</code>
+(prevent the parent from calling <code>setsid()</code> et al).</dd>
 
 <dt><code>-e <var>level</var></code></dt>
 

Modified: httpd/httpd/branches/2.2.x/docs/manual/programs/httpd.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/docs/manual/programs/httpd.xml?view=diff&rev=561800&r1=561799&r2=561800
==============================================================================
--- httpd/httpd/branches/2.2.x/docs/manual/programs/httpd.xml (original)
+++ httpd/httpd/branches/2.2.x/docs/manual/programs/httpd.xml Wed Aug  1 07:00:42 2007
@@ -105,8 +105,11 @@
 
 <dd>Sets a configuration <var>parameter </var>which can be used with
 <directive type="section" module="core">IfDefine</directive> sections
-in the configuration files to conditionally skip or process
-commands at server startup and restart.</dd>
+in the configuration files to conditionally skip or process commands
+at server startup and restart. Also can be used to set certain
+less-common startup parameters including <code>-DNO_DETACH</code>
+(prevent the parent from forking) and <code>-DFOREGROUND</code>
+(prevent the parent from calling <code>setsid()</code> et al).</dd>
 
 <dt><code>-e <var>level</var></code></dt>