GoAccess parsing issues resolved

Since Webalizer fell into disrepair some years ago, I dabbled with GoAccess for website stats and sort of got it working. Several OS or Apache updates later it decided to stop working and I never found the time to fix.

Well, todays persistent rain and nothing better to do, I resolved to fix why GoAccess refused to parse my Apache logs.

The initial fault seemed to stem from GoAccess not being able to decide if I had CLF ( Common Log Format) or Combined Log Format. Apache was insistent that I had set Combined Log Format looking at httpd.conf, but GoAccess complained on start-up that this was not the case.

As this is a hobby server and I had not needed to rotate the logs for several years I can only guess the httpd-access.log had been corrupted or mixed with CLF at some point, so a forced log rotation stopped the error messages on startup and allowed the basic details of the log to be parsed.

However the referrer and user agent still was not parsed. It seems there is a error in the sample goaccess.conf file and the %R and %u fields need double quotes to be parsed fully. A post way back from 2014 seemed to flag this but the MAN page still does not pick this up, maybe its a FreeBSD specific issues

Anyhoo, fixing this is the Combined Log file format parse string now has the file being parsed happily. The OS and Browser detections still seem a bit pants, Safari and Apple iOS and MacOS seemed to be lumped under Linux, but job for another day.

The analytics can be found here

Solved – MYSQL refusing to start

I had upgraded my version of Mysql Server via the ports a few weeks back and usually ports is very good at addressing any compatibility issues bumping up the versions. A quick read of UPDATING had not flagged any real concerns, but on the reboot Mysql was steadfastly refusing to start. No obvious error messages where thrown and it just silently refused to budge.

Googling presented several solutions, but none palpable (wipe config and dbs and start again). However one suggestion was to check the {hostname}.err file contained within /var/db/mysql and lo and behold a quick TAIL {hostname}.err displayed the error that I have been missing. Namely that query_cache_type=0 and query_cache_size=0 had been deprecated starting with v8 and needed to be deleted from my.cnf file.

Fixing the my.cnf file and a quick service mysql-server start restored my Databases and we are back up and running.

Updating Ruby via Ports

Oh I do hate /usr/ports/UPDATING when they refer you to an entry 3 years prior on how to update the current version of a major revision bump and then you need to dig out and correct the numbers to make it work. So I am just going to down my editing here so I can find more easily.

  If you use portmaster, install new ruby, then rebuild all ports that depend on ruby:

cd /usr/ports/lang/ruby31 and Make install

  # portmaster -o lang/ruby31 lang/ruby30

  # portmaster -R -r ruby-3.1

Amazon Echo 4th Gen palaver

Tried to add a second Echo to the bedroom for stereo sound. Original order the new echo dot as the price and picture with the pre-christmas deals looked very similar. Quickly realised my mistake as already caught out trying to pair a standard Echo and a Dot. No harm done as was able to quickly re-gift to a friend that needed another Dot.

I then had a few delivery nightmares with Amazon in the lead up to Christmas where the delivery drivers app had seemed to have forgotten where I lived and get getting failed delivery notifications as they could not find the address, so held off ordering a replacement until post Christmas.

I finally got around to ordering another Echo 4th gen, but now appears not only must they be the same model but same generation as well to stereo pair. The Lounge Studios work a treat with the subwoofer as the main HiFi solution the flat but once again stuck with just mono in the bedroom as I am not going to spring for nearly £180 to have two 4th Gen devices when the 5th Gen are rumoured not to be too far away.

Heat vs Bills

As its gone incredibly chilly in the UK at present, its a question of leaving the server on to help heat up the room vs pay the increasing energy bill.

Hardening the Server

For many months, the nightly security emails have been warning that db5 and gcc9 were out of date and no longer supported. Numerous attempts to remove just threw up package dependencies, so today I set out to tackle them.

gcc9 proved to be the easiest and whatever previous package had been holding it back had clearly gone and a simple sudo pkg delete gcc9 did not throw up any other package dependencies and soon went.

Not so for db5.

Webalizer, apr and apache24 still insisted on db5. All relatively mainstream packages but all still using db5. Several Googles showed others have had similar problems ever since it was first mentioned as deprecated but the amount of error messages had decreased since July,

Adding dbd=18 to make.conf as the default db version seems to have resolved the problem after a Make Deinstall Clean on apr1, apache24 and the webalizer ports. All 3 then re-built nicely and did not call in db5 which previous attempts to remove and rebuild have done.

Hopefully now after fixing PHP 8.1 and now db5 plus gcc9 the server will live on for another year as a test-bed and platform for my ramblings.