main.c revision 1ccd992d37d62c8cb2056126f2234f64ec189bfd
ab4ab2edaac480f68b476dc19e015c54cd4f1978Lubos Kosco/* ====================================================================
ab4ab2edaac480f68b476dc19e015c54cd4f1978Lubos Kosco * The Apache Software License, Version 1.1
ab4ab2edaac480f68b476dc19e015c54cd4f1978Lubos Kosco * Copyright (c) 2000 The Apache Software Foundation. All rights
9661674ed58ba62a40e43d1a4b38d5e77c3c6545Knut Anders Hatlen * Redistribution and use in source and binary forms, with or without
551b849ce88d596dc52dda2f78229a932b339c78Lubos Kosco * modification, are permitted provided that the following conditions
e7b21c8124ec55ffacc49c1e28a8685834715484Lubos Kosco * 1. Redistributions of source code must retain the above copyright
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye * notice, this list of conditions and the following disclaimer.
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye * 2. Redistributions in binary form must reproduce the above copyright
477c09a2656e6a2c1075425ad81e61d594164fa9Lubos Kosco * notice, this list of conditions and the following disclaimer in
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye * the documentation and/or other materials provided with the
bcae302a5f4b516d2f3c05f657df054e1a0efde7Knut Anders Hatlen * distribution.
98774b0b90e4da0f3f2c5e4856bcbbf366ed0fe0Knut Anders Hatlen * 3. The end-user documentation included with the redistribution,
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye * if any, must include the following acknowledgment:
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye * "This product includes software developed by the
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye * Apache Software Foundation (http://www.apache.org/)."
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye * Alternately, this acknowledgment may appear in the software itself,
afb218f076cae538126a5f931299a82a114a075aKnut Anders Hatlen * if and wherever such third-party acknowledgments normally appear.
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye * 4. The names "Apache" and "Apache Software Foundation" must
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye * not be used to endorse or promote products derived from this
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye * software without prior written permission. For written
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye * permission, please contact apache@apache.org.
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye * 5. Products derived from this software may not be called "Apache",
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye * nor may "Apache" appear in their name, without prior written
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye * permission of the Apache Software Foundation.
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
9661674ed58ba62a40e43d1a4b38d5e77c3c6545Knut Anders Hatlen * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
bbb39d08c0e5b73c89ba813a7c1789842c60f961Lubos Kosco * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
2ba599c0d79caf59996d8b54a0490bb968442134Knut Anders Hatlen * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
67b14513c549ae0027ba7590e736b3dd3281db7cLubos Kosco * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco * SUCH DAMAGE.
85fb1b4846faa28d393e65ba466b7931478d7d6aLubos Kosco * ====================================================================
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco * This software consists of voluntary contributions made by many
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco * individuals on behalf of the Apache Software Foundation. For more
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco * information on the Apache Software Foundation, please see
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco * Portions of this software are based upon public domain software
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco * originally written at the National Center for Supercomputing Applications,
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye * University of Illinois, Urbana-Champaign.
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye/* WARNING: Win32 binds http_main.c dynamically to the server. Please place
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye * extern functions and global data in another appropriate module.
ab4ab2edaac480f68b476dc19e015c54cd4f1978Lubos Kosco * Most significant main() global data can be found in http_config.c
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye/* XXX - We should be able to grab the per-MPM settings here too */
4bb936310d8f131aa850821e9254ac14242c7f95Knut Anders Hatlen printf("Server version: %s\n", ap_get_server_version());
4bb936310d8f131aa850821e9254ac14242c7f95Knut Anders Hatlen printf("Server built: %s\n", ap_get_server_built());
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye printf("Server's Module Magic Number: %u:%u\n",
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye MODULE_MAGIC_NUMBER_MAJOR, MODULE_MAGIC_NUMBER_MINOR);
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye printf(" -D SECURITY_HOLE_PASS_AUTHORIZATION\n");
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye printf(" -D MMAP_SEGMENT_SIZE=%ld\n",(long)MMAP_SEGMENT_SIZE);
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye#endif /*USE_MMAP_FILES*/
#ifdef HAVE_RELIABLE_PIPED_LOGS
#ifdef BUFFERED_LOGS
#ifdef PIPE_BUF
#ifdef CHARSET_EBCDIC
#ifdef APACHE_XLATE
#ifdef NEED_HASHBANG_EMUL
#ifdef SHARED_CORE
#ifdef HTTPD_ROOT
#ifdef SUEXEC_BIN
#ifdef DEFAULT_PIDLOG
#ifdef DEFAULT_SCOREBOARD
#ifdef DEFAULT_LOCKFILE
#ifdef DEFAULT_XFERLOG
#ifdef DEFAULT_ERRORLOG
#ifdef TYPES_CONFIG_FILE
#ifdef SERVER_CONFIG_FILE
return process;
#ifdef SHARED_CORE
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0,NULL , "Usage: %s [-R directory] [-D name] [-d directory] [-f file]", bin);
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, "Usage: %s [-D name] [-d directory] [-f file]", bin);
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " %s [-C \"directive\"] [-c \"directive\"]", pad);
#ifdef WIN32
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " %s [-k restart|shutdown|start]", pad);
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " %s [-v] [-V] [-h] [-l] [-L] [-S] [-t] [-T]", pad);
#ifdef SHARED_CORE
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -R directory : specify an alternate location for shared object files");
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -D name : define a name for use in <IfDefine name> directives");
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -d directory : specify an alternate initial ServerRoot");
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -f file : specify an alternate ServerConfigFile");
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -C \"directive\" : process directive before reading config files");
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -c \"directive\" : process directive after reading config files");
#ifdef WIN32
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -n name : set service name and use its ServerConfigFile");
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -k shutdown : tell running Apache to shutdown");
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -k restart : tell running Apache to do a graceful restart");
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -k start : tell Apache to start");
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -i : install an Apache service");
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -u : uninstall an Apache service");
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -h : list available command line options (this page)");
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -L : list available configuration directives");
/* ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -S : show parsed settings (currently only vhost settings)"); */
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -t : run syntax check for config files (with docroot check)");
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -T : run syntax check for config files (without docroot check)");
int configtestonly = 0;
#ifdef CHARSET_EBCDIC
/* Maintain AP_SERVER_BASEARGS list in http_main.h to allow the MPM
== APR_SUCCESS) {
char **new;
if (configtestonly) {
#include "xmlparse.h"
#ifndef SHARED_CORE_BOOTSTRAP
void suck_in_apr_validate_password(void);
void suck_in_apr_validate_password(void)