Energy Bills

With the current cost of living crisis in the UK, driven by the increase in energy costs I am limiting the amount of hours I leave the server up and online these days. Certainly over the summer when I had little time to dabble with the various services that I run, its make good economic sense to shut the server down if I am not going to be working on its for a few days.

Therefore expect to see erratic uptime for this website/server, unless I take the plunge and migrate all the content to one of the cloud accounts I am already paying for. The downside will be the loss of local services and a properly offline OneDrive copy that I use for backup purposes.

PHP 8.x upgraded

With the pending retirement of PHP 7.3 the last thing on last months list of things to do was to update PHP to a supported version.

re-building from ports is not easy, but is straight forward. First generate a list of all your installed php packages and save safely where you can access it. Then use pkg delete -f to remove each package on your list. Not forgetting mod_php73 and then find the version of php you want to replace with in /usr/ports/lang and then install php80 and php80_extensions.

I had planned to jump straight to PHP 8.1, but the php81-dom extension is no longer available to install. Ditto php81-hash and php81-json. Thankfully I didn’t need -hash nor json and rolling back to PHP8.0 sufficed.

60 minutes later after manually deinstalling and then installing I had a working system. Well, almost, in my haste to reboot the server, I had forgotten to install mod_php80 so on the reboot Apache failed to start as it did not recognise some of the php injects in the httpd.conf. Rem’ing the errant comments out did not work either as when Apache now started, it could not interpret the .php files and dumped them straight to the screen. Then the penny dropped and a quick install of mod_php80 and reboot finally made Apache happy and everything working again.

Why reboot and not just stop/start Apache et al. Well its a small test rig and not running any production grade services so a complete clear out of the memory from any residual horlicks I have made in past configs or port building means I give it the best hope of running smoothly until the next big upgrade.

Upgrade decided

With all the furore over log4J and JNDI decided it was time to take the plunge and force the update thru. Although I wasn’t running Log4J there are probably a heap of software out there that will need to be bumped to the latest and greatest, so it seemed sensible to opt for Release 14, given its now on the point 4 update so all the major issues should be ironed out.

Server is mid-update as I type and is going smoothly,

Biggest issue was getting all the ports up to date before I started as a couple of Python related ports where being stubborn, looking for a packaging update to >20, but Postmaster could not seem to find the required dependency. Turns out installing or updating py-packaging made the necessary fix and now all the ports are building nicely I can attempt the OS update as everything will need to be rebuilt again from ports.

Freeing update disk space

Since moving house, the FreeBSD box has reverted to a headless server, with all updates taking place via the CLI. I have Webmin installed but this is mainly as a backup / alternative and to view a few things graphically, like disk space.

I use the the OneDrive port to manually sync my OneDrive as an offline copy as I only run it on demand so works as an offline copy. The downsize is that I am rapidly running out of disk space as never envisaged a 1Tb store to be backed up to the FB disks.

With the combination of Headless Server and no longer a need for the X interface, I was left with a large number of X applications no longer needed. Just judicious use of PKG Delete and port deinstall I removed a fair amount of unnecessary applications. I thought that was that, but then reminded of the PKG AUTOREMOVE command which freed up another 4Gb from the main drive and 286 packages from the tree. As I look to update to the next branch of the FreeBSD upgrade stream, this should ease the amount of packages and data that will need to be processed to complete the upgrade.

LetsEncrypt update failures

As the server is hosted from home, sometime the droning of the Hard Drive and fans annoys me and as I only host this for fun and self learning it occasionally gets turned of. This meant it missed the Cron Jobs that that should have replaced the cert long before renewal date.

Added to that, when I moved I locked down the router config and only allowed port 443 thru to the webserver to only permit TLS/SSL traffic and not plain HTTP. In the main this has worked well, but also meant the certbot script failed to renew the cert on demand as it could not write to the .wellknown folder on port 80.

So, now port forwarded port 80 to the server and the certificate has updated as required.

Clearing up disc space

my ports \distfiles directory had grown to over 30Gb in the 4 years since I last did a complete clean fresh build and as its something of a test rig for trying stuff out, it had grown rather large.

by running the following commands I regained c22Gb of disc space, ready for which ever pet project I choose to tinker with next.

sudo portmaster --check-depends 
sudo portmaster --check-port-dbdir 
sudo portmaster -s 
sudo portmaster -y --clean-distfiles

re-build world again….

might not be full lockdown, but the vaccines are here so time to rebuild both the virtual and IRL world.. Updated FreeBSD to 12.2 which had probably been one of the simplest OS updates. I usually get caught out with merging the updated config files but guess the second point update to 12.x probably was not a major change to get wrong. Also made easier by stripping off MATE and most of the desktop apps that I occassionally dabbled with as its back to running as as Headless Server with all access over SSH or Web Interface.

Grrr Nettle woes next

After finally getting RHASH to build, a few easy days and then Nettle would not build. I tried everything, MAKE CLEAN, DEINSTALL, rebuilding build dependencies, nothing worked. Re-installing the old package again kept everything work.

In deperation, I saw the the GHOST-BSD laptop I am currently testing had a built package for nettle-3.6 so in desparation and part trial, I copied the nettle package from the laptop to the server and then issued SUDO PKG ADD path/to/nettle.3.5.xxx and hey presto, it installed and after several reboots and rebuilds of dependent packages it works. Its probably not the safest or more secure, but allowed all the packages that then depend on GNUTLS to build to the latest ports.

RHASH build woes

Have spent two weeks trying to update RHASH from 1.3.5 to 1.3.9 via ports, but kept giving build errors on openssl.mod which no one else was reporting. Tried to deinstall clean and rebuild and still no go.

Checked Freshports for updates and it is not updated very often but did notice that gettext-tools and gettext-runtime where listed as dependencies too. So quick make deinstall clean and re-install I thought might help. But part way thru reinstalling, Sudo no longer worked on getting gettext-runtime to function. Seems deinstalling gettext-tools broke Sudo. So quick SU to rebuild gettext-tools and sign out and back in again might fix it.

but oh no, still the same build error. However asking portmaster to build atril, it then went away happily and updated RHASH thereby allowing CMAKE to update and now the remaining ports seems to be updating happily enough.