10

Is there a command / tool to generate the computed configuration that Apache httpd is using? I know I can manually go through the httpd.conf and other configuration files, but is there a standard tool to generate a configuration of all included files and sections that apply, for convenience?

Thanks,

James

Edit: I should also have mentioned I'm also using a Windows x-64 version of Apache, from a pre-built binary.

2 Answers2

5

There is an Apache module available which shows a detailled page with various settings and the active configuration.

mod_info is disabled by default and must be enabled with ./configure --enable-info when building Apache. On Debian and Ubuntu, this module and its configuration can be enabled using sudo a2enmod info.

Put the next lines in your configuration file (httpd.conf) (not necessary when using a2enmod):

<Location /server-info>
    SetHandler server-info
</Location>

After restarting the server, the configuration file is available at http://example.com/server-info?config (replace example.com with your server address)

Note that this information is quite sensitive, you might want to restrict access as in:

<Location /server-info>
  SetHandler server-info
  Order deny,allow
  Deny from all
  Allow from yourcompany.com
</Location>

For more information, see http://httpd.apache.org/docs/2.2/mod/mod_info.html

Lekensteyn
  • 6,445
0

With mod_info enabled:

apache2ctl -DDUMP_CONFIG|grep -vE "^[ ]*#[ ]*"

source: https://stackoverflow.com/a/51585410/936512

OR try: https://serverfault.com/a/743425/166429 (I have not tried this myself)

klaus thorn
  • 378
  • 4
  • 12