Difference between revisions of "Webserver reporting"

From Freephile Wiki
Jump to navigation Jump to search
(Created page with "== Install == We install the Tokyo Cabinet version for data persistence <syntaxhighlight lang="bash"> echo "deb http://deb.goaccess.io/ $(lsb_release -cs) main" | sudo tee -a...")
 
(initial docs)
Line 1: Line 1:
== Install ==
+
QualityBox 34.x features [https://wiki.freephile.org/public_html/report.html real-time web analytics]. Now you can see exactly what's happening, both bots and regular traffic, instantly. The analytics works from the command-line for administrators and also as a single page real-time web app for easy reporting/sharing in the web browser.
We install the Tokyo Cabinet version for data persistence
 
<syntaxhighlight lang="bash">
 
echo "deb http://deb.goaccess.io/ $(lsb_release -cs) main" | sudo tee -a /etc/apt/sources.list.d/goaccess.list
 
wget -O - https://deb.goaccess.io/gnugpg.key | sudo apt-key add -
 
  
sudo apt-get update
+
==Install==
sudo apt-get install goaccess-tcb geoip-bin
+
Webserver reporting is made available through the GoAccess project. It's available by default in your QualityBox. You can disable it in your public.yml.  In order to get reports, your QualityBox administrator must set them up for you.
 +
 
 +
== Useful commands ==
 +
'''Checking for Tokyo Cabinet'''
 +
 
 +
The Tokyo Cabinet on-disk b-tree library is used for persistence (only available in Debian). You can check for it with:<syntaxhighlight lang="bash">
 +
goaccess -s
 +
</syntaxhighlight>Output:
 +
using Tokyo Cabinet on-disk B+ Tree
 +
'''Generating reports'''
 +
 
 +
nb. Either run as root, or use sudo to be able to read the log file.<syntaxhighlight lang="bash">
 +
# use default config file (will NOT work with default QualityBox)
 +
tail -1000 /var/log/apache2/access_log | goaccess -p /etc/goaccess/goaccess.conf -
 +
 
 +
# use custom config file
 +
tail -1000 /var/log/apache2/access_log | goaccess -p /etc/goaccess/my.goaccess.conf -
 +
 
 +
# use no config file (minimum args)
 +
tail -1000 /var/log/apache2/access_log | goaccess --log-format '~h{, } %^ %e [%d:%t %z] %D "%r" %s "%R" "%u" %^ %b' --time-format "%T" --date-format "%d/%b/%Y" -
 +
 
 +
# real-time stats generation
 +
sudo tail -f -n +0 /var/log/httpd/access_log | sudo goaccess -p /etc/goaccess/my.goaccess.conf -o /opt/htdocs/public_html/report.html --real-time-html --ws-url=wss://wiki.freephile.org:443 --addr=127.0.0.1 --origin=https://wiki.freephile.org --ssl-cert=/etc/letsencrypt/live/wiki.freephile.org/cert.pem --ssl-key=/etc/letsencrypt/live/wiki.freephile.org/privkey.pem -
 
</syntaxhighlight>
 
</syntaxhighlight>
 
 
[[Category:Apache]]
 
[[Category:Apache]]

Revision as of 10:58, 7 May 2020

QualityBox 34.x features real-time web analytics. Now you can see exactly what's happening, both bots and regular traffic, instantly. The analytics works from the command-line for administrators and also as a single page real-time web app for easy reporting/sharing in the web browser.

Install[edit | edit source]

Webserver reporting is made available through the GoAccess project. It's available by default in your QualityBox. You can disable it in your public.yml. In order to get reports, your QualityBox administrator must set them up for you.

Useful commands[edit | edit source]

Checking for Tokyo Cabinet

The Tokyo Cabinet on-disk b-tree library is used for persistence (only available in Debian). You can check for it with:

goaccess -s

Output:

using Tokyo Cabinet on-disk B+ Tree

Generating reports

nb. Either run as root, or use sudo to be able to read the log file.

# use default config file (will NOT work with default QualityBox)
tail -1000 /var/log/apache2/access_log | goaccess -p /etc/goaccess/goaccess.conf -

# use custom config file
tail -1000 /var/log/apache2/access_log | goaccess -p /etc/goaccess/my.goaccess.conf -

# use no config file (minimum args)
tail -1000 /var/log/apache2/access_log | goaccess --log-format '~h{, } %^ %e [%d:%t %z] %D "%r" %s "%R" "%u" %^ %b' --time-format "%T" --date-format "%d/%b/%Y" -

# real-time stats generation
sudo tail -f -n +0 /var/log/httpd/access_log | sudo goaccess -p /etc/goaccess/my.goaccess.conf -o /opt/htdocs/public_html/report.html --real-time-html --ws-url=wss://wiki.freephile.org:443 --addr=127.0.0.1 --origin=https://wiki.freephile.org --ssl-cert=/etc/letsencrypt/live/wiki.freephile.org/cert.pem --ssl-key=/etc/letsencrypt/live/wiki.freephile.org/privkey.pem -