mod_vhost_alias.c revision 404e2e1f8ad30c2d996f5fb6b3a9a4a4a14a004b
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering/* ====================================================================
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * The Apache Software License, Version 1.1
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * Copyright (c) 2000 The Apache Software Foundation. All rights
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * Redistribution and use in source and binary forms, with or without
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * modification, are permitted provided that the following conditions
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * 1. Redistributions of source code must retain the above copyright
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * notice, this list of conditions and the following disclaimer.
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * 2. Redistributions in binary form must reproduce the above copyright
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * notice, this list of conditions and the following disclaimer in
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * the documentation and/or other materials provided with the
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * distribution.
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * 3. The end-user documentation included with the redistribution,
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * if any, must include the following acknowledgment:
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * "This product includes software developed by the
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * Apache Software Foundation (http://www.apache.org/)."
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * Alternately, this acknowledgment may appear in the software itself,
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * if and wherever such third-party acknowledgments normally appear.
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * 4. The names "Apache" and "Apache Software Foundation" must
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * not be used to endorse or promote products derived from this
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * software without prior written permission. For written
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * permission, please contact apache@apache.org.
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * 5. Products derived from this software may not be called "Apache",
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * nor may "Apache" appear in their name, without prior written
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * permission of the Apache Software Foundation.
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * SUCH DAMAGE.
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * ====================================================================
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * This software consists of voluntary contributions made by many
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * individuals on behalf of the Apache Software Foundation. For more
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * information on the Apache Software Foundation, please see
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * Portions of this software are based upon public domain software
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * originally written at the National Center for Supercomputing Applications,
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * University of Illinois, Urbana-Champaign.
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * mod_vhost_alias.c: support for dynamically configured mass virtual hosting
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * Copyright (c) 1998-1999 Demon Internet Ltd.
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * This software was submitted by Demon Internet to the Apache Software Foundation
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * in May 1999. Future revisions and derivatives of this source code
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * must acknowledge Demon Internet as the original contributor of
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * this module. All other licensing and usage conditions are those
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * of the Apache Software Foundation.
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * Originally written by Tony Finch <fanf@demon.net> <dot@dotat.at>.
* Implementation ideas were taken from mod_alias.c. The overall
* concept is derived from the OVERRIDE_DOC_ROOT/OVERRIDE_CGIDIR
#include "httpd.h"
#include "http_config.h"
#include "http_core.h"
} mva_mode_e;
typedef struct mva_sconf_t {
char *doc_root;
char *cgi_root;
} mva_sconf_t;
return conf;
return conf;
static int vhost_alias_set_doc_root_ip,
char **pmap;
return NULL;
p = map;
if (ap_isdigit(*p)) {
if (ap_isdigit(*p)) {
return NULL;
{ NULL }
if (r->filename) {
int ndots;
ndots = 0;
for (p = name; *p; ++p){
while (*map) {
++map;
++map;
++map;
++map;
if (N > ndots) {
else if (!Nd) {
if (!Np) {
if (!Np) {
else if (!Md) {
if (!Mp) {
if (!Mp) {
++uri;
if (r->filename) {
int cgi;
cgi = 0;
return DECLINED;
return DECLINED;
if (cgi) {
return OK;
static void register_hooks(void)