Apache2 commands are divided into two types based on the input source: Command-Directive, which is input through the-C/-C parameter in the command line, and resource-Directive, is configured in the configuration file. The two commands are merged and saved to the conftree.
Process_command_config
Ap_process_resource_config
Command access steps:
1. Read the file HTTP. conf to the memory. The result of this operation is in the global variable defined in the tree ap_conftree (config. C.
Ap_read_config (process, ptemp, confname, & ap_conftree );
2. traverse the ap_conftree tree and execute the registration command.
Ap_pai_config (conftree, & parms, S-> lookup_defaults );
In the above two steps, we can use two hooks to influenceProgramBehavior:
// Read the configuration file to the memory and parse the command before
Ap_hook_pre_config (my_shm_create_handler, null, null, apr_hook_middle );
// After parsing the command
Ap_hook_post_config (my_conftree_restore_handler, null, null, apr_hook_middle );
So you can use it as an XML parser.