main.c revision 886cd69ebf69e990dbc365be87ff8ea7cd681904
842ae4bd224140319ae7feec1872b93dfd491143fielding/* ====================================================================
842ae4bd224140319ae7feec1872b93dfd491143fielding * The Apache Software License, Version 1.1
842ae4bd224140319ae7feec1872b93dfd491143fielding *
842ae4bd224140319ae7feec1872b93dfd491143fielding * Copyright (c) 2000 The Apache Software Foundation. All rights
842ae4bd224140319ae7feec1872b93dfd491143fielding * reserved.
842ae4bd224140319ae7feec1872b93dfd491143fielding *
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * Redistribution and use in source and binary forms, with or without
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * modification, are permitted provided that the following conditions
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * are met:
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes *
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * 1. Redistributions of source code must retain the above copyright
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * notice, this list of conditions and the following disclaimer.
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes *
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * 2. Redistributions in binary form must reproduce the above copyright
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * notice, this list of conditions and the following disclaimer in
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * the documentation and/or other materials provided with the
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * distribution.
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes *
e8f95a682820a599fe41b22977010636be5c2717jim * 3. The end-user documentation included with the redistribution,
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * if any, must include the following acknowledgment:
e8f95a682820a599fe41b22977010636be5c2717jim * "This product includes software developed by the
1747d30b98aa1bdbc43994c02cd46ab4cb9319e4fielding * Apache Software Foundation (http://www.apache.org/)."
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * Alternately, this acknowledgment may appear in the software itself,
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * if and wherever such third-party acknowledgments normally appear.
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes *
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * 4. The names "Apache" and "Apache Software Foundation" must
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * not be used to endorse or promote products derived from this
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * software without prior written permission. For written
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * permission, please contact apache@apache.org.
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes *
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * 5. Products derived from this software may not be called "Apache",
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * nor may "Apache" appear in their name, without prior written
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * permission of the Apache Software Foundation.
5c0419d51818eb02045cf923a9fe456127a44c60wrowe *
5c0419d51818eb02045cf923a9fe456127a44c60wrowe * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
d266c3777146d36a4c23c17aad6f153aebea1bf4jorton * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
d266c3777146d36a4c23c17aad6f153aebea1bf4jorton * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
d266c3777146d36a4c23c17aad6f153aebea1bf4jorton * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
d266c3777146d36a4c23c17aad6f153aebea1bf4jorton * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * SUCH DAMAGE.
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * ====================================================================
22f8da8087791fcb95b836c8a81937c5a9bba202bnicholes *
22f8da8087791fcb95b836c8a81937c5a9bba202bnicholes * This software consists of voluntary contributions made by many
22f8da8087791fcb95b836c8a81937c5a9bba202bnicholes * individuals on behalf of the Apache Software Foundation. For more
22f8da8087791fcb95b836c8a81937c5a9bba202bnicholes * information on the Apache Software Foundation, please see
22f8da8087791fcb95b836c8a81937c5a9bba202bnicholes * <http://www.apache.org/>.
22f8da8087791fcb95b836c8a81937c5a9bba202bnicholes *
22f8da8087791fcb95b836c8a81937c5a9bba202bnicholes * Portions of this software are based upon public domain software
cd3bbd6d2df78d6c75e5d159a81ef8bdd5f70df9trawick * originally written at the National Center for Supercomputing Applications,
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * University of Illinois, Urbana-Champaign.
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes */
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
0568280364eb026393be492ebc732795c4934643jorton#include "apr.h"
0568280364eb026393be492ebc732795c4934643jorton#include "apr_strings.h"
0568280364eb026393be492ebc732795c4934643jorton#include "apr_getopt.h"
0568280364eb026393be492ebc732795c4934643jorton#include "apr_general.h"
0568280364eb026393be492ebc732795c4934643jorton
0568280364eb026393be492ebc732795c4934643jorton#if APR_HAVE_STDIO_H
0568280364eb026393be492ebc732795c4934643jorton#include <stdio.h>
0568280364eb026393be492ebc732795c4934643jorton#endif
0568280364eb026393be492ebc732795c4934643jorton
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#define CORE_PRIVATE
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener#include "ap_config.h"
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener#include "httpd.h"
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#include "http_main.h"
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#include "http_log.h"
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#include "http_config.h"
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#include "http_vhost.h"
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#include "util_uri.h"
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#include "util_ebcdic.h"
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#include "ap_mpm.h"
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
796e4a7141265d8ed7036e4628161c6eafb2a789jorton/* WARNING: Win32 binds http_main.c dynamically to the server. Please place
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * extern functions and global data in another appropriate module.
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes *
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes * Most significant main() global data can be found in http_config.c
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes */
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes/* XXX - We should be able to grab the per-MPM settings here too */
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesstatic void show_compile_settings(void)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes{
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes printf("Server version: %s\n", ap_get_server_version());
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes printf("Server built: %s\n", ap_get_server_built());
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes printf("Server's Module Magic Number: %u:%u\n",
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes MODULE_MAGIC_NUMBER_MAJOR, MODULE_MAGIC_NUMBER_MINOR);
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes printf("Server compiled with....\n");
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#ifdef BIG_SECURITY_HOLE
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes printf(" -D BIG_SECURITY_HOLE\n");
8113dac419143273351446c3ad653f3fe5ba5cfdwrowe#endif
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#ifdef SECURITY_HOLE_PASS_AUTHORIZATION
482f676c6c19b1c5bb5cca04dad11509c1da3a4cwrowe printf(" -D SECURITY_HOLE_PASS_AUTHORIZATION\n");
e8f95a682820a599fe41b22977010636be5c2717jim#endif
482f676c6c19b1c5bb5cca04dad11509c1da3a4cwrowe#ifdef APR_HAS_MMAP
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes printf(" -D HAVE_MMAP\n");
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#endif
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#ifdef HAVE_SHMGET
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes printf(" -D HAVE_SHMGET\n");
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#endif
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#ifdef AP_USE_FILE_BASED_SCOREBOARD
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes printf(" -D AP_USE_FILE_BASED_SCOREBOARD\n");
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#endif
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#ifdef AP_USE_MEM_BASED_SCOREBOARD
a1790fb35c4b352dab721370985c623a9f8f5062rpluem printf(" -D AP_USE_MEM_BASED_SCOREBOARD\n");
713a2b68bac4aeb1e9c48785006c0732451039depquerna#endif
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#ifdef AP_USE_MMAP_FILES
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes printf(" -D AP_USE_MMAP_FILES\n");
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#ifdef MMAP_SEGMENT_SIZE
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes printf(" -D MMAP_SEGMENT_SIZE=%ld\n",(long)MMAP_SEGMENT_SIZE);
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#endif
482f676c6c19b1c5bb5cca04dad11509c1da3a4cwrowe#endif /*AP_USE_MMAP_FILES*/
482f676c6c19b1c5bb5cca04dad11509c1da3a4cwrowe#ifdef NO_WRITEV
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes printf(" -D NO_WRITEV\n");
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#endif
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#ifdef NO_LINGCLOSE
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes printf(" -D NO_LINGCLOSE\n");
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#endif
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#if APR_HAVE_IPV6
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes printf(" -D APR_HAVE_IPV6\n");
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#endif
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener#if APR_USE_FLOCK_SERIALIZE
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes printf(" -D APR_USE_FLOCK_SERIALIZE\n");
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#endif
f43b67c5a9d29b572eac916f8335cedc80c908bebnicholes#if APR_USE_SYSVSEM_SERIALIZE
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes printf(" -D APR_USE_SYSVSEM_SERIALIZE\n");
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#endif
8113dac419143273351446c3ad653f3fe5ba5cfdwrowe#if APR_USE_FCNTL_SERIALIZE
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes printf(" -D APR_USE_FCNTL_SERIALIZE\n");
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#endif
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#if APR_USE_PROC_PTHREAD_SERIALIZE
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes printf(" -D APR_USE_PROC_PTHREAD_SERIALIZE\n");
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#endif
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#if APR_USE_PTHREAD_SERIALIZE
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes printf(" -D APR_USE_PTHREAD_SERIALIZE\n");
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#endif
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#if APR_PROCESS_LOCK_IS_GLOBAL
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes printf(" -D APR_PROCESS_LOCK_IS_GLOBAL\n");
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#endif
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#ifdef SINGLE_LISTEN_UNSERIALIZED_ACCEPT
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes printf(" -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT\n");
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener#endif
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener#if APR_HAS_OTHER_CHILD
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener printf(" -D APR_HAS_OTHER_CHILD\n");
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener#endif
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener#ifdef AP_HAVE_RELIABLE_PIPED_LOGS
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes printf(" -D AP_HAVE_RELIABLE_PIPED_LOGS\n");
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener#endif
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#ifdef BUFFERED_LOGS
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener printf(" -D BUFFERED_LOGS\n");
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#ifdef PIPE_BUF
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes printf(" -D PIPE_BUF=%ld\n",(long)PIPE_BUF);
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#endif
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#endif
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#ifdef AP_CHARSET_EBCDIC
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes printf(" -D AP_CHARSET_EBCDIC\n");
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener#endif
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#ifdef APACHE_XLATE
8113dac419143273351446c3ad653f3fe5ba5cfdwrowe printf(" -D APACHE_XLATE\n");
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#endif
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#ifdef NEED_HASHBANG_EMUL
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes printf(" -D NEED_HASHBANG_EMUL\n");
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#endif
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#ifdef SHARED_CORE
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes printf(" -D SHARED_CORE\n");
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#endif
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes/* This list displays the compiled in default paths: */
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#ifdef HTTPD_ROOT
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes printf(" -D HTTPD_ROOT=\"" HTTPD_ROOT "\"\n");
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#endif
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#ifdef SUEXEC_BIN
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes printf(" -D SUEXEC_BIN=\"" SUEXEC_BIN "\"\n");
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#endif
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#if defined(SHARED_CORE) && defined(SHARED_CORE_DIR)
1f299703465bd9975d94e9f229f76af807442de2covener printf(" -D SHARED_CORE_DIR=\"" SHARED_CORE_DIR "\"\n");
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener#endif
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener#ifdef DEFAULT_PIDLOG
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener printf(" -D DEFAULT_PIDLOG=\"" DEFAULT_PIDLOG "\"\n");
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#endif
8113dac419143273351446c3ad653f3fe5ba5cfdwrowe#ifdef DEFAULT_SCOREBOARD
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes printf(" -D DEFAULT_SCOREBOARD=\"" DEFAULT_SCOREBOARD "\"\n");
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#endif
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#ifdef DEFAULT_LOCKFILE
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes printf(" -D DEFAULT_LOCKFILE=\"" DEFAULT_LOCKFILE "\"\n");
9ad7b260be233be7d7b5576979825cac72e15498rederpj#endif
9ad7b260be233be7d7b5576979825cac72e15498rederpj#ifdef DEFAULT_XFERLOG
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes printf(" -D DEFAULT_XFERLOG=\"" DEFAULT_XFERLOG "\"\n");
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#endif
f43b67c5a9d29b572eac916f8335cedc80c908bebnicholes#ifdef DEFAULT_ERRORLOG
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes printf(" -D DEFAULT_ERRORLOG=\"" DEFAULT_ERRORLOG "\"\n");
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#endif
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#ifdef TYPES_CONFIG_FILE
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes printf(" -D TYPES_CONFIG_FILE=\"" TYPES_CONFIG_FILE "\"\n");
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#endif
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#ifdef SERVER_CONFIG_FILE
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes printf(" -D SERVER_CONFIG_FILE=\"" SERVER_CONFIG_FILE "\"\n");
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#endif
3e6d7277b90d3011db832139afc20efb5f17e203rederpj}
3e6d7277b90d3011db832139afc20efb5f17e203rederpj
3e6d7277b90d3011db832139afc20efb5f17e203rederpjstatic void destroy_and_exit_process(process_rec *process, int process_exit_value)
3e6d7277b90d3011db832139afc20efb5f17e203rederpj{
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes apr_destroy_pool(process->pool); /* and destroy all descendent pools */
f43b67c5a9d29b572eac916f8335cedc80c908bebnicholes apr_terminate();
e8f95a682820a599fe41b22977010636be5c2717jim exit(process_exit_value);
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener}
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovenerstatic process_rec *create_process(int argc, const char * const *argv)
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener{
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener process_rec *process;
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener apr_pool_t *cntx;
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener apr_status_t stat;
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener stat = apr_create_pool(&cntx, NULL);
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener if (stat != APR_SUCCESS) {
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, NULL,
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener "apr_create_pool() failed to create "
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener "initial context");
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener apr_terminate();
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener exit(1);
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener }
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener process = apr_palloc(cntx, sizeof(process_rec));
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener process->pool = cntx;
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener apr_create_pool(&process->pconf, process->pool);
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener process->argc = argc;
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener process->argv = argv;
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener process->short_name = apr_filename_of_pathname(argv[0]);
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener return process;
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener}
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovenerstatic void usage(process_rec *process)
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener{
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener const char *bin = process->argv[0];
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener char pad[MAX_STRING_LEN];
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener unsigned i;
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener for (i = 0; i < strlen(bin); i++)
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener pad[i] = ' ';
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener pad[i] = '\0';
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#ifdef SHARED_CORE
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0,NULL , "Usage: %s [-R directory] [-D name] [-d directory] [-f file]", bin);
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener#else
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, "Usage: %s [-D name] [-d directory] [-f file]", bin);
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener#endif
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " %s [-C \"directive\"] [-c \"directive\"]", pad);
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener#ifdef WIN32
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " %s [-k restart|shutdown|start]", pad);
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " %s [-n service_name]", pad);
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " %s [-i] [-u]", pad);
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener#endif
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " %s [-v] [-V] [-h] [-l] [-L] [-t] [-T]", pad);
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, "Options:");
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener#ifdef SHARED_CORE
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -R directory : specify an alternate location for shared object files");
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener#endif
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -D name : define a name for use in <IfDefine name> directives");
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -d directory : specify an alternate initial ServerRoot");
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -f file : specify an alternate ServerConfigFile");
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -C \"directive\" : process directive before reading config files");
4e9c24785b525d2956e6e381015c0f2bd0a72f4bcovener ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -c \"directive\" : process directive after reading config files");
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#ifdef WIN32
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -n name : set service name and use its ServerConfigFile");
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -k shutdown : tell running Apache to shutdown");
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -k restart : tell running Apache to do a graceful restart");
0e05808dc59a321566303084c84b9826a4353cefrederpj ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -k start : tell Apache to start");
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -i : install an Apache service");
b08925593f214f621161742925dcf074a8047e0acovener ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -u : uninstall an Apache service");
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#endif
54d22ed1c429b903b029bbd62621f11a9e286137minfrin ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -v : show version number");
465bb68501690d7a47bfd2a6129580047d76d8f1rederpj ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -V : show compile settings");
3dfeb02cfb853d8717ca0cc259b59fea610173f5bnicholes ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -h : list available command line options (this page)");
465bb68501690d7a47bfd2a6129580047d76d8f1rederpj ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -l : list compiled in modules");
e8f95a682820a599fe41b22977010636be5c2717jim ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -L : list available configuration directives");
3dfeb02cfb853d8717ca0cc259b59fea610173f5bnicholes ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -t -D DUMP_VHOSTS : show parsed settings (currently only vhost settings)");
3dfeb02cfb853d8717ca0cc259b59fea610173f5bnicholes ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -t : run syntax check for config files (with docroot check)");
54d22ed1c429b903b029bbd62621f11a9e286137minfrin ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -T : run syntax check for config files (without docroot check)");
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes /* TODOC: -X goes away, expect MPMs to use -D options */
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes destroy_and_exit_process(process, 1);
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes}
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholesint main(int argc, const char * const argv[])
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes{
ebe5305f8b22507374358f32b74d12fb50c05a25covener char c;
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes int configtestonly = 0;
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes const char *confname = SERVER_CONFIG_FILE;
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes const char *def_server_root = HTTPD_ROOT;
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes process_rec *process;
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes server_rec *server_conf;
513b324e774c559b579896df131fd7c8471ed529rederpj apr_pool_t *pglobal;
513b324e774c559b579896df131fd7c8471ed529rederpj apr_pool_t *pconf;
513b324e774c559b579896df131fd7c8471ed529rederpj apr_pool_t *plog; /* Pool of log streams, reset _after_ each read of conf */
513b324e774c559b579896df131fd7c8471ed529rederpj apr_pool_t *ptemp; /* Pool for temporary config stuff, reset often */
513b324e774c559b579896df131fd7c8471ed529rederpj apr_pool_t *pcommands; /* Pool for -D, -C and -c switches */
513b324e774c559b579896df131fd7c8471ed529rederpj apr_getopt_t *opt;
513b324e774c559b579896df131fd7c8471ed529rederpj module **mod;
513b324e774c559b579896df131fd7c8471ed529rederpj const char *optarg;
513b324e774c559b579896df131fd7c8471ed529rederpj
513b324e774c559b579896df131fd7c8471ed529rederpj apr_initialize();
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes process = create_process(argc, argv);
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes pglobal = process->pool;
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes pconf = process->pconf;
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes ap_server_argv0 = process->short_name;
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes#ifdef AP_CHARSET_EBCDIC
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes if (ap_init_ebcdic(pglobal) != APR_SUCCESS) {
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes destroy_and_exit_process(process, 1);
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes }
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#endif
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes ap_util_uri_init();
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes ap_setup_prelinked_modules(process);
9ad7b260be233be7d7b5576979825cac72e15498rederpj
9ad7b260be233be7d7b5576979825cac72e15498rederpj apr_create_pool(&pcommands, pglobal);
9ad7b260be233be7d7b5576979825cac72e15498rederpj ap_server_pre_read_config = apr_make_array(pcommands, 1, sizeof(char *));
9ad7b260be233be7d7b5576979825cac72e15498rederpj ap_server_post_read_config = apr_make_array(pcommands, 1, sizeof(char *));
9ad7b260be233be7d7b5576979825cac72e15498rederpj ap_server_config_defines = apr_make_array(pcommands, 1, sizeof(char *));
9ad7b260be233be7d7b5576979825cac72e15498rederpj
9ad7b260be233be7d7b5576979825cac72e15498rederpj ap_run_rewrite_args(process);
9ad7b260be233be7d7b5576979825cac72e15498rederpj
9ad7b260be233be7d7b5576979825cac72e15498rederpj /* Maintain AP_SERVER_BASEARGS list in http_main.h to allow the MPM
9ad7b260be233be7d7b5576979825cac72e15498rederpj * to safely pass on our args from its rewrite_args() handler.
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes */
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes apr_initopt(&opt, pcommands, process->argc, process->argv);
54d22ed1c429b903b029bbd62621f11a9e286137minfrin
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes while (apr_getopt(opt, AP_SERVER_BASEARGS, &c, &optarg)
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes == APR_SUCCESS) {
ebe5305f8b22507374358f32b74d12fb50c05a25covener char **new;
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes switch (c) {
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes case 'c':
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes new = (char **)apr_push_array(ap_server_post_read_config);
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes *new = apr_pstrdup(pcommands, optarg);
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes break;
54d22ed1c429b903b029bbd62621f11a9e286137minfrin case 'C':
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes new = (char **)apr_push_array(ap_server_pre_read_config);
54d22ed1c429b903b029bbd62621f11a9e286137minfrin *new = apr_pstrdup(pcommands, optarg);
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes break;
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes case 'd':
ebe5305f8b22507374358f32b74d12fb50c05a25covener def_server_root = optarg;
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes break;
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes case 'D':
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes new = (char **)apr_push_array(ap_server_config_defines);
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes *new = apr_pstrdup(pcommands, optarg);
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes break;
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes case 'f':
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes confname = optarg;
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes break;
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes case 'v':
b08925593f214f621161742925dcf074a8047e0acovener printf("Server version: %s\n", ap_get_server_version());
b08925593f214f621161742925dcf074a8047e0acovener printf("Server built: %s\n", ap_get_server_built());
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes destroy_and_exit_process(process, 0);
9ad7b260be233be7d7b5576979825cac72e15498rederpj case 'V':
9ad7b260be233be7d7b5576979825cac72e15498rederpj show_compile_settings();
9ad7b260be233be7d7b5576979825cac72e15498rederpj destroy_and_exit_process(process, 0);
128a5d93141a86e3afa151e921035a07297c9833rederpj case 'l':
9ad7b260be233be7d7b5576979825cac72e15498rederpj ap_show_modules();
9ad7b260be233be7d7b5576979825cac72e15498rederpj destroy_and_exit_process(process, 0);
128a5d93141a86e3afa151e921035a07297c9833rederpj case 'L':
128a5d93141a86e3afa151e921035a07297c9833rederpj ap_show_directives();
9ad7b260be233be7d7b5576979825cac72e15498rederpj destroy_and_exit_process(process, 0);
9ad7b260be233be7d7b5576979825cac72e15498rederpj case 't':
9ad7b260be233be7d7b5576979825cac72e15498rederpj configtestonly = 1;
9ad7b260be233be7d7b5576979825cac72e15498rederpj break;
128a5d93141a86e3afa151e921035a07297c9833rederpj case '?':
9ad7b260be233be7d7b5576979825cac72e15498rederpj case 'h':
9ad7b260be233be7d7b5576979825cac72e15498rederpj usage(process);
9ad7b260be233be7d7b5576979825cac72e15498rederpj }
9ad7b260be233be7d7b5576979825cac72e15498rederpj }
9ad7b260be233be7d7b5576979825cac72e15498rederpj
9ad7b260be233be7d7b5576979825cac72e15498rederpj apr_create_pool(&plog, pglobal);
128a5d93141a86e3afa151e921035a07297c9833rederpj apr_create_pool(&ptemp, pconf);
9ad7b260be233be7d7b5576979825cac72e15498rederpj
9ad7b260be233be7d7b5576979825cac72e15498rederpj /* Note that we preflight the config file once
9ad7b260be233be7d7b5576979825cac72e15498rederpj before reading it _again_ in the main loop.
9ad7b260be233be7d7b5576979825cac72e15498rederpj This allows things, log files configuration
9ad7b260be233be7d7b5576979825cac72e15498rederpj for example, to settle down. */
9ad7b260be233be7d7b5576979825cac72e15498rederpj
9ad7b260be233be7d7b5576979825cac72e15498rederpj ap_server_root = def_server_root;
9ad7b260be233be7d7b5576979825cac72e15498rederpj server_conf = ap_read_config(process, ptemp, confname, &ap_conftree);
9ad7b260be233be7d7b5576979825cac72e15498rederpj ap_run_pre_config(pconf, plog, ptemp);
9ad7b260be233be7d7b5576979825cac72e15498rederpj ap_process_config_tree(server_conf, ap_conftree, process->pconf, ptemp);
9ad7b260be233be7d7b5576979825cac72e15498rederpj ap_fixup_virtual_hosts(pconf, server_conf);
9ad7b260be233be7d7b5576979825cac72e15498rederpj ap_fini_vhost_config(pconf, server_conf);
9ad7b260be233be7d7b5576979825cac72e15498rederpj ap_sort_hooks();
9ad7b260be233be7d7b5576979825cac72e15498rederpj if (configtestonly) {
9ad7b260be233be7d7b5576979825cac72e15498rederpj ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, "Syntax OK\n");
9ad7b260be233be7d7b5576979825cac72e15498rederpj destroy_and_exit_process(process, 0);
9ad7b260be233be7d7b5576979825cac72e15498rederpj }
9ad7b260be233be7d7b5576979825cac72e15498rederpj apr_clear_pool(plog);
9ad7b260be233be7d7b5576979825cac72e15498rederpj ap_run_open_logs(pconf, plog, ptemp, server_conf);
7add8f7fb048534390571801b7794f71cd9e127abnicholes ap_post_config_hook(pconf, plog, ptemp, server_conf);
7add8f7fb048534390571801b7794f71cd9e127abnicholes apr_destroy_pool(ptemp);
8445dae5cc606ba8ba04efc341cc1e081d95920drpluem
8445dae5cc606ba8ba04efc341cc1e081d95920drpluem for (;;) {
7add8f7fb048534390571801b7794f71cd9e127abnicholes ap_hook_deregister_all();
7add8f7fb048534390571801b7794f71cd9e127abnicholes apr_clear_pool(pconf);
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes for (mod = ap_prelinked_modules; *mod != NULL; mod++) {
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes ap_register_hooks(*mod);
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes }
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes /* This is a hack until we finish the code so that it only reads
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes * the config file once and just operates on the tree already in
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes * memory. rbb
7add8f7fb048534390571801b7794f71cd9e127abnicholes */
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes ap_conftree = NULL;
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes apr_create_pool(&ptemp, pconf);
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes ap_server_root = def_server_root;
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes server_conf = ap_read_config(process, ptemp, confname, &ap_conftree);
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes ap_run_pre_config(pconf, plog, ptemp);
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes ap_process_config_tree(server_conf, ap_conftree, process->pconf, ptemp);
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes ap_fixup_virtual_hosts(pconf, server_conf);
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes ap_fini_vhost_config(pconf, server_conf);
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes ap_sort_hooks();
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes apr_clear_pool(plog);
7add8f7fb048534390571801b7794f71cd9e127abnicholes ap_run_open_logs(pconf, plog, ptemp, server_conf);
7add8f7fb048534390571801b7794f71cd9e127abnicholes ap_post_config_hook(pconf, plog, ptemp, server_conf);
141e1368614dc7564e1627671361b01b4869b491bnicholes apr_destroy_pool(ptemp);
3dfeb02cfb853d8717ca0cc259b59fea610173f5bnicholes
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes if (ap_mpm_run(pconf, plog, server_conf)) break;
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes }
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes destroy_and_exit_process(process, 0);
e8f95a682820a599fe41b22977010636be5c2717jim return 0; /* Supress compiler warning. */
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes}
ebe5305f8b22507374358f32b74d12fb50c05a25covener
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes/* force Expat to be linked into the server executable */
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes#if defined(USE_EXPAT) && !defined(SHARED_CORE_BOOTSTRAP)
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes#include "xmlparse.h"
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholesconst XML_LChar *suck_in_expat(void);
3dfeb02cfb853d8717ca0cc259b59fea610173f5bnicholesconst XML_LChar *suck_in_expat(void)
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes{
3dfeb02cfb853d8717ca0cc259b59fea610173f5bnicholes return XML_ErrorString(XML_ERROR_NONE);
3dfeb02cfb853d8717ca0cc259b59fea610173f5bnicholes}
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes#endif /* USE_EXPAT */
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes
e8f95a682820a599fe41b22977010636be5c2717jim#ifndef SHARED_CORE_BOOTSTRAP
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes/*
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes * Force apr_validate_password() into the image so that modules like
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes * mod_auth can use it even if they're dynamically loaded.
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes */
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholesvoid suck_in_apr_validate_password(void);
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholesvoid suck_in_apr_validate_password(void)
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes{
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes apr_validate_password("a", "b");
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes}
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes#endif
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes#ifdef AP_USING_AUTOCONF
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes/* This ugly little hack pulls any function referenced in exports.c into
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes * the web server. exports.c is generated during the build, and it
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes * has all of the APR functions specified by the apr/apr.exports and
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes * apr-util/aprutil.exports files.
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes */
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholesconst void *suck_in_APR(void);
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholesconst void *suck_in_APR(void)
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes{
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes extern const void *ap_ugly_hack;
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes return ap_ugly_hack;
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes}
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes#endif
d330a801b1e5d63a4b8b4fd431542ad0903fd71bbnicholes