View | Details | Raw Unified | Return to bug 51680
Collapse All | Expand All

(-)httpd-2.2.19-orig/include/http_main.h (-1 / +1 lines)
Lines 32-38 Link Here
32
 * in apr_getopt() format.  Use this for default'ing args that the MPM
32
 * in apr_getopt() format.  Use this for default'ing args that the MPM
33
 * can safely ignore and pass on from its rewrite_args() handler.
33
 * can safely ignore and pass on from its rewrite_args() handler.
34
 */
34
 */
35
#define AP_SERVER_BASEARGS "C:c:D:d:E:e:f:vVlLtTSMh?X"
35
#define AP_SERVER_BASEARGS "C:c:D:d:E:e:f:vVlLtTSZMh?X"
36
36
37
#ifdef __cplusplus
37
#ifdef __cplusplus
38
extern "C" {
38
extern "C" {
(-)httpd-2.2.19-orig/server/main.c (-29 / +42 lines)
Lines 353-440 Link Here
353
#endif /* AP_MPM_WANT_SET_GRACEFUL_SHUTDOWN */
353
#endif /* AP_MPM_WANT_SET_GRACEFUL_SHUTDOWN */
354
#endif
354
#endif
355
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
355
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
356
                 "       %*s [-v] [-V] [-h] [-l] [-L] [-t] [-T] [-S]",
356
                 "       %*s [-v] [-V] [-h] [-l] [-L] [-t] [-T] [-S] [-Z]",
357
                 pad_len, " ");
357
                 pad_len, " ");
358
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
358
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
359
                 "Options:");
359
                 "Options:");
360
360
361
#ifdef SHARED_CORE
361
#ifdef SHARED_CORE
362
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
362
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
363
                 "  -R directory       : specify an alternate location for "
363
                 "  -R directory            : specify an alternate location for "
364
                 "shared object files");
364
                 "shared object files");
365
#endif
365
#endif
366
366
367
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
367
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
368
                 "  -D name            : define a name for use in "
368
                 "  -D name                 : define a name for use in "
369
                 "<IfDefine name> directives");
369
                 "<IfDefine name> directives");
370
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
370
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
371
                 "  -d directory       : specify an alternate initial "
371
                 "  -d directory            : specify an alternate initial "
372
                 "ServerRoot");
372
                 "ServerRoot");
373
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
373
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
374
                 "  -f file            : specify an alternate ServerConfigFile");
374
                 "  -f file                 : specify an alternate ServerConfigFile");
375
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
375
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
376
                 "  -C \"directive\"     : process directive before reading "
376
                 "  -C \"directive\"          : process directive before reading "
377
                 "config files");
377
                 "config files");
378
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
378
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
379
                 "  -c \"directive\"     : process directive after reading "
379
                 "  -c \"directive\"          : process directive after reading "
380
                 "config files");
380
                 "config files");
381
381
382
#ifdef NETWARE
382
#ifdef NETWARE
383
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
383
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
384
                 "  -n name            : set screen name");
384
                 "  -n name                 : set screen name");
385
#endif
385
#endif
386
#ifdef WIN32
386
#ifdef WIN32
387
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
387
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
388
                 "  -n name            : set service name and use its "
388
                 "  -n name                 : set service name and use its "
389
                 "ServerConfigFile");
389
                 "ServerConfigFile");
390
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
390
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
391
                 "  -k start           : tell Apache to start");
391
                 "  -k start                : tell Apache to start");
392
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
392
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
393
                 "  -k restart         : tell running Apache to do a graceful "
393
                 "  -k restart              : tell running Apache to do a graceful "
394
                 "restart");
394
                 "restart");
395
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
395
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
396
                 "  -k stop|shutdown   : tell running Apache to shutdown");
396
                 "  -k stop|shutdown        : tell running Apache to shutdown");
397
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
397
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
398
                 "  -k install         : install an Apache service");
398
                 "  -k install              : install an Apache service");
399
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
399
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
400
                 "  -k config          : change startup Options of an Apache "
400
                 "  -k config               : change startup Options of an Apache "
401
                 "service");
401
                 "service");
402
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
402
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
403
                 "  -k uninstall       : uninstall an Apache service");
403
                 "  -k uninstall            : uninstall an Apache service");
404
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
404
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
405
                 "  -w                 : hold open the console window on error");
405
                 "  -w                      : hold open the console window on error");
