From ae24d9a8869c497537839f330384cbadb2cf687c Mon Sep 17 00:00:00 2001 From: Mitja Felicijan Date: Tue, 31 Oct 2023 10:17:43 +0100 Subject: Updated theme --- ...sing-goaccess-with-nginx-to-replace-google-analytics.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'public/using-goaccess-with-nginx-to-replace-google-analytics.html') diff --git a/public/using-goaccess-with-nginx-to-replace-google-analytics.html b/public/using-goaccess-with-nginx-to-replace-google-analytics.html index 86710f9..1dcc4f1 100755 --- a/public/using-goaccess-with-nginx-to-replace-google-analytics.html +++ b/public/using-goaccess-with-nginx-to-replace-google-analytics.html @@ -19,7 +19,7 @@ fantastic but would require installation of databases and something like PHP or Node. And I was not ready to put those things on my fresh server. Also having Docker installed is out of the question.

Opting for log parsing

So, I defaulted to parsing already existing logs and generating HTML reports from this data.

I found this amazing software GoAccess which provides -all the functionalities I need, and it's a single binary. Written in Go.

GoAccess can be used in two different modes.

GoAccess Terminal
Running in a terminal
GoAccess HTML
Running in a browser

I, however, need this to run in a browser. So, the second option is the way to +all the functionalities I need, and it's a single binary. Written in Go.

GoAccess can be used in two different modes.

GoAccess Terminal
Running in a terminal
GoAccess HTML
Running in a browser

I, however, need this to run in a browser. So, the second option is the way to go. The Idea is to periodically run cronjob and export this report into a folder that gets then server by Nginx behind a Basic authentication.

Getting Nginx ready

I choose Ubuntu on DigitalOcean. First I installed Nginx, and @@ -91,11 +91,11 @@ additional rules for SSL.

Your location portion the config file should now loo

Test if config is still ok with nginx -t and if it is you can restart Nginx with service nginx restart.

If you now visit https://stats.domain.com you should be prompted for username and password. If not, try reopening your browser.

That is all. You now have analytics for your server that gets refreshed every 10 -minutes.


Posts from blogs I follow around the net