main.c revision 86b535ee123402fc9186efdf7f67b3e6915545e3
/* ====================================================================
* Copyright (c) 1995-1999 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
* 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 <http://www.apache.org/>.
*
*/
#define CORE_PRIVATE
#include "httpd.h"
#include "http_main.h"
#include "http_config.h"
#include "util_uri.h"
#include "ap_mpm.h"
char *ap_server_argv0;
API_VAR_EXPORT const char *ap_server_root;
static void show_compile_settings(void)
{
printf("Server's Module Magic Number: %u:%u\n",
printf("Server compiled with....\n");
#ifdef BIG_SECURITY_HOLE
printf(" -D BIG_SECURITY_HOLE\n");
#endif
printf(" -D SECURITY_HOLE_PASS_AUTHORIZATION\n");
#endif
#ifdef HAVE_MMAP
printf(" -D HAVE_MMAP\n");
#endif
#ifdef HAVE_SHMGET
printf(" -D HAVE_SHMGET\n");
#endif
#ifdef USE_MMAP_SCOREBOARD
printf(" -D USE_MMAP_SCOREBOARD\n");
#endif
#ifdef USE_SHMGET_SCOREBOARD
printf(" -D USE_SHMGET_SCOREBOARD\n");
#endif
#ifdef USE_OS2_SCOREBOARD
printf(" -D USE_OS2_SCOREBOARD\n");
#endif
#ifdef USE_POSIX_SCOREBOARD
printf(" -D USE_POSIX_SCOREBOARD\n");
#endif
#ifdef USE_MMAP_FILES
printf(" -D USE_MMAP_FILES\n");
#ifdef MMAP_SEGMENT_SIZE
#endif
#endif /*USE_MMAP_FILES*/
#ifdef NO_WRITEV
printf(" -D NO_WRITEV\n");
#endif
#ifdef NO_LINGCLOSE
printf(" -D NO_LINGCLOSE\n");
#endif
#ifdef USE_FCNTL_SERIALIZED_ACCEPT
printf(" -D USE_FCNTL_SERIALIZED_ACCEPT\n");
#endif
#ifdef USE_FLOCK_SERIALIZED_ACCEPT
printf(" -D USE_FLOCK_SERIALIZED_ACCEPT\n");
#endif
#ifdef USE_USLOCK_SERIALIZED_ACCEPT
printf(" -D USE_USLOCK_SERIALIZED_ACCEPT\n");
#endif
printf(" -D USE_SYSVSEM_SERIALIZED_ACCEPT\n");
#endif
printf(" -D USE_PTHREAD_SERIALIZED_ACCEPT\n");
#endif
printf(" -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT\n");
#endif
#ifdef HAS_OTHER_CHILD
printf(" -D HAS_OTHER_CHILD\n");
#endif
#ifdef NO_RELIABLE_PIPED_LOGS
printf(" -D NO_RELIABLE_PIPED_LOGS\n");
#endif
#ifdef BUFFERED_LOGS
printf(" -D BUFFERED_LOGS\n");
#ifdef PIPE_BUF
#endif
#endif
#ifdef MULTITHREAD
printf(" -D MULTITHREAD\n");
#endif
#ifdef CHARSET_EBCDIC
printf(" -D CHARSET_EBCDIC\n");
#endif
#ifdef NEED_HASHBANG_EMUL
printf(" -D NEED_HASHBANG_EMUL\n");
#endif
#ifdef SHARED_CORE
printf(" -D SHARED_CORE\n");
#endif
/* This list displays the compiled ap_context_t n default paths: */
#ifdef HTTPD_ROOT
#endif
#ifdef SUEXEC_BIN
#endif
#if defined(SHARED_CORE) && defined(SHARED_CORE_DIR)
#endif
#ifdef DEFAULT_PIDLOG
#endif
#ifdef DEFAULT_SCOREBOARD
#endif
#ifdef DEFAULT_LOCKFILE
#endif
#ifdef DEFAULT_XFERLOG
#endif
#ifdef DEFAULT_ERRORLOG
#endif
#ifdef TYPES_CONFIG_FILE
#endif
#ifdef SERVER_CONFIG_FILE
#endif
#ifdef ACCESS_CONFIG_FILE
#endif
#ifdef RESOURCE_CONFIG_FILE
#endif
}
{
char pad[MAX_STRING_LEN];
unsigned i;
pad[i] = ' ';
pad[i] = '\0';
#ifdef SHARED_CORE
#else
#endif
#ifdef SHARED_CORE
#endif
/* TODOC: -S has been replaced by '-t -D DUMP_VHOSTS' */
/* fprintf(stderr, " -S : show parsed settings (currently only vhost settings)\n"); */
/* TODOC: -X goes away, expect MPMs to use -D options */
exit(1);
}
extern char *optarg;
#ifdef WIN32
#else
#endif
{
int c;
int configtestonly = 0;
char *s;
const char *confname = SERVER_CONFIG_FILE;
const char *def_server_root = HTTPD_ROOT;
/* TODO: PATHSEPARATOR should be one of the os defines */
#define PATHSEPARATOR '/'
ap_server_argv0 = ++s;
}
else {
ap_server_argv0 = argv[0];
}
char **new;
switch (c) {
case 'c':
break;
case 'C':
break;
case 'd':
break;
case 'f':
break;
case 'v':
exit(0);
case 'V':
exit(0);
case 'l':
exit(0);
case 'L':
exit(0);
case 't':
configtestonly = 1;
break;
case 'h':
case '?':
}
}
/* for legacy reasons, we read the configuration twice before
we actually serve any requests */
if (configtestonly) {
exit(0);
}
for (;;) {
}
exit(0);
}
/* force Expat to be linked into the server executable */
#if defined(USE_EXPAT) && !defined(SHARED_CORE_BOOTSTRAP)
#include "xmlparse.h"
const XML_LChar *suck_in_expat(void);
const XML_LChar *suck_in_expat(void)
{
return XML_ErrorString(XML_ERROR_NONE);
}
#endif /* USE_EXPAT */
#ifndef SHARED_CORE_BOOTSTRAP
/*
* Force ap_validate_password() into the image so that modules like
* mod_auth can use it even if they're dynamically loaded.
*/
void suck_in_ap_validate_password(void);
void suck_in_ap_validate_password(void)
{
}
#endif