406
#endif
406
#endif
407
407
408
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
408
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
409
                 "  -e level           : show startup errors of level "
409
                 "  -e level                : show startup errors of level "
410
                 "(see LogLevel)");
410
                 "(see LogLevel)");
411
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
411
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
412
                 "  -E file            : log startup errors to file");
412
                 "  -E file                 : log startup errors to file");
413
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
413
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
414
                 "  -v                 : show version number");
414
                 "  -v                      : show version number");
415
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
415
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
416
                 "  -V                 : show compile settings");
416
                 "  -V                      : show compile settings");
417
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
417
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
418
                 "  -h                 : list available command line options "
418
                 "  -h                      : list available command line options "
419
                 "(this page)");
419
                 "(this page)");
420
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
420
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
421
                 "  -l                 : list compiled in modules");
421
                 "  -l                      : list compiled in modules");
422
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
422
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
423
                 "  -L                 : list available configuration "
423
                 "  -L                      : list available configuration "
424
                 "directives");
424
                 "directives");
425
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
425
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
426
                 "  -t -D DUMP_VHOSTS  : show parsed settings (currently only "
426
                 "  -t -D DUMP_VHOSTS       : show parsed settings (currently only "
427
                 "vhost settings)");
427
                 "vhost settings)");
428
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
428
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
429
                 "  -S                 : a synonym for -t -D DUMP_VHOSTS");
429
                 "  -S                      : a synonym for -t -D DUMP_VHOSTS");
430
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
430
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
431
                 "  -t -D DUMP_MODULES : show all loaded modules ");
431
                 "  -t -D DUMP_VHOSTS_ALIAS : show parsed settings (vhost and aliases)");
432
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
432
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
433
                 "  -M                 : a synonym for -t -D DUMP_MODULES");
433
                 "  -Z                      : a synonym for -t -D DUMP_VHOSTS_ALIAS");
434
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
434
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
435
                 "  -t                 : run syntax check for config files");
435
                 "  -t -D DUMP_MODULES      : show all loaded modules ");
436
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
436
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
437
                "  -T                 : start without DocumentRoot(s) check");
437
                 "  -M                      : a synonym for -t -D DUMP_MODULES");
438
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
439
                 "  -t                      : run syntax check for config files");
440
    ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
441
                 "  -T                      : start without DocumentRoot(s) check");
438
442
439
    destroy_and_exit_process(process, 1);
443
    destroy_and_exit_process(process, 1);
440
}
444
}
Lines 518-523 Link Here
518
            /* Setting -D DUMP_VHOSTS is equivalent to setting -S */
522
            /* Setting -D DUMP_VHOSTS is equivalent to setting -S */
519
            if (strcmp(optarg, "DUMP_VHOSTS") == 0)
523
            if (strcmp(optarg, "DUMP_VHOSTS") == 0)
520
                configtestonly = 1;
524
                configtestonly = 1;
525
            /* Setting -D DUMP_VHOSTS_ALIAS is equivalent to setting -Z */
526
            if (strcmp(optarg, "DUMP_VHOSTS_ALIAS") == 0)
527
                configtestonly = 1;
521
            /* Setting -D DUMP_MODULES is equivalent to setting -M */
528
            /* Setting -D DUMP_MODULES is equivalent to setting -M */
522
            if (strcmp(optarg, "DUMP_MODULES") == 0)
529
            if (strcmp(optarg, "DUMP_MODULES") == 0)
523
                configtestonly = 1;
530
                configtestonly = 1;
Lines 597-602 Link Here
597
            *new = "DUMP_VHOSTS";
604
            *new = "DUMP_VHOSTS";
598
            break;
605
            break;
599
606
607
       case 'Z':
608
            configtestonly = 1;
609
            new = (char **)apr_array_push(ap_server_config_defines);
610
            *new = "DUMP_VHOSTS_ALIAS";
611
            break;
612
600
        case 'M':
613
        case 'M':
601
            configtestonly = 1;
614
            configtestonly = 1;
602
            new = (char **)apr_array_push(ap_server_config_defines);
615
            new = (char **)apr_array_push(ap_server_config_defines);
(-)httpd-2.2.19-orig/server/vhost.c (-6 / +34 lines)
Lines 402-413 Link Here
402
    return NULL;
402
    return NULL;
