Adding the vhost to the Apache access_log

Published on Author adventurerLeave a comment

If you are using Apache to host multiple sites with virtual hosting or vhosts, then by default the log output will not show which sites each log entry refers to. To change this edit the following in /etc/httpd/conf/httpd.conf:

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined 

to read:

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %v" combined 

Leave a Reply

Your e-mail address will not be published. Required fields are marked *