Apache HTTPD
main.c
Go to the documentation of this file.
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16
17#include "apr.h"
18#include "apr_strings.h"
19#include "apr_getopt.h"
20#include "apr_general.h"
21#include "apr_lib.h"
22#include "apr_md5.h"
23#include "apr_time.h"
24#include "apr_thread_proc.h"
25#include "apr_version.h"
26#include "apu_version.h"
27
28#define APR_WANT_STDIO
29#define APR_WANT_STRFUNC
30#include "apr_want.h"
31
32#include "ap_config.h"
33#include "httpd.h"
34#include "http_main.h"
35#include "http_log.h"
36#include "http_config.h"
37#include "http_core.h"
38#include "mod_core.h"
39#include "http_request.h"
40#include "http_vhost.h"
41#include "apr_uri.h"
42#include "util_ebcdic.h"
43#include "ap_mpm.h"
44
45#if APR_HAVE_UNISTD_H
46#include <unistd.h>
47#endif
48
49/* WARNING: Win32 binds http_main.c dynamically to the server. Please place
50 * extern functions and global data in another appropriate module.
51 *
52 * Most significant main() global data can be found in http_config.c
53 */
54
55static void show_mpm_settings(void)
56{
59
60 printf("Server MPM: %s\n", ap_show_mpm());
61
63
64 if (retval == APR_SUCCESS) {
65 printf(" threaded: ");
66
68 printf("yes (variable thread count)\n");
69 }
70 else if (mpm_query_info == AP_MPMQ_STATIC) {
71 printf("yes (fixed thread count)\n");
72 }
73 else {
74 printf("no\n");
75 }
76 }
77
79
80 if (retval == APR_SUCCESS) {
81 printf(" forked: ");
82
84 printf("yes (variable process count)\n");
85 }
86 else if (mpm_query_info == AP_MPMQ_STATIC) {
87 printf("yes (fixed process count)\n");
88 }
89 else {
90 printf("no\n");
91 }
92 }
93}
94
95static void show_compile_settings(void)
96{
97 printf("Server version: %s\n", ap_get_server_description());
98 printf("Server built: %s\n", ap_get_server_built());
99 printf("Server's Module Magic Number: %u:%u\n",
101#if APR_MAJOR_VERSION >= 2
102 printf("Server loaded: APR %s, PCRE %s\n",
104 printf("Compiled using: APR %s, PCRE %s\n",
106#else
107 printf("Server loaded: APR %s, APR-UTIL %s, PCRE %s\n",
110 printf("Compiled using: APR %s, APR-UTIL %s, PCRE %s\n",
113#endif
114 /* sizeof(foo) is long on some platforms so we might as well
115 * make it long everywhere to keep the printf format
116 * consistent
117 */
118 printf("Architecture: %ld-bit\n", 8 * (long)sizeof(void *));
119
121
122 printf("Server compiled with....\n");
123#ifdef BIG_SECURITY_HOLE
124 printf(" -D BIG_SECURITY_HOLE\n");
125#endif
126
127#ifdef SECURITY_HOLE_PASS_AUTHORIZATION
128 printf(" -D SECURITY_HOLE_PASS_AUTHORIZATION\n");
129#endif
130
131#ifdef OS
132 printf(" -D OS=\"" OS "\"\n");
133#endif
134
135#ifdef HAVE_SHMGET
136 printf(" -D HAVE_SHMGET\n");
137#endif
138
139#if APR_FILE_BASED_SHM
140 printf(" -D APR_FILE_BASED_SHM\n");
141#endif
142
143#if APR_HAS_SENDFILE
144 printf(" -D APR_HAS_SENDFILE\n");
145#endif
146
147#if APR_HAS_MMAP
148 printf(" -D APR_HAS_MMAP\n");
149#endif
150
151#ifdef NO_WRITEV
152 printf(" -D NO_WRITEV\n");
153#endif
154
155#ifdef NO_LINGCLOSE
156 printf(" -D NO_LINGCLOSE\n");
157#endif
158
159#if APR_HAVE_IPV6
160 printf(" -D APR_HAVE_IPV6 (IPv4-mapped addresses ");
161#ifdef AP_ENABLE_V4_MAPPED
162 printf("enabled)\n");
163#else
164 printf("disabled)\n");
165#endif
166#endif
167
168#if APR_USE_FLOCK_SERIALIZE
169 printf(" -D APR_USE_FLOCK_SERIALIZE\n");
170#endif
171
172#if APR_USE_SYSVSEM_SERIALIZE
173 printf(" -D APR_USE_SYSVSEM_SERIALIZE\n");
174#endif
175
176#if APR_USE_POSIXSEM_SERIALIZE
177 printf(" -D APR_USE_POSIXSEM_SERIALIZE\n");
178#endif
179
180#if APR_USE_FCNTL_SERIALIZE
181 printf(" -D APR_USE_FCNTL_SERIALIZE\n");
182#endif
183
184#if APR_USE_PROC_PTHREAD_SERIALIZE
185 printf(" -D APR_USE_PROC_PTHREAD_SERIALIZE\n");
186#endif
187
188#if APR_USE_PTHREAD_SERIALIZE
189 printf(" -D APR_USE_PTHREAD_SERIALIZE\n");
190#endif
191
192#if APR_PROCESS_LOCK_IS_GLOBAL
193 printf(" -D APR_PROCESS_LOCK_IS_GLOBAL\n");
194#endif
195
196#ifdef SINGLE_LISTEN_UNSERIALIZED_ACCEPT
197 printf(" -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT\n");
198#endif
199
200#if APR_HAS_OTHER_CHILD
201 printf(" -D APR_HAS_OTHER_CHILD\n");
202#endif
203
204#ifdef AP_HAVE_RELIABLE_PIPED_LOGS
205 printf(" -D AP_HAVE_RELIABLE_PIPED_LOGS\n");
206#endif
207
208#ifdef BUFFERED_LOGS
209 printf(" -D BUFFERED_LOGS\n");
210#ifdef PIPE_BUF
211 printf(" -D PIPE_BUF=%ld\n",(long)PIPE_BUF);
212#endif
213#endif
214
215 printf(" -D DYNAMIC_MODULE_LIMIT=%ld\n",(long)DYNAMIC_MODULE_LIMIT);
216
217#if APR_CHARSET_EBCDIC
218 printf(" -D APR_CHARSET_EBCDIC\n");
219#endif
220
221#ifdef NEED_HASHBANG_EMUL
222 printf(" -D NEED_HASHBANG_EMUL\n");
223#endif
224
225/* This list displays the compiled in default paths: */
226#ifdef HTTPD_ROOT
227 printf(" -D HTTPD_ROOT=\"" HTTPD_ROOT "\"\n");
228#endif
229
230#ifdef SUEXEC_BIN
231 printf(" -D SUEXEC_BIN=\"" SUEXEC_BIN "\"\n");
232#endif
233
234#ifdef DEFAULT_PIDLOG
235 printf(" -D DEFAULT_PIDLOG=\"" DEFAULT_PIDLOG "\"\n");
236#endif
237
238#ifdef DEFAULT_SCOREBOARD
239 printf(" -D DEFAULT_SCOREBOARD=\"" DEFAULT_SCOREBOARD "\"\n");
240#endif
241
242#ifdef DEFAULT_ERRORLOG
243 printf(" -D DEFAULT_ERRORLOG=\"" DEFAULT_ERRORLOG "\"\n");
244#endif
245
246#ifdef AP_TYPES_CONFIG_FILE
247 printf(" -D AP_TYPES_CONFIG_FILE=\"" AP_TYPES_CONFIG_FILE "\"\n");
248#endif
249
250#ifdef SERVER_CONFIG_FILE
251 printf(" -D SERVER_CONFIG_FILE=\"" SERVER_CONFIG_FILE "\"\n");
252#endif
253}
254
255#define TASK_SWITCH_SLEEP 10000
256
259{
260 /*
261 * Sleep for TASK_SWITCH_SLEEP micro seconds to cause a task switch on
262 * OS layer and thus give possibly started piped loggers a chance to
263 * process their input. Otherwise it is possible that they get killed
264 * by us before they can do so. In this case maybe valuable log messages
265 * might get lost.
266 */
269 apr_pool_destroy(process->pool); /* and destroy all descendent pools */
272}
273
274/* APR callback invoked if allocation fails. */
275static int abort_on_oom(int retcode)
276{
278 return retcode; /* unreachable, hopefully. */
279}
280
281/* Deregister all hooks when clearing pconf (pre_cleanup).
282 * TODO: have a hook to deregister and run them from here?
283 * ap_clear_auth_internal() is already a candidate.
284 */
286{
287 (void)unused;
290 return APR_SUCCESS;
291}
292
293static void reset_process_pconf(process_rec *process)
294{
295 if (process->pconf) {
296 apr_pool_clear(process->pconf);
298 }
299 else {
300 apr_pool_create(&process->pconf, process->pool);
301 apr_pool_tag(process->pconf, "pconf");
302 }
304}
305
306static process_rec *init_process(int *argc, const char * const * *argv)
307{
308 process_rec *process;
311 const char *failed = "apr_app_initialize()";
312
314 if (stat == APR_SUCCESS) {
315 failed = "apr_pool_create()";
317 }
318
319 if (stat != APR_SUCCESS) {
320 /* For all intents and purposes, this is impossibly unlikely,
321 * but APR doesn't exist yet, we can't use it for reporting
322 * these earliest two failures;
323 *
324 * XXX: Note the apr_ctime() and apr_time_now() calls. These
325 * work, today, against an uninitialized APR, but in the future
326 * (if they relied on global pools or mutexes, for example) then
327 * the datestamp logic will need to be replaced.
328 */
331 fprintf(stderr, "[%s] [crit] (%d) %s: %s failed "
332 "to initial context, exiting\n",
333 ctimebuff, stat, (*argv)[0], failed);
335 exit(1);
336 }
337
339 apr_pool_tag(cntx, "process");
341
342 /* Now we have initialized apr and our logger, no more
343 * exceptional error reporting required for the lifetime
344 * of this server process.
345 */
346
347 process = apr_palloc(cntx, sizeof(process_rec));
348 process->pool = cntx;
349
350 process->pconf = NULL;
351 reset_process_pconf(process);
352
353 process->argc = *argc;
354 process->argv = *argv;
355 process->short_name = apr_filepath_name_get((*argv)[0]);
356
357#if AP_HAS_THREAD_LOCAL
358 {
359 apr_status_t rv;
361 if ((rv = ap_thread_main_create(&thd, process->pool))) {
364 fprintf(stderr, "[%s] [crit] (%d) %s: failed "
365 "to initialize thread context, exiting\n",
366 ctimebuff, rv, (*argv)[0]);
368 exit(1);
369 }
370 }
371#endif
372
373 return process;
374}
375
376static void usage(process_rec *process)
377{
378 const char *bin = process->argv[0];
379 int pad_len = strlen(bin);
380
382 "Usage: %s [-D name] [-d directory] [-f file]", bin);
383
385 " %*s [-C \"directive\"] [-c \"directive\"]", pad_len, " ");
386
387#ifdef WIN32
389 " %*s [-w] [-k start|restart|stop|shutdown] [-n service_name]",
390 pad_len, " ");
392 " %*s [-k install|config|uninstall] [-n service_name]",
393 pad_len, " ");
394#else
395/* XXX not all MPMs support signalling the server in general or graceful-stop
396 * in particular
397 */
399 " %*s [-k start|restart|graceful|graceful-stop|stop]",
400 pad_len, " ");
401#endif
403 " %*s [-v] [-V] [-h] [-l] [-L] [-t] [-T] [-S] [-X]",
404 pad_len, " ");
406 "Options:");
407
409 " -D name : define a name for use in "
410 "<IfDefine name> directives");
412 " -d directory : specify an alternate initial "
413 "ServerRoot");
415 " -f file : specify an alternate ServerConfigFile");
417 " -C \"directive\" : process directive before reading "
418 "config files");
420 " -c \"directive\" : process directive after reading "
421 "config files");
422
423#ifdef NETWARE
425 " -n name : set screen name");
426#endif
427#ifdef WIN32
429 " -n name : set service name and use its "
430 "ServerConfigFile and ServerRoot");
432 " -k start : tell Apache to start");
434 " -k restart : tell running Apache to do a graceful "
435 "restart");
437 " -k stop|shutdown : tell running Apache to shutdown");
439 " -k install : install an Apache service");
441 " -k config : change startup Options of an Apache "
442 "service");
444 " -k uninstall : uninstall an Apache service");
446 " -w : hold open the console window on error");
447#endif
448
450 " -e level : show startup errors of level "
451 "(see LogLevel)");
453 " -E file : log startup errors to file");
455 " -v : show version number");
457 " -V : show compile settings");
459 " -h : list available command line options "
460 "(this page)");
462 " -l : list compiled in modules");
464 " -L : list available configuration "
465 "directives");
467 " -t -D DUMP_VHOSTS : show parsed vhost settings");
469 " -t -D DUMP_RUN_CFG : show parsed run settings");
471 " -S : a synonym for -t -D DUMP_VHOSTS -D DUMP_RUN_CFG");
473 " -t -D DUMP_MODULES : show all loaded modules ");
475 " -M : a synonym for -t -D DUMP_MODULES");
477 " -t -D DUMP_INCLUDES: show all included configuration files");
479 " -t : run syntax check for config files");
481 " -T : start without DocumentRoot(s) check");
483 " -X : debug mode (only one worker, do not detach)");
484
485 destroy_and_exit_process(process, 1);
486}
487
488int main(int argc, const char * const argv[])
489{
490 char c;
491 int showcompile = 0, showdirectives = 0;
492 const char *confname = SERVER_CONFIG_FILE;
493 const char *def_server_root = HTTPD_ROOT;
494 const char *temp_error_log = NULL;
495 const char *error;
496 process_rec *process;
498 apr_pool_t *plog; /* Pool of log streams, reset _after_ each read of conf */
499 apr_pool_t *ptemp; /* Pool for temporary config stuff, reset often */
500 apr_pool_t *pcommands; /* Pool for -D, -C and -c switches */
502 apr_status_t rv;
503 module **mod;
504 const char *opt_arg;
506 int rc = OK;
507
508 AP_MONCONTROL(0); /* turn off profiling of startup */
509
510 process = init_process(&argc, &argv);
511 ap_pglobal = process->pool;
512 pconf = process->pconf;
513 ap_server_argv0 = process->short_name;
515
516 /* Set up the OOM callback in the global pool, so all pools should
517 * by default inherit it. */
519
520#if APR_CHARSET_EBCDIC
522 destroy_and_exit_process(process, 1);
523 }
524#endif
525
527 apr_pool_tag(pcommands, "pcommands");
529 sizeof(const char *));
531 sizeof(const char *));
533 sizeof(const char *));
534
536 if (error) {
538 "%s: %s", ap_server_argv0, error);
539 destroy_and_exit_process(process, 1);
540 }
541
542 ap_run_rewrite_args(process);
543
544 /* Maintain AP_SERVER_BASEARGS list in http_main.h to allow the MPM
545 * to safely pass on our args from its rewrite_args() handler.
546 */
547 apr_getopt_init(&opt, pcommands, process->argc, process->argv);
548
549 while ((rv = apr_getopt(opt, AP_SERVER_BASEARGS, &c, &opt_arg))
550 == APR_SUCCESS) {
551 const char **new;
552
553 switch (c) {
554 case 'c':
555 new = (const char **)apr_array_push(ap_server_post_read_config);
557 break;
558
559 case 'C':
560 new = (const char **)apr_array_push(ap_server_pre_read_config);
562 break;
563
564 case 'd':
566 break;
567
568 case 'D':
569 new = (const char **)apr_array_push(ap_server_config_defines);
571 /* Setting -D DUMP_VHOSTS should work like setting -S */
572 if (strcmp(opt_arg, "DUMP_VHOSTS") == 0)
574 /* Setting -D DUMP_RUN_CFG should work like setting -S */
575 else if (strcmp(opt_arg, "DUMP_RUN_CFG") == 0)
577 /* Setting -D DUMP_MODULES is equivalent to setting -M */
578 else if (strcmp(opt_arg, "DUMP_MODULES") == 0)
580 /* Setting -D DUMP_INCLUDES is a type of configuration dump */
581 else if (strcmp(opt_arg, "DUMP_INCLUDES") == 0)
583 break;
584
585 case 'e':
587 usage(process);
588 break;
589
590 case 'E':
592 break;
593
594 case 'X':
595 new = (const char **)apr_array_push(ap_server_config_defines);
596 *new = "DEBUG";
597 break;
598
599 case 'f':
601 break;
602
603 case 'v':
604 printf("Server version: %s\n", ap_get_server_description());
605 printf("Server built: %s\n", ap_get_server_built());
606 destroy_and_exit_process(process, 0);
607
608 case 'l':
610 destroy_and_exit_process(process, 0);
611
612 case 'L':
614 showdirectives = 1;
615 break;
616
617 case 't':
620 break;
621
622 case 'T':
624 break;
625
626 case 'S':
628 new = (const char **)apr_array_push(ap_server_config_defines);
629 *new = "DUMP_VHOSTS";
630 new = (const char **)apr_array_push(ap_server_config_defines);
631 *new = "DUMP_RUN_CFG";
632 break;
633
634 case 'M':
636 new = (const char **)apr_array_push(ap_server_config_defines);
637 *new = "DUMP_MODULES";
638 break;
639
640 case 'V':
641 if (strcmp(ap_show_mpm(), "")) { /* MPM built-in? */
643 destroy_and_exit_process(process, 0);
644 }
645 else {
646 showcompile = 1;
648 }
649 break;
650
651 case 'h':
652 case '?':
653 usage(process);
654 }
655 }
656
659
660 /* bad cmdline option? then we die */
661 if (rv != APR_EOF || opt->ind < opt->argc) {
662 usage(process);
663 }
664
667 apr_pool_tag(plog, "plog");
668 apr_pool_create(&ptemp, pconf);
669 apr_pool_tag(ptemp, "ptemp");
670
671 /* Note that we preflight the config file once
672 * before reading it _again_ in the main loop.
673 * This allows things, log files configuration
674 * for example, to settle down.
675 */
676
678 if (temp_error_log) {
680 }
681 ap_server_conf = NULL; /* set early by ap_read_config() for logging */
682 if (!ap_read_config(process, ptemp, confname, &ap_conftree)) {
683 if (showcompile) {
684 /* Well, we tried. Show as much as we can, but exit nonzero to
685 * indicate that something's not right. The cause should have
686 * already been logged. */
688 }
689 destroy_and_exit_process(process, 1);
690 }
694
695 if (showcompile) { /* deferred due to dynamically loaded MPM */
697 destroy_and_exit_process(process, 0);
698 }
699
700 /* sort hooks here to make sure pre_config hooks are sorted properly */
702
703 if (ap_run_pre_config(pconf, plog, ptemp) != OK) {
705 NULL, APLOGNO(00013) "Pre-configuration failed");
706 destroy_and_exit_process(process, 1);
707 }
708
710 process->pconf, ptemp);
711 if (rv == OK) {
714 /*
715 * Sort hooks again because ap_process_config_tree may have add modules
716 * and hence hooks. This happens with mod_perl and modules written in
717 * perl.
718 */
720
723 NULL, APLOGNO(00014) "Configuration check failed");
724 destroy_and_exit_process(process, 1);
725 }
726
728 if (showdirectives) { /* deferred in case of DSOs */
730 destroy_and_exit_process(process, 0);
731 }
732 else {
735 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, "Syntax OK");
736 }
737 destroy_and_exit_process(process, 0);
738 }
739 }
740
741 /* If our config failed, deal with that here. */
742 if (rv != OK) {
743 destroy_and_exit_process(process, 1);
744 }
745
747 if (signal_server) {
748 int exit_status;
749
750 if (signal_server(&exit_status, pconf) != 0) {
752 }
753 }
754
756
757 if ( ap_run_open_logs(pconf, plog, ptemp, ap_server_conf) != OK) {
759 0, NULL, APLOGNO(00015) "Unable to open logs");
760 destroy_and_exit_process(process, 1);
761 }
762
763 if ( ap_run_post_config(pconf, plog, ptemp, ap_server_conf) != OK) {
765 NULL, APLOGNO(00016) "Configuration Failed");
766 destroy_and_exit_process(process, 1);
767 }
768
769 apr_pool_destroy(ptemp);
770
771 do {
773 reset_process_pconf(process);
774
777 for (mod = ap_prelinked_modules; *mod != NULL; mod++) {
779 }
780
781 /* This is a hack until we finish the code so that it only reads
782 * the config file once and just operates on the tree already in
783 * memory. rbb
784 */
786 apr_pool_create(&ptemp, pconf);
787 apr_pool_tag(ptemp, "ptemp");
789 ap_server_conf = NULL; /* set early by ap_read_config() for logging */
790 if (!ap_read_config(process, ptemp, confname, &ap_conftree)) {
791 destroy_and_exit_process(process, 1);
792 }
796 /* sort hooks here to make sure pre_config hooks are sorted properly */
798
799 if (ap_run_pre_config(pconf, plog, ptemp) != OK) {
801 APLOGNO(00017) "Pre-configuration failed, exiting");
802 destroy_and_exit_process(process, 1);
803 }
804
806 ptemp) != OK) {
807 destroy_and_exit_process(process, 1);
808 }
811 /*
812 * Sort hooks again because ap_process_config_tree may have add modules
813 * and hence hooks. This happens with mod_perl and modules written in
814 * perl.
815 */
817
820 APLOGNO(00018) "Configuration check failed, exiting");
821 destroy_and_exit_process(process, 1);
822 }
823
825 if (ap_run_open_logs(pconf, plog, ptemp, ap_server_conf) != OK) {
827 APLOGNO(00019) "Unable to open logs, exiting");
828 destroy_and_exit_process(process, 1);
829 }
830
831 if (ap_run_post_config(pconf, plog, ptemp, ap_server_conf) != OK) {
833 APLOGNO(00020) "Configuration Failed, exiting");
834 destroy_and_exit_process(process, 1);
835 }
836
837 apr_pool_destroy(ptemp);
839
841
844
846
847 } while (rc == OK);
848
849 if (rc == DONE) {
850 rc = OK;
851 }
852 else if (rc != OK) {
854 "MPM run failed, exiting");
855 }
857
858 /* NOTREACHED */
859 return !OK;
860}
861
862#ifdef AP_USING_AUTOCONF
863/* This ugly little hack pulls any function referenced in exports.c into
864 * the web server. exports.c is generated during the build, and it
865 * has all of the APR functions specified by the apr/apr.exports and
866 * apr-util/aprutil.exports files.
867 */
868const void *ap_suck_in_APR(void);
869const void *ap_suck_in_APR(void)
870{
871 extern const void *ap_ugly_hack;
872
873 return ap_ugly_hack;
874}
875#endif
Symbol export macros and hook functions.
#define DEFAULT_PIDLOG
Definition ap_config.h:144
Apache Multi-Processing Module library.
@ AP_REG_PCRE_LOADED
Definition ap_regex.h:96
@ AP_REG_PCRE_COMPILED
Definition ap_regex.h:95
APR Miscellaneous library routines.
APR Command Arguments (getopt)
APR general purpose library routines.
APR MD5 Routines.
APR Strings library.
APR Thread and Process Library.
APR Time Library.
APR-UTIL URI Routines.
APR Versioning Interface.
#define APR_VERSION_STRING
APR Standard Headers Support.
APR-util Versioning Interface.
#define APU_VERSION_STRING
Definition apu_version.h:93
static apr_pool_t * pconf
Definition event.c:441
ap_directive_t * ap_conftree
Definition config.c:69
void ap_register_hooks(module *m, apr_pool_t *p)
Definition config.c:489
const char * ap_parse_log_level(const char *str, int *val)
Definition log.c:1983
apr_status_t ap_pool_cleanup_set_null(void *data)
Definition util.c:2710
const char * ap_setup_prelinked_modules(process_rec *process)
Definition config.c:763
void ap_run_optional_fn_retrieve(void)
Definition config.c:195
int ap_run_check_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s)
Definition config.c:96
void ap_run_rewrite_args(process_rec *process)
Definition config.c:2379
void ap_show_directives(void)
Definition config.c:2482
void ap_fixup_virtual_hosts(apr_pool_t *p, server_rec *main_server)
Definition config.c:2163
int ap_process_config_tree(server_rec *s, ap_directive_t *conftree, apr_pool_t *p, apr_pool_t *ptemp)
Definition config.c:1956
int ap_run_open_logs(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s)
Definition config.c:163
void ap_run_test_config(apr_pool_t *pconf, server_rec *s)
Definition config.c:100
server_rec * ap_read_config(process_rec *process, apr_pool_t *temp_pool, const char *config_name, ap_directive_t **conftree)
Definition config.c:2294
int ap_run_pre_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp)
Definition config.c:91
int ap_run_post_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s)
Definition config.c:105
const char * ap_show_mpm(void)
Definition mpm_common.c:548
void ap_show_modules(void)
Definition config.c:2500
#define HTTPD_ROOT
Definition httpd.h:91
#define DEFAULT_ERRORLOG
Definition httpd.h:130
const char * ap_get_server_built(void)
Definition buildmark.c:26
#define DYNAMIC_MODULE_LIMIT
Definition httpd.h:119
#define SERVER_CONFIG_FILE
Definition httpd.h:146
const char * ap_get_server_description(void)
Definition core.c:3587
#define OK
Definition httpd.h:456
#define DONE
Definition httpd.h:458
#define AP_TYPES_CONFIG_FILE
Definition httpd.h:228
#define SUEXEC_BIN
Definition httpd.h:156
#define AP_SQ_RM_CONFIG_DUMP
Definition http_core.h:1065
#define AP_SQ_MS_CREATE_PRE_CONFIG
Definition http_core.h:1047
#define AP_SQ_MS_RUN_MPM
Definition http_core.h:1053
#define AP_SQ_MS_CREATE_CONFIG
Definition http_core.h:1051
#define AP_SQ_RM_NORMAL
Definition http_core.h:1061
#define AP_SQ_MS_EXITING
Definition http_core.h:1055
#define AP_SQ_MS_DESTROY_CONFIG
Definition http_core.h:1049
#define AP_SQ_RM_UNKNOWN
Definition http_core.h:1059
#define AP_SQ_RM_CONFIG_TEST
Definition http_core.h:1063
apr_status_t ap_replace_stderr_log(apr_pool_t *p, const char *file)
Definition log.c:248
#define APLOGNO(n)
Definition http_log.h:117
#define APLOG_STARTUP
Definition http_log.h:105
int ap_default_loglevel
Definition log.c:81
#define APLOG_ERR
Definition http_log.h:67
#define ap_log_error
Definition http_log.h:370
#define APLOG_MARK
Definition http_log.h:283
void ap_open_stderr_log(apr_pool_t *p)
Definition log.c:243
#define APLOG_EMERG
Definition http_log.h:64
const char * ap_server_argv0
Definition config.c:60
const char * ap_server_root
Definition config.c:61
apr_pool_t * ap_pglobal
Definition config.c:63
int ap_config_generation
Definition core.c:151
int ap_document_root_check
Definition core.c:137
int ap_main_state
Definition core.c:149
apr_array_header_t * ap_server_pre_read_config
Definition config.c:65
apr_array_header_t * ap_server_config_defines
Definition config.c:67
int ap_run_mode
Definition core.c:150
#define AP_SERVER_BASEARGS
Definition http_main.h:36
apr_array_header_t * ap_server_post_read_config
Definition config.c:66
server_rec * ap_server_conf
Definition config.c:62
#define MODULE_MAGIC_NUMBER_MAJOR
Definition ap_mmn.h:611
#define MODULE_MAGIC_NUMBER_MINOR
Definition ap_mmn.h:613
#define AP_MONCONTROL(x)
Definition ap_mpm.h:255
int ap_run_mpm(apr_pool_t *pconf, apr_pool_t *plog, server_rec *server_conf)
Definition mpm_common.c:97
void ap_clear_auth_internal(void)
Definition request.c:2135
int ap_signal_server(int *, apr_pool_t *)
Definition mpm_unix.c:784
#define APR_EOF
Definition apr_errno.h:461
apr_pool_t const char apr_dbd_t const char ** error
Definition apr_dbd.h:143
#define APR_RETRIEVE_OPTIONAL_FN(name)
#define APR_OPTIONAL_FN_TYPE(name)
apr_redis_t * rc
Definition apr_redis.h:173
void ap_init_rng(apr_pool_t *p)
Definition core.c:5435
#define apr_pool_lock(pool, lock)
Definition apr_pools.h:805
void ap_abort_on_oom(void) __attribute__((noreturn))
Definition util.c:3136
#define ap_assert(exp)
Definition httpd.h:2271
apr_size_t size
#define APR_SUCCESS
Definition apr_errno.h:225
int apr_status_t
Definition apr_errno.h:44
apr_pool_t int argc
Definition apr_getopt.h:104
apr_vformatter_buff_t * c
Definition apr_lib.h:175
apr_int32_t opt
#define apr_pool_create(newpool, parent)
Definition apr_pools.h:322
#define APR_CTIME_LEN
Definition apr_time.h:198
apr_status_t ap_mpm_query(int query_code, int *result)
Definition mpm_common.c:421
#define AP_MPMQ_IS_FORKED
Definition ap_mpm.h:154
#define AP_MPMQ_IS_THREADED
Definition ap_mpm.h:152
#define AP_MPMQ_DYNAMIC
Definition ap_mpm.h:131
#define AP_MPMQ_STATIC
Definition ap_mpm.h:128
Apache Configuration.
CORE HTTP Daemon.
Apache Logging library.
Command line options.
Apache Request library.
Virtual Host package.
HTTP Daemon routines.
static void usage(process_rec *process)
Definition main.c:376
static int abort_on_oom(int retcode)
Definition main.c:275
static void show_mpm_settings(void)
Definition main.c:55
static void show_compile_settings(void)
Definition main.c:95
static void destroy_and_exit_process(process_rec *process, int process_exit_value)
Definition main.c:257
#define TASK_SWITCH_SLEEP
Definition main.c:255
static process_rec * init_process(int *argc, const char *const **argv)
Definition main.c:306
static apr_status_t deregister_all_hooks(void *unused)
Definition main.c:285
static void reset_process_pconf(process_rec *process)
Definition main.c:293
mod_core private header file
const char * argv[3]
return NULL
Definition mod_so.c:359
int main(void)
Definition occhild.c:9
#define DEFAULT_SCOREBOARD
Definition scoreboard.h:43
A structure that represents one process.
Definition httpd.h:829
int argc
Definition httpd.h:839
apr_pool_t * pool
Definition httpd.h:831
const char * short_name
Definition httpd.h:835
apr_pool_t * pconf
Definition httpd.h:833
const char *const * argv
Definition httpd.h:837
apr_status_t apr_ctime(char *date_str, apr_time_t t)
Definition timestr.c:90
Utilities for EBCDIC conversion.
void ap_fini_vhost_config(apr_pool_t *p, server_rec *main_s)
Definition vhost.c:573