403
}
403
}
404
404
405
static void dump_a_vhost(apr_file_t *f, ipaddr_chain *ic)
405
static void dump_a_vhost(apr_file_t *f, ipaddr_chain *ic, unsigned int extended)
406
{
406
{
407
    name_chain *nc;
407
    name_chain *nc;
408
    int len;
408
    int len, i;
409
    char buf[MAX_STRING_LEN];
409
    char buf[MAX_STRING_LEN];
410
    apr_sockaddr_t *ha = ic->sar->host_addr;
410
    apr_sockaddr_t *ha = ic->sar->host_addr;
411
    apr_array_header_t *names;
411
412
412
    if (ha->family == APR_INET &&
413
    if (ha->family == APR_INET &&
413
        ha->sa.sin.sin_addr.s_addr == DEFAULT_VHOST_ADDR) {
414
        ha->sa.sin.sin_addr.s_addr == DEFAULT_VHOST_ADDR) {
Lines 445-454 Link Here
445
        apr_file_printf(f, "namevhost %s (%s:%u)\n",
446
        apr_file_printf(f, "namevhost %s (%s:%u)\n",
446
                        nc->server->server_hostname,
447
                        nc->server->server_hostname,
447
                        nc->server->defn_name, nc->server->defn_line_number);
448
                        nc->server->defn_name, nc->server->defn_line_number);
449
450
	if(extended && (nc->server->names->nelts || nc->server->wild_names->nelts)) {
451
	    apr_file_printf(f,"%16s alias ", "");
452
            names = nc->server->names;
453
            if (names) {
454
                char **name = (char **) names->elts;
455
                for (i = 0; i < names->nelts; ++i) {
456
                    if(!name[i]) continue;
457
                    apr_file_printf(f, "%s ", name[i]);
458
                }
459
            }
460
            names = nc->server->wild_names;
461
            if (names) {
462
                char **name = (char **) names->elts;
463
                for (i = 0; i < names->nelts; ++i) {
464
                    if(!name[i]) continue;
465
                    apr_file_printf(f, "%s ", name[i]);
466
                }
467
	    }
468
            apr_file_printf(f,"\n");
469
	}
448
    }
470
    }
449
}
471
}
450
472
451
static void dump_vhost_config(apr_file_t *f)
473
static void dump_vhost_config(apr_file_t *f, unsigned int extended)
452
{
474
{
453
    ipaddr_chain *ic;
475
    ipaddr_chain *ic;
454
    int i;
476
    int i;
Lines 456-468 Link Here
456
    apr_file_printf(f, "VirtualHost configuration:\n");
478
    apr_file_printf(f, "VirtualHost configuration:\n");
457
    for (i = 0; i < IPHASH_TABLE_SIZE; ++i) {
479
    for (i = 0; i < IPHASH_TABLE_SIZE; ++i) {
458
        for (ic = iphash_table[i]; ic; ic = ic->next) {
480
        for (ic = iphash_table[i]; ic; ic = ic->next) {
459
            dump_a_vhost(f, ic);
481
            dump_a_vhost(f, ic, extended);
460
        }
482
        }
461
    }
483
    }
462
    if (default_list) {
484
    if (default_list) {
463
        apr_file_printf(f, "wildcard NameVirtualHosts and _default_ servers:\n");
485
        apr_file_printf(f, "wildcard NameVirtualHosts and _default_ servers:\n");
464
        for (ic = default_list; ic; ic = ic->next) {
486
        for (ic = default_list; ic; ic = ic->next) {
465
            dump_a_vhost(f, ic);
487
            dump_a_vhost(f, ic, extended);
466
        }
488
        }
467
    }
489
    }
468
}
490
}
Lines 678-685 Link Here
678
    if (ap_exists_config_define("DUMP_VHOSTS")) {
700
    if (ap_exists_config_define("DUMP_VHOSTS")) {
679
        apr_file_t *thefile = NULL;
701
        apr_file_t *thefile = NULL;
680
        apr_file_open_stdout(&thefile, p);
702
        apr_file_open_stdout(&thefile, p);
681
        dump_vhost_config(thefile);
703
        dump_vhost_config(thefile,0);
682
    }
704
    }
705
    if (ap_exists_config_define("DUMP_VHOSTS_ALIAS")) {
706
        apr_file_t *thefile = NULL;
707
        apr_file_open_stdout(&thefile, p);
708
        dump_vhost_config(thefile,1);
709
    }
710
683
}
711
}
684
712
685
713

Return to bug 51680