Configuration Logging

Apache is able to report to a client a great deal of what is happening to it internally. The necessary module is contained in the mod_info.c file, which should be included at build time. It provides a comprehensive overview of the server configuration, including all installed modules and directives in the configuration files. This module is not compiled into the server by default. To enable it, either load the corresponding module if you are running Win32 or Unix with DSO support enabled, or add the following line to the server build Config file and rebuild the server:

AddModule modules/standard/mod_info.o

It should also be noted that if mod_info is compiled into the server, its handler capability is available in all configuration files, including per-directory files (e.g., .htaccess). This may have security-related ramifications for your site. To demonstrate how this facility can be applied to any site, the Config file on .../site.info is the .../site.authent file slightly modified:

User webuser Group webgroup ServerName www.butterthlies.com NameVirtualHost 192.168.123.2 LogLevel debug <VirtualHost www.butterthlies.com> #CookieLog logs/cookies AddModuleInfo mod_setenvif.c "This is what I've added to mod_setenvif" ServerAdmin sales@butterthlies.com DocumentRoot /usr/www/APACHE3/site.info/htdocs/customers ServerName www.butterthlies.com ErrorLog /usr/www/APACHE3/site.info/logs/error_log TransferLog /usr/www/APACHE3/site.info/logs/customers/access_log ScriptAlias ...

Get Apache: The Definitive Guide, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.