1 /* Licensed to the Apache Software Foundation (ASF) under one or more
2 * contributor license agreements. See the NOTICE file distributed with
3 * this work for additional information regarding copyright ownership.
4 * The ASF licenses this file to You under the Apache License, Version 2.0
5 * (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #include "apr_strings.h"
19 #include "apr_getopt.h"
20 #include "apr_general.h"
24 #include "apr_version.h"
25 #include "apu_version.h"
27 #define APR_WANT_STDIO
28 #define APR_WANT_STRFUNC
31 #include "ap_config.h"
33 #include "http_main.h"
35 #include "http_config.h"
36 #include "http_core.h"
37 #include "http_request.h"
38 #include "http_vhost.h"
40 #include "util_ebcdic.h"
48 /* WARNING: Win32 binds http_main.c dynamically to the server. Please place
49 * extern functions and global data in another appropriate module.
51 * Most significant main() global data can be found in http_config.c
54 static void show_mpm_settings(void)
59 printf("Server MPM: %s\n", ap_show_mpm());
61 retval = ap_mpm_query(AP_MPMQ_IS_THREADED, &mpm_query_info);
63 if (retval == APR_SUCCESS) {
64 printf(" threaded: ");
66 if (mpm_query_info == AP_MPMQ_DYNAMIC) {
67 printf("yes (variable thread count)\n");
69 else if (mpm_query_info == AP_MPMQ_STATIC) {
70 printf("yes (fixed thread count)\n");
77 retval = ap_mpm_query(AP_MPMQ_IS_FORKED, &mpm_query_info);
79 if (retval == APR_SUCCESS) {
82 if (mpm_query_info == AP_MPMQ_DYNAMIC) {
83 printf("yes (variable process count)\n");
85 else if (mpm_query_info == AP_MPMQ_STATIC) {
86 printf("yes (fixed process count)\n");
94 static void show_compile_settings(void)
96 printf("Server version: %s\n", ap_get_server_description());
97 printf("Server built: %s\n", ap_get_server_built());
98 printf("Server's Module Magic Number: %u:%u\n",
99 MODULE_MAGIC_NUMBER_MAJOR, MODULE_MAGIC_NUMBER_MINOR);
100 printf("Server loaded: APR %s, APR-UTIL %s\n",
101 apr_version_string(), apu_version_string());
102 printf("Compiled using: APR %s, APR-UTIL %s\n",
103 APR_VERSION_STRING, APU_VERSION_STRING);
104 /* sizeof(foo) is long on some platforms so we might as well
105 * make it long everywhere to keep the printf format
108 printf("Architecture: %ld-bit\n", 8 * (long)sizeof(void *));
112 printf("Server compiled with....\n");
113 #ifdef BIG_SECURITY_HOLE
114 printf(" -D BIG_SECURITY_HOLE\n");
117 #ifdef SECURITY_HOLE_PASS_AUTHORIZATION
118 printf(" -D SECURITY_HOLE_PASS_AUTHORIZATION\n");
122 printf(" -D OS=\"" OS "\"\n");
126 printf(" -D HAVE_SHMGET\n");
129 #if APR_FILE_BASED_SHM
130 printf(" -D APR_FILE_BASED_SHM\n");
134 printf(" -D APR_HAS_SENDFILE\n");
138 printf(" -D APR_HAS_MMAP\n");
142 printf(" -D NO_WRITEV\n");
146 printf(" -D NO_LINGCLOSE\n");
150 printf(" -D APR_HAVE_IPV6 (IPv4-mapped addresses ");
151 #ifdef AP_ENABLE_V4_MAPPED
152 printf("enabled)\n");
154 printf("disabled)\n");
158 #if APR_USE_FLOCK_SERIALIZE
159 printf(" -D APR_USE_FLOCK_SERIALIZE\n");
162 #if APR_USE_SYSVSEM_SERIALIZE
163 printf(" -D APR_USE_SYSVSEM_SERIALIZE\n");
166 #if APR_USE_POSIXSEM_SERIALIZE
167 printf(" -D APR_USE_POSIXSEM_SERIALIZE\n");
170 #if APR_USE_FCNTL_SERIALIZE
171 printf(" -D APR_USE_FCNTL_SERIALIZE\n");
174 #if APR_USE_PROC_PTHREAD_SERIALIZE
175 printf(" -D APR_USE_PROC_PTHREAD_SERIALIZE\n");
178 #if APR_USE_PTHREAD_SERIALIZE
179 printf(" -D APR_USE_PTHREAD_SERIALIZE\n");
182 #if APR_PROCESS_LOCK_IS_GLOBAL
183 printf(" -D APR_PROCESS_LOCK_IS_GLOBAL\n");
186 #ifdef SINGLE_LISTEN_UNSERIALIZED_ACCEPT
187 printf(" -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT\n");
190 #if APR_HAS_OTHER_CHILD
191 printf(" -D APR_HAS_OTHER_CHILD\n");
194 #ifdef AP_HAVE_RELIABLE_PIPED_LOGS
195 printf(" -D AP_HAVE_RELIABLE_PIPED_LOGS\n");
199 printf(" -D BUFFERED_LOGS\n");
201 printf(" -D PIPE_BUF=%ld\n",(long)PIPE_BUF);
205 printf(" -D DYNAMIC_MODULE_LIMIT=%ld\n",(long)DYNAMIC_MODULE_LIMIT);
207 #if APR_CHARSET_EBCDIC
208 printf(" -D APR_CHARSET_EBCDIC\n");
211 #ifdef NEED_HASHBANG_EMUL
212 printf(" -D NEED_HASHBANG_EMUL\n");
216 printf(" -D SHARED_CORE\n");
219 /* This list displays the compiled in default paths: */
221 printf(" -D HTTPD_ROOT=\"" HTTPD_ROOT "\"\n");
225 printf(" -D SUEXEC_BIN=\"" SUEXEC_BIN "\"\n");
228 #if defined(SHARED_CORE) && defined(SHARED_CORE_DIR)
229 printf(" -D SHARED_CORE_DIR=\"" SHARED_CORE_DIR "\"\n");
232 #ifdef DEFAULT_PIDLOG
233 printf(" -D DEFAULT_PIDLOG=\"" DEFAULT_PIDLOG "\"\n");
236 #ifdef DEFAULT_SCOREBOARD
237 printf(" -D DEFAULT_SCOREBOARD=\"" DEFAULT_SCOREBOARD "\"\n");
240 #ifdef DEFAULT_ERRORLOG
241 printf(" -D DEFAULT_ERRORLOG=\"" DEFAULT_ERRORLOG "\"\n");
244 #ifdef AP_TYPES_CONFIG_FILE
245 printf(" -D AP_TYPES_CONFIG_FILE=\"" AP_TYPES_CONFIG_FILE "\"\n");
248 #ifdef SERVER_CONFIG_FILE
249 printf(" -D SERVER_CONFIG_FILE=\"" SERVER_CONFIG_FILE "\"\n");
253 #define TASK_SWITCH_SLEEP 10000
255 static void destroy_and_exit_process(process_rec *process,
256 int process_exit_value)
259 * Sleep for TASK_SWITCH_SLEEP micro seconds to cause a task switch on
260 * OS layer and thus give possibly started piped loggers a chance to
261 * process their input. Otherwise it is possible that they get killed
262 * by us before they can do so. In this case maybe valueable log messages
265 apr_sleep(TASK_SWITCH_SLEEP);
266 apr_pool_destroy(process->pool); /* and destroy all descendent pools */
268 exit(process_exit_value);
271 #define OOM_MESSAGE "[crit] Memory allocation failed, " \
272 "aborting process." APR_EOL_STR
274 /* APR callback invoked if allocation fails. */
275 static int abort_on_oom(int retcode)
277 write(STDERR_FILENO, OOM_MESSAGE, strlen(OOM_MESSAGE));
279 return retcode; /* unreachable, hopefully. */
282 static process_rec *init_process(int *argc, const char * const * *argv)
284 process_rec *process;
287 const char *failed = "apr_app_initialize()";
289 stat = apr_app_initialize(argc, argv, NULL);
290 if (stat == APR_SUCCESS) {
291 failed = "apr_pool_create()";
292 stat = apr_pool_create(&cntx, NULL);
295 if (stat != APR_SUCCESS) {
296 /* For all intents and purposes, this is impossibly unlikely,
297 * but APR doesn't exist yet, we can't use it for reporting
298 * these earliest two failures;
300 * XXX: Note the apr_ctime() and apr_time_now() calls. These
301 * work, today, against an uninitialized APR, but in the future
302 * (if they relied on global pools or mutexes, for example) then
303 * the datestamp logic will need to be replaced.
305 char ctimebuff[APR_CTIME_LEN];
306 apr_ctime(ctimebuff, apr_time_now());
307 fprintf(stderr, "[%s] [crit] (%d) %s: %s failed "
308 "to initial context, exiting\n",
309 ctimebuff, stat, (*argv)[0], failed);
314 apr_pool_abort_set(abort_on_oom, cntx);
315 apr_pool_tag(cntx, "process");
316 ap_open_stderr_log(cntx);
318 /* Now we have initialized apr and our logger, no more
319 * exceptional error reporting required for the lifetime
320 * of this server process.
323 process = apr_palloc(cntx, sizeof(process_rec));
324 process->pool = cntx;
326 apr_pool_create(&process->pconf, process->pool);
327 apr_pool_tag(process->pconf, "pconf");
328 process->argc = *argc;
329 process->argv = *argv;
330 process->short_name = apr_filepath_name_get((*argv)[0]);
334 static void usage(process_rec *process)
336 const char *bin = process->argv[0];
337 char pad[MAX_STRING_LEN];
340 for (i = 0; i < strlen(bin); i++) {
347 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL ,
348 "Usage: %s [-R directory] [-D name] [-d directory] [-f file]",
351 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
352 "Usage: %s [-D name] [-d directory] [-f file]", bin);
355 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
356 " %s [-C \"directive\"] [-c \"directive\"]", pad);
359 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
360 " %s [-w] [-k start|restart|stop|shutdown] [-n service_name]", pad);
361 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
362 " %s [-k install|config|uninstall] [-n service_name]",
365 /* XXX not all MPMs support signalling the server in general or graceful-stop
368 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
369 " %s [-k start|restart|graceful|graceful-stop|stop]",
372 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
373 " %s [-v] [-V] [-h] [-l] [-L] [-t] [-S]", pad);
374 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
378 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
379 " -R directory : specify an alternate location for "
380 "shared object files");
383 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
384 " -D name : define a name for use in "
385 "<IfDefine name> directives");
386 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
387 " -d directory : specify an alternate initial "
389 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
390 " -f file : specify an alternate ServerConfigFile");
391 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
392 " -C \"directive\" : process directive before reading "
394 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
395 " -c \"directive\" : process directive after reading "
399 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
400 " -n name : set screen name");
403 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
404 " -n name : set service name and use its "
405 "ServerConfigFile and ServerRoot");
406 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
407 " -k start : tell Apache to start");
408 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
409 " -k restart : tell running Apache to do a graceful "
411 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
412 " -k stop|shutdown : tell running Apache to shutdown");
413 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
414 " -k install : install an Apache service");
415 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
416 " -k config : change startup Options of an Apache "
418 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
419 " -k uninstall : uninstall an Apache service");
420 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
421 " -w : hold open the console window on error");
424 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
425 " -e level : show startup errors of level "
427 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
428 " -E file : log startup errors to file");
429 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
430 " -v : show version number");
431 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
432 " -V : show compile settings");
433 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
434 " -h : list available command line options "
436 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
437 " -l : list compiled in modules");
438 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
439 " -L : list available configuration "
441 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
442 " -t -D DUMP_VHOSTS : show parsed settings (currently only "
444 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
445 " -S : a synonym for -t -D DUMP_VHOSTS");
446 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
447 " -t -D DUMP_MODULES : show all loaded modules ");
448 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
449 " -M : a synonym for -t -D DUMP_MODULES");
450 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
451 " -t : run syntax check for config files");
453 destroy_and_exit_process(process, 1);
456 int main(int argc, const char * const argv[])
459 int configtestonly = 0, showcompile = 0;
460 const char *confname = SERVER_CONFIG_FILE;
461 const char *def_server_root = HTTPD_ROOT;
462 const char *temp_error_log = NULL;
464 process_rec *process;
466 apr_pool_t *plog; /* Pool of log streams, reset _after_ each read of conf */
467 apr_pool_t *ptemp; /* Pool for temporary config stuff, reset often */
468 apr_pool_t *pcommands; /* Pool for -D, -C and -c switches */
473 APR_OPTIONAL_FN_TYPE(ap_signal_server) *signal_server;
475 AP_MONCONTROL(0); /* turn off profiling of startup */
477 process = init_process(&argc, &argv);
478 ap_pglobal = process->pool;
479 pconf = process->pconf;
480 ap_server_argv0 = process->short_name;
482 /* Set up the OOM callback in the global pool, so all pools should
483 * by default inherit it. */
484 apr_pool_abort_set(abort_on_oom, apr_pool_parent_get(process->pool));
486 #if APR_CHARSET_EBCDIC
487 if (ap_init_ebcdic(ap_pglobal) != APR_SUCCESS) {
488 destroy_and_exit_process(process, 1);
491 if (ap_expr_init(ap_pglobal) != APR_SUCCESS) {
492 destroy_and_exit_process(process, 1);
495 apr_pool_create(&pcommands, ap_pglobal);
496 apr_pool_tag(pcommands, "pcommands");
497 ap_server_pre_read_config = apr_array_make(pcommands, 1, sizeof(char *));
498 ap_server_post_read_config = apr_array_make(pcommands, 1, sizeof(char *));
499 ap_server_config_defines = apr_array_make(pcommands, 1, sizeof(char *));
501 error = ap_setup_prelinked_modules(process);
503 ap_log_error(APLOG_MARK, APLOG_STARTUP|APLOG_EMERG, 0, NULL, "%s: %s",
504 ap_server_argv0, error);
505 destroy_and_exit_process(process, 1);
508 ap_run_rewrite_args(process);
510 /* Maintain AP_SERVER_BASEARGS list in http_main.h to allow the MPM
511 * to safely pass on our args from its rewrite_args() handler.
513 apr_getopt_init(&opt, pcommands, process->argc, process->argv);
515 while ((rv = apr_getopt(opt, AP_SERVER_BASEARGS, &c, &optarg))
521 new = (char **)apr_array_push(ap_server_post_read_config);
522 *new = apr_pstrdup(pcommands, optarg);
526 new = (char **)apr_array_push(ap_server_pre_read_config);
527 *new = apr_pstrdup(pcommands, optarg);
531 def_server_root = optarg;
535 new = (char **)apr_array_push(ap_server_config_defines);
536 *new = apr_pstrdup(pcommands, optarg);
537 /* Setting -D DUMP_VHOSTS is equivalent to setting -S */
538 if (strcmp(optarg, "DUMP_VHOSTS") == 0)
540 /* Setting -D DUMP_MODULES is equivalent to setting -M */
541 if (strcmp(optarg, "DUMP_MODULES") == 0)
546 if (strcasecmp(optarg, "emerg") == 0) {
547 ap_default_loglevel = APLOG_EMERG;
549 else if (strcasecmp(optarg, "alert") == 0) {
550 ap_default_loglevel = APLOG_ALERT;
552 else if (strcasecmp(optarg, "crit") == 0) {
553 ap_default_loglevel = APLOG_CRIT;
555 else if (strncasecmp(optarg, "err", 3) == 0) {
556 ap_default_loglevel = APLOG_ERR;
558 else if (strncasecmp(optarg, "warn", 4) == 0) {
559 ap_default_loglevel = APLOG_WARNING;
561 else if (strcasecmp(optarg, "notice") == 0) {
562 ap_default_loglevel = APLOG_NOTICE;
564 else if (strcasecmp(optarg, "info") == 0) {
565 ap_default_loglevel = APLOG_INFO;
567 else if (strcasecmp(optarg, "debug") == 0) {
568 ap_default_loglevel = APLOG_DEBUG;
576 temp_error_log = apr_pstrdup(process->pool, optarg);
580 new = (char **)apr_array_push(ap_server_config_defines);
589 printf("Server version: %s\n", ap_get_server_description());
590 printf("Server built: %s\n", ap_get_server_built());
591 destroy_and_exit_process(process, 0);
594 if (strcmp(ap_show_mpm(), "")) { /* MPM built-in? */
595 show_compile_settings();
596 destroy_and_exit_process(process, 0);
605 destroy_and_exit_process(process, 0);
608 ap_show_directives();
609 destroy_and_exit_process(process, 0);
617 new = (char **)apr_array_push(ap_server_config_defines);
618 *new = "DUMP_VHOSTS";
623 new = (char **)apr_array_push(ap_server_config_defines);
624 *new = "DUMP_MODULES";
633 /* bad cmdline option? then we die */
634 if (rv != APR_EOF || opt->ind < opt->argc) {
638 apr_pool_create(&plog, ap_pglobal);
639 apr_pool_tag(plog, "plog");
640 apr_pool_create(&ptemp, pconf);
641 apr_pool_tag(ptemp, "ptemp");
643 /* Note that we preflight the config file once
644 * before reading it _again_ in the main loop.
645 * This allows things, log files configuration
646 * for example, to settle down.
649 ap_server_root = def_server_root;
650 if (temp_error_log) {
651 ap_replace_stderr_log(process->pool, temp_error_log);
653 ap_server_conf = ap_read_config(process, ptemp, confname, &ap_conftree);
654 if (!ap_server_conf) {
655 destroy_and_exit_process(process, 1);
658 if (ap_run_pre_config(pconf, plog, ptemp) != OK) {
659 ap_log_error(APLOG_MARK, APLOG_STARTUP |APLOG_ERR, 0,
660 NULL, "Pre-configuration failed");
661 destroy_and_exit_process(process, 1);
664 rv = ap_process_config_tree(ap_server_conf, ap_conftree,
665 process->pconf, ptemp);
667 ap_fixup_virtual_hosts(pconf, ap_server_conf);
668 ap_fini_vhost_config(pconf, ap_server_conf);
671 if (ap_run_check_config(pconf, plog, ptemp, ap_server_conf) != OK) {
672 ap_log_error(APLOG_MARK, APLOG_STARTUP |APLOG_ERR, 0,
673 NULL, "Configuration check failed");
674 destroy_and_exit_process(process, 1);
677 if (configtestonly) {
678 ap_run_test_config(pconf, ap_server_conf);
679 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, "Syntax OK");
680 destroy_and_exit_process(process, 0);
682 else if (showcompile) { /* deferred due to dynamically loaded MPM */
683 show_compile_settings();
684 destroy_and_exit_process(process, 0);
688 signal_server = APR_RETRIEVE_OPTIONAL_FN(ap_signal_server);
692 if (signal_server(&exit_status, pconf) != 0) {
693 destroy_and_exit_process(process, exit_status);
697 /* If our config failed, deal with that here. */
699 destroy_and_exit_process(process, 1);
702 apr_pool_clear(plog);
704 if ( ap_run_open_logs(pconf, plog, ptemp, ap_server_conf) != OK) {
705 ap_log_error(APLOG_MARK, APLOG_STARTUP |APLOG_ERR,
706 0, NULL, "Unable to open logs");
707 destroy_and_exit_process(process, 1);
710 if ( ap_run_post_config(pconf, plog, ptemp, ap_server_conf) != OK) {
711 ap_log_error(APLOG_MARK, APLOG_STARTUP |APLOG_ERR, 0,
712 NULL, "Configuration Failed");
713 destroy_and_exit_process(process, 1);
716 apr_pool_destroy(ptemp);
719 apr_hook_deregister_all();
720 apr_pool_clear(pconf);
721 ap_clear_auth_internal();
723 for (mod = ap_prelinked_modules; *mod != NULL; mod++) {
724 ap_register_hooks(*mod, pconf);
727 /* This is a hack until we finish the code so that it only reads
728 * the config file once and just operates on the tree already in
732 apr_pool_create(&ptemp, pconf);
733 apr_pool_tag(ptemp, "ptemp");
734 ap_server_root = def_server_root;
735 ap_server_conf = ap_read_config(process, ptemp, confname, &ap_conftree);
736 if (!ap_server_conf) {
737 destroy_and_exit_process(process, 1);
740 if (ap_run_pre_config(pconf, plog, ptemp) != OK) {
741 ap_log_error(APLOG_MARK, APLOG_STARTUP |APLOG_ERR,
742 0, NULL, "Pre-configuration failed");
743 destroy_and_exit_process(process, 1);
746 if (ap_process_config_tree(ap_server_conf, ap_conftree, process->pconf,
748 destroy_and_exit_process(process, 1);
750 ap_fixup_virtual_hosts(pconf, ap_server_conf);
751 ap_fini_vhost_config(pconf, ap_server_conf);
754 if (ap_run_check_config(pconf, plog, ptemp, ap_server_conf) != OK) {
755 ap_log_error(APLOG_MARK, APLOG_STARTUP |APLOG_ERR, 0,
756 NULL, "Configuration check failed");
757 destroy_and_exit_process(process, 1);
760 apr_pool_clear(plog);
761 if (ap_run_open_logs(pconf, plog, ptemp, ap_server_conf) != OK) {
762 ap_log_error(APLOG_MARK, APLOG_STARTUP |APLOG_ERR,
763 0, NULL, "Unable to open logs");
764 destroy_and_exit_process(process, 1);
767 if (ap_run_post_config(pconf, plog, ptemp, ap_server_conf) != OK) {
768 ap_log_error(APLOG_MARK, APLOG_STARTUP |APLOG_ERR,
769 0, NULL, "Configuration Failed");
770 destroy_and_exit_process(process, 1);
773 apr_pool_destroy(ptemp);
774 apr_pool_lock(pconf, 1);
776 ap_run_optional_fn_retrieve();
778 if (ap_run_mpm(pconf, plog, ap_server_conf) != OK)
781 apr_pool_lock(pconf, 0);
784 apr_pool_lock(pconf, 0);
785 destroy_and_exit_process(process, 0);
787 return 0; /* Termination 'ok' */
790 #ifdef AP_USING_AUTOCONF
791 /* This ugly little hack pulls any function referenced in exports.c into
792 * the web server. exports.c is generated during the build, and it
793 * has all of the APR functions specified by the apr/apr.exports and
794 * apr-util/aprutil.exports files.
796 const void *ap_suck_in_APR(void);
797 const void *ap_suck_in_APR(void)
799 extern const void *ap_ugly_hack;