Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.arcetri.astro.it/manual/en/mod/mod_macro.html
Дата изменения: Fri Nov 20 00:43:56 2015
Дата индексирования: Sun Apr 10 06:23:28 2016
Кодировка:

Поисковые слова: р п р п р п р п р п р п р п р п р п р п р п р п
mod_macro - Apache HTTP Server
<-
Apache > HTTP Server > Documentation > Version 2.4 > Modules

Apache Module mod_macro

Available Languages:  en  |  fr 

Description:This module provides usage of macros within apache runtime configuration files
Status:Base
Module Identifier:macro_module
Source File:mod_macro.c
Compatibility:Available in Apache HTTPD 2.4.5 and later

Summary

This modules provides macros within apache runtime configuration files. These macros have parameters. They are expanded when used (parameters are substituted by their values given as an argument), and the result is processed normally.

Directives

Topics

top

Features

Definition of a macro:

Use of a macro:

Removal of a macro definition:

<Macro DirGroup $dir $group>
  <Directory $dir>
    require group $group
  </Directory>
</Macro>

Use DirGroup /www/apache/private private
Use DirGroup /www/apache/server  admin

UndefMacro DirGroup
    
top

<Macro> Directive

Description:Define a configuration file macro
Syntax: <Macro name [par1 .. parN]> ... </Macro>
Context:server config, virtual host, directory
Status:Base
Module:mod_macro

The Macro directive controls the definition of a macro within the server runtime configuration files. The first argument is the name of the macro. Other arguments are parameters to the macro. It is good practice to prefix parameter names with any of '$%@', and not macro names with such characters.

<Macro LocalAccessPolicy>
  order deny,allow
  deny from all
  allow from 10.2.16.0/24
</Macro>

<Macro RestrictedAccessPolicy $ipnumbers>
   order deny,allow
   deny from all
   allow from $ipnumbers
</Macro>
    
top

undefMacro Directive

Description:Undefine a macro
Syntax:UndefMacro name
Context:server config, virtual host, directory
Status:Base
Module:mod_macro

The UndefMacro directive undefines a macro which has been defined before hand.

UndefMacro LocalAccessPolicy
UndefMacro RestrictedAccessPolicy
    
top

Use Directive

Description:Use a macro
Syntax:Use name [value1 ... valueN]
Context:server config, virtual host, directory
Status:Base
Module:mod_macro

The Use 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 associated to their corresponding initial parameters and are substituted before processing.

Use LocalAccessPolicy
...
Use RestrictedAccessPolicy "192.54.172.0/24 192.54.148.0/24"
    

is equivalent, with the macros defined above, to:

order deny,allow
deny from all
allow from 10.2.16.0/24
...
order deny,allow
deny from all
allow from 192.54.172.0/24 192.54.148.0/24
    

Available Languages:  en  |  fr 

top

Comments

Notice:
This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our mailing lists.