I\'m trying to figure out what is the full complete configuration of an httpd setup.
All the configurations files are scattered in different files (/etc/httpd/conf.d,
When I had to maintain too many Apache configurations, I'd equipped myself with a script that did what you asked. It helped me a lot.
awk -v pc=$APCALL '
NR == 1 {
if (pf != "") {
print "### End of " pf " ###"
}
print "### " FILENAME " ###"
pf = FILENAME
}
{ if (pc || ( $1 !~ "^#" && $0 != "" ) ) {
printf "%5d %s\n", NR, $0
}
}
$1 ~ /^Include(Optional)?$/ {
$1 = ""
system("for ACF in " $0 "; do apache_config.sh $ACF; done" )
}
END {
print "### End of " pf " ###"
}
' "$@"
You can set APCALL environment variable if you want to see the comments and empty lines, which I mostly didn't. Caveat: it has to be executed from ServerRoot.