<dd>Process the configuration <var>directive</var> after reading config
files.</dd>
-
<dt><code>-D <var>parameter</var></code></dt>
<dd>Sets a configuration <var>parameter </var>which can be used with
<dt><code>-t</code></dt>
<dd>Run syntax tests for configuration files only. The program
-immediately exits after these syntax parsing tests with either a return code
-of 0 (Syntax OK) or return code not equal to 0 (Syntax Error). If -D
-<var>DUMP</var>_<var>VHOSTS </var>is also set, details of the virtual host
-configuration will be printed. If -D <var>DUMP</var>_<var>MODULES </var> is
-set, all loaded modules will be printed. If -D <var>DUMP</var>_<var>CERTS </var>
-is set and <module>mod_ssl</module> is used, configured SSL certificates will
-be printed. If -D <var>DUMP</var>_<var>CA</var>_<var>_CERTS </var> is set and
-<module>mod_ssl</module> is used, configured SSL CA certificates and configured
-directories containing SSL CA certificates will be printed.</dd>
+immediately exits after these syntax parsing tests with either a
+return code of 0 (Syntax OK) or return code not equal to 0 (Syntax
+Error). This option can be combined with various <var>-D
+DUMP_...</var> arguments to print information about the configuration,
+<a href="#dumpconf">as listed below</a>.</dd>
<dt><code>-v</code></dt>
</section>
+<section id="dumpconf"><title>Dumping configuration data</title>
+
+<p>The following options can be combined with <var>-t</var> to show
+information about the configuration:</p>
+
+<dl>
+ <dt><var>-D DUMP_VHOSTS</var></dt> <dd>print details of the virtual
+ host configuration.</dd>
+
+ <dt><var>-D DUMP_MODULES</var></dt> <dd>print (human-readable)
+ details of all loaded modules.</dd>
+
+ <dt><var>-D DUMP_MODULES</var> <var>-D DUMP_MODULE_DATA</var></dt>
+ <dd>print details of all loaded modules in a structured (TOML) format.</dd>
+
+ <dt><var>-D DUMP_CERTS</var></dt>
+ <dd>If <module>mod_ssl</module> is loaded, print details of
+ configured SSL/TLS certificates.</dd>
+</dl>
+</section>
+
</manualpage>
return NULL;
}
+/* Print structured module data in TOML format for -D DUMP_MODULE_DATA
+ * output. */
+static void print_mod_data(apr_file_t *out, int is_static,
+ const ap_module_symbol_t *modsym)
+{
+ const char *name = modsym->name;
+ const module *mod = modsym->modp;
+
+ apr_file_printf(out, "%s.static = %d\n", name, is_static);
+ apr_file_printf(out, "%s.source = \"%s\"\n", name, mod->name);
+ apr_file_printf(out, "%s.major = %d\n", name, mod->version);
+ apr_file_printf(out, "%s.minor = %d\n", name, mod->minor_version);
+}
+
static void dump_loaded_modules(apr_pool_t *p, server_rec *s)
{
ap_module_symbol_t *modie;
ap_module_symbol_t *modi;
so_server_conf *sconf;
- int i;
+ int i, toml = ap_exists_config_define("DUMP_MODULE_DATA");
apr_file_t *out = NULL;
if (!ap_exists_config_define("DUMP_MODULES")) {
apr_file_open_stdout(&out, p);
- apr_file_printf(out, "Loaded Modules:\n");
+ if (!toml) apr_file_printf(out, "Loaded Modules:\n");
sconf = (so_server_conf *)ap_get_module_config(s->module_config,
&so_module);
for (i = 0; ; i++) {
modi = &ap_prelinked_module_symbols[i];
if (modi->name != NULL) {
- apr_file_printf(out, " %s (static)\n", modi->name);
+ if (toml)
+ print_mod_data(out, 1, modi);
+ else
+ apr_file_printf(out, " %s (static)\n", modi->name);
}
else {
break;
for (i = 0; i < sconf->loaded_modules->nelts; i++) {
modi = &modie[i];
if (modi->name != NULL) {
- apr_file_printf(out, " %s (shared)\n", modi->name);
+ if (toml)
+ print_mod_data(out, 0, modi);
+ else
+ apr_file_printf(out, " %s (shared)\n", modi->name);
}
}
}