How can I view the complete httpd configuration?

前端 未结 5 1528
梦谈多话
梦谈多话 2021-01-30 15:48

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,

5条回答
  •  轮回少年
    2021-01-30 16:18

    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.

提交回复
热议问题