Reading unique page visits from the access.log26 Feb 2019 - luca
This how-to has been tested on Ubuntu Server 18.04.2 LTS.
- Create a new directory where you want to place
cdinto this directory and download the sourcecode. At the time of writing, the current version is
cd ~/your/path && wget http://www.hping.org/visitors/visitors-0.7.tar.gz
This archive needs to be
unzipped.Do this by using either my
extractalias (see Useful .bash_profile and .gitconfig settings), or the following command:
tar -xzvf visitors-0.7.tar.gz
The sourcecode needs to be compiled.
makefails or you are unable to execute it, your machine needs the essential build tools.
# as sudo apt-get install build-essential
We are now able to let
visitorsparse the access.log1 and generate a
~/your/path/visitors_0.7/visitors /var/log/nginx/access.log > report.html
If done correctly,
Visitors will have written its report into the
report.html file inside its root folder.
Since you are most likely on a commandline only machine, you will need a handy solution to
view this .html file.
For this, we will be using Lynx - a text only webbrowser.
All common distributions will have Lynx in its repository. Therefore one can easily install it via the following command:
apt-get install lynx
Feeding Lynx our
report.html, gives you the opportunity to step through the report, using your keyboard.
The page will look similar to this: Text written in Green, represent links.
Using your keyboard,
right will follow this link, whereas
left will go
down let you navigate your cursor. Quit with
As you can see in the above screenshot, lynx will analyse and group its results by day, month and pages as well as other files. Feel free to explore!
Thanks for reading!