It’s been some time since I last updated anything on this server, but I finally got some spare time to take a look and get things up to date. Among all the outdated things, there are: Ubuntu 20.04 LTS, php 7.4, mariadb 10.4, and phpMyAdmin 5.2.0.
The OS upgrade was relatively smooth, but I did have to remove some logs and unused docker images and volumes beforehand. The tricky part was getting Apache server running. At first, php8.1 was unable to run due to a duplicate libsodium.so created in 2017. After fixing that, Apache was still trying to use php7.4. Once the php8.1 related Apache modules are enabled, I was finally able to access my blog through the internet.
<!–more–>
The script below details all the steps for the upgrade:
# commands below are issued as root, you may need to prepend a sudo
# first check available disk space
du -h
# inspect disk usage of all top-level items in a certain path
du -hs *
# found /var to be quite big, specifically:
# /var/log
# /var/lib/docker
# remove old logs
journalctl --vacuum-time=30days
# clean up docker
docker system prune -a -f
# after the cleanup, update all packages
apt update
apt upgrade -y
# perform OS upgrade (this takes some time)
do-release-upgrade
# now we are running Ubuntu 22.04.5 LTS
# tried accessing wordpress but got an error
# check Apache server status
service apache2 status
# found the server in exited state, needs to inspect error log
tail -n 100 /var/log/apache2/error.log
# found some error about php, trying to find out version
php -v
# got an error:
# php: symbol lookup error: php: undefined symbol: crypto_core_ristretto255_scalar_invert
# found this link about duplicate libsodium.so file:
# https://stackoverflow.com/questions/73991378/php8-1-on-debian-undefined-symbol-crypto-core-ristretto255-scalar-invert
# removing the outdated duplicate
rm -f /usr/local/lib/libsodium.s*
# check php version again, working!
php -v
# PHP 8.1.2-1ubuntu2.22 (cli) (built: Jul 15 2025 12:11:22) (NTS)
# Copyright (c) The PHP Group
# Zend Engine v4.1.2, Copyright (c) Zend Technologies
# with Zend OPcache v8.1.2-1ubuntu2.22, Copyright (c), by Zend Technologies
# restart Apache2 server
service apache2 restart
# still fails, checking log
journalctl -xeu apache2.service
# found error related to php7.4 not found
# this indicates Apache server is still configured to use php 7.4
# needs to reconfigure modules
a2dismod php7.4
apt install libapache2-mod-php8.1
a2enmod php8.1
# saw some error related to FastCGI and php 7.4
# tried Googling and found that I need to install php8.1-fpm (FastCGI Process Manager)
apt install php8.1-fpm
a2enmod php8.1-fpm
a2enconf php8.1-fpm
systemctl reload apache2
service apache2 restart
# check apache status again and it is alive!
service apache2 status
