February 2011
Intermediate to advanced
332 pages
9h 3m
English
By default, there is no referer log. We can enable the referer log using the access_log directive in combination with a custom log format. To generate the referer log, first of all, we need to create a log format as shown:
logformat referer %ts.%03tu %>a %{Referer}>h %ru This configuration defines a new log format called referer, which contains a request timestamp, IP address of the client, the referer URL, and the request URL. Now, we need to use the access_log directive with the aforementioned constructed log format as shown:
access_log /opt/squid/var/logs/referer.log referer
Now, let's look at a few lines from the referer log file:
1284576601.898 127.0.0.1 http://en.wikipedia.org/wiki/Main_Page http://en.wikiquote.org/wiki/Main_Page ...
Read now
Unlock full access