+ + ++ + + diff -Nru apache_1.3.20/src/ap/ap_ctx.c apache_1.3.20.new/src/ap/ap_ctx.c --- apache_1.3.20/src/ap/ap_ctx.c Thu Jan 1 01:00:00 1970 +++ apache_1.3.20.new/src/ap/ap_ctx.c Thu Dec 30 22:02:56 1999 @@ -0,0 +1,155 @@ +/* ==================================================================== + * Copyright (c) 1998-2000 The Apache Group. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the Apache Group + * for use in the Apache HTTP server project (http://www.apache.org/)." + * + * 4. The names "Apache Server" and "Apache Group" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Group. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the Apache Group + * for use in the Apache HTTP server project (http://www.apache.org/)." + * + * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Group and was originally based + * on public domain software written at the National Center for + * Supercomputing Applications, University of Illinois, Urbana-Champaign. + * For more information on the Apache Group and the Apache HTTP server + * project, please see
+Module mod_define
+Variable Definition For Arbitrary Directives
+ +This module is contained in themod_define.c
file. It provides +the definition variables for arbitrary directives, i.e. variables which can be +expanded on any(!) directive line. It needs Extended API (EAPI). It is not +compiled into the server by default. To usemod_define
you have +to enable the following line in the server buildConfiguration
+file: + ++
+ AddModule modules/extra/mod_define.o ++ ++
+ +Define
+Syntax: +Define
variable value
+Default: + none
+Context: + server config, virtual host, directory, .htaccess
+Override: none
+Status: Extension
+Module: mod_define.c
+Compatibility: Apache+EAPI
+ ++The
Define
directive defines a variable which later can be +expanded with the unsafe but short construct +``$
variable'' or the safe but longer construct +``${
variable}
'' on any configuration line. +Do not intermix this with the third-party modulemod_macro
. The +mod_define
module doesn't provide a general macro mechanism, +although one can consider variable substitutions as a special form of macros. +Because the value of to which ``$
variable'' expands has +to fit into one line. When you need macros which can span more lines, you've +to usemod_macro
. OTOHmod_macro
cannot be used to +expand a variable/macro on an arbitrary directive line. So, the typical use +case ofmod_define
is to make strings variable (and this +way easily changeable at one location) and not to bundle things +together (as it's the typical use case for macros). + ++The syntax of the expansion construct ( +``
${
variable}
'') follows the Perl and Shell +syntax, but can be changed via theDefine
directive, too. Four +internal variables can be used for this. The default is: + +++ ++Define mod_define::escape "\\" +Define mod_define::dollar "$" +Define mod_define::open "{" +Define mod_define::close "}" +++When you need to escape some of the expansion constructs you place the +mod_define::escape character in front of it. The default is the backslash as +in Perl or the Shell. + +
+Example: +
++ + ++Define master "Joe Average <joe@average.dom>" +Define docroot /usr/local/apache/htdocs +Define hostname foo +Define domainname bar.dom +Define portnumber 80 + : +<VirtualHost $hostname.$domainname:$portnumber> +SetEnv SERVER_MASTER "$master" +ServerName $hostname.$domainname +ServerAlias $hostname +Port $portnumber +DocumentRoot $docroot +<Directory $docroot> + : +<Directory> ++