httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Gross <>
Subject I am a bit confused about the configuration steps
Date Sat, 26 May 2001 14:42:11 GMT
I am writing a module and am seeing how things are loaded and the
configuration is read.  Consider the case of a dynamically loaded
module that has some command directives within the httpd.conf file.
Next consider the following sources from server/main.c

    ap_server_root = def_server_root;
    server_conf = ap_read_config(process, ptemp, confname,
    ap_run_pre_config(pconf, plog, ptemp);
    ap_process_config_tree(server_conf, ap_conftree, process->pconf,
    ap_fixup_virtual_hosts(pconf, server_conf);
    ap_fini_vhost_config(pconf, server_conf);
    if (configtestonly) {
NULL, "Syntax OK\n");
	destroy_and_exit_process(process, 0);
    ap_run_open_logs(pconf, plog, ptemp, server_conf);
    ap_run_post_config(pconf, plog, ptemp, server_conf);

According to this source I would guess that the httpd.conf file is
read (ap_read_config).  Then before any configuration is performed the
pre_config hooks are called.  Then the configurations are read and the
post_config hook is called.

But that is not what I am seeing happening in Apache.  In the
ap_read_config step my module is loaded and any command directive that
the module has are also read in at that point.  This means my command
directive is hit before the pre_config is hit.  It seems a bit
incorrect since I thought the pre_config hook was an initializer that
can be used to setup the module.  Right now I am using the
register_hooks function as an initializer.

Am I missing something here?

Christian Gross

View raw message