O'Reilly logo

Apache: The Definitive Guide, Second Edition by Peter Laurie, Ben Laurie

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

11.5. Logging the Action

Apache offers a wide range of options for controlling the format of the log files. In line with current thinking, older methods (RefererLog, AgentLog, and CookieLog) have now been replaced by the config_log_module. To illustrate this, we have taken ... /site.authent and copied it to ... /site.logging so that we can play with the logs:

User webuser Group webgroup ServerName www.butterthlies.com IdentityCheck on NameVirtualHost 192.168.123.2 <VirtualHost www.butterthlies.com> LogFormat "customers: host %h, logname %l, user %u, time %t, request %r, status %s,bytes %b," CookieLog logs/cookies ServerAdmin sales@butterthlies.com DocumentRoot /usr/www/site.logging/htdocs/customers ServerName www.butterthlies.com ErrorLog /usr/www/site.logging/logs/customers/error_log TransferLog /usr/www/site.logging/logs/customers/access_log ScriptAlias /cgi_bin /usr/www/cgi_bin </VirtualHost> <VirtualHost sales.butterthlies.com> LogFormat "sales: agent %{httpd_user_agent}i, cookie: %{http_Cookie}i, referer: %{Referer}o, host %!200h, logname %!200l, user %u, time %t, request %r, status %s,bytes %b," CookieLog logs/cookies ServerAdmin sales_mgr@butterthlies.com DocumentRoot /usr/www/site.logging/htdocs/salesmen ServerName sales.butterthlies.com ErrorLog /usr/www/site.logging/logs/salesmen/error_log TransferLog /usr/www/site.logging/logs/salesmen/access_log ScriptAlias /cgi_bin /usr/www/cgi_bin <Directory /usr/www/site.logging/htdocs/salesmen> AuthType Basic AuthName darkness ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required