Webserver access log file

1 post / 0 new
#1 Thu, 11/05/2015 - 20:56
adephue

Webserver access log file

We have Virtualmin GPL running and are having an issue where Virtualmin is incorrectly identifying the correct value for "Webserver access log file" Located in Server Configuration >> Website Options.

A sample VHost would look like this:

[...] Include inc/extra-logging.inc CustomLog /var/log/virtualmin/some-domain.com_access_log [...]

The extra-loggin.inc file has a series of SetEnvIf directives, as well as CustomLog directives that are used to log certain requests to certain log files. A sample extra-logging.inc could look like this

SetEnvIf Request_URI xmlrpc.php$ xmlrpc=1 SetEnvIf xmlrpc 1 xmlrpc_log CustomLog /var/log/extra/xmlrpc.log combined env=xmlrpc_log

The idea is to log all requests to xmlrpc.php to /var/log/extra/xmlrpc.php. If we go to Services >> Configure Website >> Show Directives, we see that the directives list what is in httpd.conf first, then the contents of in/extra-logging.inc, which is where "CustomLog /var/log/extra/xmlrpc.log combined env=xmlrpc_log" is located.

It seems that when there is an included configuration file in the vhost, regardless of whether or not the Include directive happens before or after the CustomLog directive (that has the main vhost log file in /var/log/virtualmin/[DOMAIN]_access_log), the included content is parsed last and the last CustomLog directive is the one assumed to belong in the "Webserver access log file" option.