<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.saruman.biz/saruwiki/index.php?action=history&amp;feed=atom&amp;title=Apache2_and_Visitor</id>
	<title>Apache2 and Visitor - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.saruman.biz/saruwiki/index.php?action=history&amp;feed=atom&amp;title=Apache2_and_Visitor"/>
	<link rel="alternate" type="text/html" href="https://www.saruman.biz/saruwiki/index.php?title=Apache2_and_Visitor&amp;action=history"/>
	<updated>2026-05-02T11:01:24Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://www.saruman.biz/saruwiki/index.php?title=Apache2_and_Visitor&amp;diff=2475&amp;oldid=prev</id>
		<title>Saruman!: added location note</title>
		<link rel="alternate" type="text/html" href="https://www.saruman.biz/saruwiki/index.php?title=Apache2_and_Visitor&amp;diff=2475&amp;oldid=prev"/>
		<updated>2009-12-29T08:27:40Z</updated>

		<summary type="html">&lt;p&gt;added location note&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 08:27, 29 December 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l28&quot;&gt;Line 28:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 28:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# if you only have one site, or you want all the logs in a single report&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# if you only have one site, or you want all the logs in a single report&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;/bin/grep $GREPOPTIONS $ALOGDIR/access*.log{.1,} 2&amp;gt;/dev/null &amp;gt; $TMPFILE # get all the logs into the tmpfile, notice the GREPOPTIONS variable.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;# &lt;/ins&gt;/bin/grep $GREPOPTIONS $ALOGDIR/access*.log{.1,} 2&amp;gt;/dev/null &amp;gt; $TMPFILE # get all the logs into the tmpfile, notice the GREPOPTIONS variable.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# resolve all the ips and generate the reports, note that &amp;quot;--trails --prefix http://www.domain.com&amp;quot; is optional it&amp;#039;s only needed for generating trails stats&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# resolve all the ips and generate the reports, note that &amp;quot;--trails --prefix http://www.domain.com&amp;quot; is optional it&amp;#039;s only needed for generating trails stats&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;($IP2H &amp;lt; $TMPFILE ) | $VISITORS --trails --prefix http://www.domain.com - &amp;gt; $REPORTDIR/stats.html   &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;# &lt;/ins&gt;($IP2H &amp;lt; $TMPFILE ) | $VISITORS --trails --prefix http://www.domain.com - &amp;gt; $REPORTDIR/stats.html   &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# -OR-&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# -OR-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# if you have multiple vhosts/prefixes and want separate reports, you can use this:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# if you have multiple vhosts/prefixes and want separate reports, you can use this:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# replace all the &quot;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;www prefix1 prefix2 prefix3&lt;/del&gt;&quot; by your own prefixes (as in &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;http://PREFIX&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;domain.com&lt;/del&gt;)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# replace all the &quot;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;saruman.biz mediawikifarm.nl&lt;/ins&gt;&quot; by your own prefixes (as &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;they appear &lt;/ins&gt;in &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;the apache&lt;/ins&gt;.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;conf for each vhost&lt;/ins&gt;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;for name in &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;www prefix1 prefix2 prefix3&lt;/del&gt;; do&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;for name in &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;saruman.biz mediawikifarm.nl&lt;/ins&gt;; do&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   /bin/grep $GREPOPTIONS $ALOGDIR/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;access-&lt;/del&gt;$name.log{.1,} 2&amp;gt;/dev/null &amp;gt; $TMPFILE&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   /bin/grep $GREPOPTIONS $ALOGDIR/$name&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;-access&lt;/ins&gt;.log{.1,} 2&amp;gt;/dev/null &amp;gt; $TMPFILE&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   ($IP2H &amp;lt; $TMPFILE ) | $VISITORS --trails --prefix http://$name&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;.domain.com &lt;/del&gt;- &amp;gt; $REPORTDIR/stats-$name.html&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   ($IP2H &amp;lt; $TMPFILE ) | $VISITORS --trails --prefix http://$name - &amp;gt; $REPORTDIR/stats-$name.html&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;done&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;done&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;rm -f $TMPFILE&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;rm -f $TMPFILE&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Note that the resulting files get stored in &#039;&#039;/var/www/webstats&#039;&#039; and are readable for world. You could thus simply create a symlink somewhere in the directory tree of your website that links to these statistics (provided your apache configuration follows symlinks). Note that you might want to protect your statistics in some way, like with &#039;&#039;.htaccess&#039;&#039;.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Saruman!</name></author>
	</entry>
	<entry>
		<id>https://www.saruman.biz/saruwiki/index.php?title=Apache2_and_Visitor&amp;diff=2474&amp;oldid=prev</id>
		<title>Saruman!: page created</title>
		<link rel="alternate" type="text/html" href="https://www.saruman.biz/saruwiki/index.php?title=Apache2_and_Visitor&amp;diff=2474&amp;oldid=prev"/>
		<updated>2009-12-29T06:17:51Z</updated>

		<summary type="html">&lt;p&gt;page created&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Visitor is an Apache2 log analyzer that can show which people visited your website. I found a simple cron-based setup [http://www.codealpha.net/441/easy-apache-log-statistics-using-visitors/ here]. The setup for our Debian system goes like this:&lt;br /&gt;
&lt;br /&gt;
First install &amp;#039;&amp;#039;ip2host&amp;#039;&amp;#039; and &amp;#039;&amp;#039;visitor&amp;#039;&amp;#039; using the well understood&lt;br /&gt;
 sudo apt-get install ip2host visitor&lt;br /&gt;
It will install the two requested packages, and probably also some extra packages like &amp;#039;&amp;#039;graphviz&amp;#039;&amp;#039; and &amp;#039;&amp;#039;ttf-liberation&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Next we create a cache directory for &amp;#039;&amp;#039;ip2host&amp;#039;&amp;#039;&lt;br /&gt;
 sudo mkdir /var/cache/ip2host&lt;br /&gt;
&lt;br /&gt;
Then we create the following script, which we save in &amp;#039;&amp;#039;/etc/cron.daily/visitors&amp;#039;&amp;#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
 &lt;br /&gt;
MYIP=&amp;quot;192.168&amp;quot; # i want to exclude my home network from the logs&lt;br /&gt;
SERVERIP=&amp;quot;222.222.222.222&amp;quot; # my server&amp;#039;s ip&lt;br /&gt;
REPORTDIR=&amp;quot;/var/www/webstats&amp;quot; # folder where to store reports, this folder must exist&lt;br /&gt;
ALOGDIR=&amp;quot;/var/log/apache2&amp;quot; # folder containing the logs&lt;br /&gt;
VISITORS=&amp;quot;/usr/bin/visitors -A --exclude wp-cron.php --exclude robots.txt&amp;quot; # i exclude some files from the reports&lt;br /&gt;
IP2H=&amp;quot;ip2host --cache=/var/cache/ip2host/cache.db&amp;quot;&lt;br /&gt;
GREPOPTIONS=&amp;quot;-hv -e ^$MYIP -e ^$SERVERIP&amp;quot; # exclude my home network and my server&amp;#039;s ip from the logs&lt;br /&gt;
 &lt;br /&gt;
# we create a tmp file that will hold the logs&lt;br /&gt;
TMPFILE=$(mktemp)&lt;br /&gt;
if [[ ! -f &amp;quot;$TMPFILE&amp;quot; ]]; then&lt;br /&gt;
  echo &amp;quot;tmpfile doesn&amp;#039;t exist.&amp;quot;&lt;br /&gt;
  exit 1&lt;br /&gt;
fi&lt;br /&gt;
 &lt;br /&gt;
# if you only have one site, or you want all the logs in a single report&lt;br /&gt;
/bin/grep $GREPOPTIONS $ALOGDIR/access*.log{.1,} 2&amp;gt;/dev/null &amp;gt; $TMPFILE # get all the logs into the tmpfile, notice the GREPOPTIONS variable.&lt;br /&gt;
# resolve all the ips and generate the reports, note that &amp;quot;--trails --prefix http://www.domain.com&amp;quot; is optional it&amp;#039;s only needed for generating trails stats&lt;br /&gt;
($IP2H &amp;lt; $TMPFILE ) | $VISITORS --trails --prefix http://www.domain.com - &amp;gt; $REPORTDIR/stats.html  &lt;br /&gt;
 &lt;br /&gt;
# -OR-&lt;br /&gt;
# if you have multiple vhosts/prefixes and want separate reports, you can use this:&lt;br /&gt;
# replace all the &amp;quot;www prefix1 prefix2 prefix3&amp;quot; by your own prefixes (as in http://PREFIX.domain.com)&lt;br /&gt;
for name in www prefix1 prefix2 prefix3; do&lt;br /&gt;
  /bin/grep $GREPOPTIONS $ALOGDIR/access-$name.log{.1,} 2&amp;gt;/dev/null &amp;gt; $TMPFILE&lt;br /&gt;
  ($IP2H &amp;lt; $TMPFILE ) | $VISITORS --trails --prefix http://$name.domain.com - &amp;gt; $REPORTDIR/stats-$name.html&lt;br /&gt;
done&lt;br /&gt;
 &lt;br /&gt;
rm -f $TMPFILE&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Saruman!</name></author>
	</entry>
</feed>