diff options
author | Stefan Fritsch <sf@sfritsch.de> | 2014-03-29 21:56:19 +0100 |
---|---|---|
committer | Stefan Fritsch <sf@sfritsch.de> | 2014-03-29 21:56:45 +0100 |
commit | 2a463b3cd73c32ee9dcd508248d0194923f435f4 (patch) | |
tree | 2ff478255a77a55031056790918b6f983bb7b20a /docs/manual/mod/mod_macro.html.en | |
parent | 86d5cc79d9d6750da8771fdb0c9ab22c19b8ad45 (diff) | |
download | apache2-upstream/2.4.9.tar.gz |
Imported Upstream version 2.4.9upstream/2.4.9
Diffstat (limited to 'docs/manual/mod/mod_macro.html.en')
-rw-r--r-- | docs/manual/mod/mod_macro.html.en | 62 |
1 files changed, 22 insertions, 40 deletions
diff --git a/docs/manual/mod/mod_macro.html.en b/docs/manual/mod/mod_macro.html.en index 5a4cd92e..cab91739 100644 --- a/docs/manual/mod/mod_macro.html.en +++ b/docs/manual/mod/mod_macro.html.en @@ -9,7 +9,7 @@ <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" /> -<script src="../style/scripts/prettify.js" type="text/javascript"> +<script src="../style/scripts/prettify.min.js" type="text/javascript"> </script> <link href="../images/favicon.ico" rel="shortcut icon" /></head> @@ -64,8 +64,7 @@ for those parts that will need to be substituted.</p> <p>For example, you might use a macro to define a <code class="directive"><VirtualHost></code> block, in order to define multiple similar virtual hosts:</p> -<pre class="prettyprint lang-config"> -<Macro VHost $name $domain> +<pre class="prettyprint lang-config"><Macro VHost $name $domain> <VirtualHost *:80> ServerName $domain ServerAlias www.$domain @@ -74,8 +73,7 @@ multiple similar virtual hosts:</p> ErrorLog /var/log/httpd/$name.error_log CustomLog /var/log/httpd/$name.access_log combined </VirtualHost> -</Macro> -</pre> +</Macro></pre> <p>Macro names are case-insensitive, like httpd configuration @@ -84,13 +82,11 @@ directives. However, variable names are case sensitive.</p> <p>You would then invoke this macro several times to create virtual hosts:</p> -<pre class="prettyprint lang-config"> -Use VHost example example.com +<pre class="prettyprint lang-config">Use VHost example example.com Use VHost myhost hostname.org Use VHost apache apache.org -UndefMacro VHost -</pre> +UndefMacro VHost</pre> <p>At server startup time, each of these <code class="directive">Use</code> @@ -110,7 +106,7 @@ Examples section.</p> <p>Parameter names should begin with a sigil such as <code>$</code>, <code>%</code>, or <code>@</code>, so that they are clearly -identifiable, and also in order to help deail with interactions with +identifiable, and also in order to help deal with interactions with other directives, such as the core <code class="directive"><a href="../mod/core.html#define">Define</a></code> directive. Failure to do so will result in a warning. Nevertheless, you are encouraged to have a good knowledge of your entire server configuration in order to avoid reusing @@ -128,11 +124,9 @@ confusion, the longest possible parameter name is used.</p> <p>If you want to use a value within another string, it is useful to surround the parameter in braces, to avoid confusion:</p> -<pre class="prettyprint lang-config"> -<Macro DocRoot ${docroot}> +<pre class="prettyprint lang-config"><Macro DocRoot ${docroot}> DocumentRoot /var/www/${docroot}/htdocs -</Macro> -</pre> +</Macro></pre> </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> @@ -146,8 +140,7 @@ surround the parameter in braces, to avoid confusion:</p> <p>A common usage of <code class="module"><a href="../mod/mod_macro.html">mod_macro</a></code> is for the creation of dynamically-generated virtual hosts.</p> -<pre class="prettyprint lang-config"> -## Define a VHost Macro for repetitive configurations +<pre class="prettyprint lang-config">## Define a VHost Macro for repetitive configurations <Macro VHost $host $port $dir> Listen $port @@ -172,8 +165,7 @@ dynamically-generated virtual hosts.</p> Use VHost www.apache.org 80 /vhosts/apache/htdocs Use VHost example.org 8080 /vhosts/example/htdocs -Use VHost www.example.fr 1234 /vhosts/example.fr/htdocs -</pre> +Use VHost www.example.fr 1234 /vhosts/example.fr/htdocs</pre> @@ -184,8 +176,7 @@ Use VHost www.example.fr 1234 /vhosts/example.fr/htdocs avoids confusion in a complex configuration file where there may be conflicts in variable names.</p> -<pre class="prettyprint lang-config"> -<Macro DirGroup $dir $group> +<pre class="prettyprint lang-config"><Macro DirGroup $dir $group> <Directory $dir> Require group $group </Directory> @@ -194,8 +185,7 @@ conflicts in variable names.</p> Use DirGroup /www/apache/private private Use DirGroup /www/apache/server admin -UndefMacro DirGroup -</pre> +UndefMacro DirGroup</pre> @@ -220,15 +210,13 @@ UndefMacro DirGroup with such characters. </p> - <pre class="prettyprint lang-config"> -<Macro LocalAccessPolicy> + <pre class="prettyprint lang-config"><Macro LocalAccessPolicy> Require ip 10.2.16.0/24 </Macro> <Macro RestrictedAccessPolicy $ipnumbers> Require ip $ipnumbers -</Macro> - </pre> +</Macro></pre> </div> @@ -244,10 +232,8 @@ UndefMacro DirGroup <p>The <code class="directive">UndefMacro</code> directive undefines a macro which has been defined before hand.</p> - <pre class="prettyprint lang-config"> -UndefMacro LocalAccessPolicy -UndefMacro RestrictedAccessPolicy - </pre> + <pre class="prettyprint lang-config">UndefMacro LocalAccessPolicy +UndefMacro RestrictedAccessPolicy</pre> </div> @@ -263,24 +249,20 @@ UndefMacro RestrictedAccessPolicy </table> <p>The <code class="directive">Use</code> directive controls the use of a macro. The specified macro is expanded. It must be given the same number of - arguments than in the macro definition. The provided values are + arguments as in the macro definition. The provided values are associated to their corresponding initial parameters and are substituted before processing.</p> - <pre class="prettyprint lang-config"> -Use LocalAccessPolicy + <pre class="prettyprint lang-config">Use LocalAccessPolicy ... -Use RestrictedAccessPolicy "192.54.172.0/24 192.54.148.0/24" - </pre> +Use RestrictedAccessPolicy "192.54.172.0/24 192.54.148.0/24"</pre> <p>is equivalent, with the macros defined above, to:</p> - <pre class="prettyprint lang-config"> -Require ip 10.2.16.0/24 + <pre class="prettyprint lang-config">Require ip 10.2.16.0/24 ... -Require ip 192.54.172.0/24 192.54.148.0/24 - </pre> +Require ip 192.54.172.0/24 192.54.148.0/24</pre> </div> @@ -306,7 +288,7 @@ var comments_identifier = 'http://httpd.apache.org/docs/2.4/mod/mod_macro.html'; } })(window, document); //--><!]]></script></div><div id="footer"> -<p class="apache">Copyright 2013 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> +<p class="apache">Copyright 2014 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- if (typeof(prettyPrint) !== 'undefined') { prettyPrint(); |