I have a script (alas, in Perl; forgive me, its old) that flattens the configuration files, removes comments (by default) and includes # FILE
comments so you can figure out which file contains the thing you might be looking for.
I've written it with Apache httpd, although its also seen use with Oracle OHS
https://github.com/cameronkerrnz/scriptorium/blob/master/httpd-dump-config
Particularly useful for comparing configurations on different machines with SSH and diff/meld/etc.
Example:
httpd-dump-config | grep -i -e '# FILE:' -e servername -e serveralias
# FILE: /etc/httpd/conf/maintenance-curtain.conf
# FILE: /etc/httpd/conf.d/proxy.conf
# FILE: /etc/httpd/otago/secure-www.alias.conf
# FILE: /etc/httpd/conf.d/proxy.conf
ServerName www.otago.ac.nz
ServerAlias otago.ac.nz
Here's an example using diff (CLI) and meld (GUI):
diff -Bb <(httpd-dump-config) <(ssh root@revproxy2 httpd-dump-config)
meld <(httpd-dump-config) <(ssh root@revproxy2 httpd-dump-config) &
I've used this a lot over the years when navigating a config with thousands of lines of config spread over many files.
apachectl -S
for running config,apachectl -M
to show loaded modulesapachectl -S
does give you neither "the full complete configuration" nor " the whole running setup configuration in a single file".