You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by sf...@apache.org on 2011/01/20 20:17:38 UTC

svn commit: r1061468 - in /httpd/httpd/trunk/docs/manual/mod: core.html.en core.xml

Author: sf
Date: Thu Jan 20 19:17:38 2011
New Revision: 1061468

URL: http://svn.apache.org/viewvc?rev=1061468&view=rev
Log:
Update docs for changed Define syntax

Modified:
    httpd/httpd/trunk/docs/manual/mod/core.html.en
    httpd/httpd/trunk/docs/manual/mod/core.xml

Modified: httpd/httpd/trunk/docs/manual/mod/core.html.en
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/core.html.en?rev=1061468&r1=1061467&r2=1061468&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/core.html.en (original)
+++ httpd/httpd/trunk/docs/manual/mod/core.html.en Thu Jan 20 19:17:38 2011
@@ -593,15 +593,33 @@ which no other media type configuration 
 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
 <div class="directive-section"><h2><a name="Define" id="Define">Define</a> <a name="define" id="define">Directive</a></h2>
 <table class="directive">
-<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Define the existence of a variable</td></tr>
-<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Define <var>parameter-name</var></code></td></tr>
-<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
+<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Define a variable</td></tr>
+<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Define <var>parameter-name</var> [<var>parameter-value</var>]</code></td></tr>
+<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
 </table>
-    <p>Equivalent to passing the <code>-D</code> argument to <code class="program"><a href="../programs/httpd.html">httpd</a></code>.</p>
-    <p>This directive can be used to toggle the use of <code class="directive"><a href="#ifdefine">&lt;IfDefine&gt;</a></code> sections without needing to alter
-    <code>-D</code> arguments in any startup scripts.</p>
+    <p>In its one parameter form, <code class="directive">Define</code> is equivalent
+    to passing the <code>-D</code> argument to <code class="program"><a href="../programs/httpd.html">httpd</a></code>. It
+    can be used to toggle the use of
+    <code class="directive"><a href="#ifdefine">&lt;IfDefine&gt;</a></code> sections
+    without needing to alter <code>-D</code> arguments in any startup
+    scripts.</p>
+
+    <p>In addition to that, if the second parameter is given, a config variable
+    is set to this value. The variable can be used in the configuration using
+    the <code>${VAR}</code> syntax. The variable is always globally defined
+    and not limited to the scope of the surrounding config section.</p>
+
+    <div class="example"><p><code>
+      &lt;IfDefine TEST&gt;<br />
+      &nbsp;&nbsp;Define servername test.example.com<br />
+      &lt;/IfDefine&gt;<br />
+      &lt;IfDefine !TEST&gt;<br />
+      &nbsp;&nbsp;Define servername www.example.com<br />
+      &nbsp;&nbsp;Define SSL<br />
+      &lt;/IfDefine&gt;<br />
+    </code></p></div>
 
 </div>
 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>

Modified: httpd/httpd/trunk/docs/manual/mod/core.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/core.xml?rev=1061468&r1=1061467&r2=1061468&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/core.xml (original)
+++ httpd/httpd/trunk/docs/manual/mod/core.xml Thu Jan 20 19:17:38 2011
@@ -538,16 +538,33 @@ which no other media type configuration 
 
 <directivesynopsis>
 <name>Define</name>
-<description>Define the existence of a variable</description>
-<syntax>Define <var>parameter-name</var></syntax>
-<contextlist><context>server config</context></contextlist>
+<description>Define a variable</description>
+<syntax>Define <var>parameter-name</var> [<var>parameter-value</var>]</syntax>
+<contextlist><context>server config</context><context>virtual host</context>
+<context>directory</context></contextlist>
 
 <usage>
-    <p>Equivalent to passing the <code>-D</code> argument to <program
-    >httpd</program>.</p>
-    <p>This directive can be used to toggle the use of <directive module="core"
-    type="section">IfDefine</directive> sections without needing to alter
-    <code>-D</code> arguments in any startup scripts.</p>
+    <p>In its one parameter form, <directive>Define</directive> is equivalent
+    to passing the <code>-D</code> argument to <program>httpd</program>. It
+    can be used to toggle the use of
+    <directive module="core" type="section">IfDefine</directive> sections
+    without needing to alter <code>-D</code> arguments in any startup
+    scripts.</p>
+
+    <p>In addition to that, if the second parameter is given, a config variable
+    is set to this value. The variable can be used in the configuration using
+    the <code>${VAR}</code> syntax. The variable is always globally defined
+    and not limited to the scope of the surrounding config section.</p>
+
+    <example>
+      &lt;IfDefine TEST&gt;<br/>
+      &nbsp;&nbsp;Define servername test.example.com<br/>
+      &lt;/IfDefine&gt;<br/>
+      &lt;IfDefine !TEST&gt;<br/>
+      &nbsp;&nbsp;Define servername www.example.com<br/>
+      &nbsp;&nbsp;Define SSL<br/>
+      &lt;/IfDefine&gt;<br/>
+    </example>
 </usage>
 </directivesynopsis>