Posts
Tempor est exercitation ad qui pariatur quis adipisicing aliquip nisi ea consequat ipsum occaecat. Nostrud consequat ullamco laboris fugiat esse esse adipisicing velit laborum ipsum incididunt ut enim. Dolor pariatur nulla quis fugiat dolore excepteur. Aliquip ad quis aliqua enim do consequat.
Configure a local HTTP proxy to a Java application with Apache on Ubuntu 26.04 LTS
Suppose the local development app is served on the domain application.local, with the following entry in /etc/hosts:
127.0.0.1 application.local
Usually a web-based Java application runs on port 8080, with a local URL like http://application.local:8080/.
To reach that app at http://application.local without the port, configure Apache as a reverse proxy. Create a virtual host file under /etc/apache2/sites-available/, for example application.conf, with the following content:
<VirtualHost *:80>
ServerName application.local
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/
</VirtualHost>
ProxyPreserveHost On forwards the browser’s Host header (application.local) to the backend instead of 127.0.0.1:8080. That usually matches what Java apps expect for host-based routing, redirects, and generated URLs. If something breaks, try removing this line or set ProxyPreserveHost Off so the backend sees the origin it was configured for.
How to fix MySQL APT EXPKEYSIG B7B3B788A8D3785C
When attempting to upgrade packages from the MySQL APT repository:
sudo apt update
The error below may appear when you run sudo apt update.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://repo.mysql.com/apt/ubuntu focal InRelease: The following signatures were invalid: EXPKEYSIG B7B3B788A8D3785C MySQL Release Engineering <mysql-build@oss.oracle.com>
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/focal-security/InRelease Connection failed [IP: 2a06:bc80:0:1000::17 80]
W: Failed to fetch http://repo.mysql.com/apt/ubuntu/dists/focal/InRelease The following signatures were invalid: EXPKEYSIG B7B3B788A8D3785C MySQL Release Engineering <mysql-build@oss.oracle.com>
The cause is an expired signing key. The quickest fix is to reinstall the MySQL APT configuration package (mysql-apt-config). Download the .deb from MySQL’s APT repository.
How to Install MySQL 8.4 on RHEL 7
While both Red Hat Enterprise Linux and Ubuntu are Linux systems, the installation process for MySQL from the YUM repository is completely different from what was described earlier for MySQL on Ubuntu. Although RHEL 7 reached end of maintenance on June 30, 2024, it will still be under Extended Life Cycle Support until May 31, 2029. That is more than three years away, which makes it a suitable option for legacy bare-metal servers that list it as a supported operating system.
How to Remove Leading, Trailing, and Extra Spaces in MySQL
During an in-depth review of large processed datasets, it is often possible to find that they contain multiple extra space characters. There may be thousands of them in data stored in a single text field. Multiplied by millions of rows, they create additional load on the system without adding any value to the processed data.
In general, there are three cases where blank spaces may appear. The most common is at the beginning of the string. These can usually be removed with the LTRIM function.
How to Find Empty Tables in MySQL
Over time, as projects extend their functionality, the number of tables in the database grows. Some features may be planned but later removed, or changes may be made as urgent hotfixes that bypass standard procedures. As a result, tables remain for which nobody can explain the purpose, and they lie in databases for years. The problem with them is that MySQL still needs to allocate resources for their existence, including at least file handles and memory. As the number of tables in a typical database reaches hundreds, it becomes an issue to locate and identify these orphaned tables.
How to Avoid Maven Metadata Retrieval for Flyway Migrations
When running Flyway migrations with Maven by default, the build output shows that Maven fetches repository metadata on each run. If migrations are run frequently, it soon becomes distracting and annoying.
+ mvn flyway:migrate
[INFO] Scanning for projects...
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml
Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml
Downloading from central: https://repo.maven.apache.org/maven2/org/flywaydb/maven-metadata.xml
Progress (1): 4.6 kB
Progress (2): 4.6 kB | 3.1 kB
Progress (2): 4.6 kB | 8.0 kB
Progress (2): 4.6 kB | 8.0 kB
Progress (2): 4.6 kB | 13 kB
Progress (3): 4.6 kB | 13 kB | 234 B
Progress (3): 10 kB | 13 kB | 234 B
Progress (3): 14 kB | 13 kB | 234 B
Progress (3): 14 kB | 17 kB | 234 B
Progress (3): 14 kB | 20 kB | 234 B
Progress (3): 14 kB | 21 kB | 234 B
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml (14 kB at 19 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/flywaydb/maven-metadata.xml (234 B at 311 B/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml (21 kB at 27 kB/s)
[INFO]
[INFO] -----------------------< ...
This happens because Maven does not know where to find the Flyway short name and has to look up the plugin in metadata. As a result, it initiates plugin metadata retrieval from Maven Central and slows down migration execution.
How to Fix Jenkins NO_PUBKEY 7198F4B714ABFC68 on Ubuntu 24.04
Refreshing the package index on Ubuntu 24.04 with Jenkins LTS installed may show a NO_PUBKEY error that blocks updates and makes it impossible to update Jenkins.
sudo apt update
The following error may appear:
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://pkg.jenkins.io/debian-stable binary/ Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7198F4B714ABFC68
W: Failed to fetch https://pkg.jenkins.io/debian-stable/binary/Release.gpg The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7198F4B714ABFC68
W: Some index files failed to download. They have been ignored, or old ones used instead.
This happens because of a recent signing keys update by Jenkins.
How to prevent MySQL restarts by disabling unattended upgrades on Ubuntu 24.04
When investigating random restarts of the MySQL server, the first step is to understand their cause. They could result from either a host restart or a MySQL service restart. To check if the host was restarted, run uptime:
uptime
The output shows that the host has stable uptime of over a month without interruptions. This clearly indicates that the issue is with the MySQL service itself, not the host:
10:50:05 up 31 days, 11:53, 1 user, load average: 0.50, 0.50, 0.80
To investigate further, check the MySQL error log:
How to Install Latest MySQL 8.4 LTS on Ubuntu 24.04
The issue with outdated MySQL packages in the default repository for both currently supported Ubuntu LTS releases (22.04 and 24.04) is the same as that previously described for PHP and Apache. When installing the mysql-server package from the default repository, the latest available version is 8.0.44 from the 8.0 series.
There are no signs of MySQL 8.4 availability in the default repository, and MySQL 8.0 will reach End-Of-Life in April 2026, which makes it unsuitable for new projects and installations unless there are legacy dependencies requiring it.
How to configure PHP with Apache on Ubuntu
While PHP can be installed through the php-cli package and used as a command line interpreter as shown in the post about installing the latest PHP on Ubuntu, its primary purpose is to serve as a Hypertext Preprocessor for web applications. To do this, it needs to work together with web servers like Apache or Nginx. This post provides a step-by-step guide on configuring PHP to work with Apache web server.
How to Install Latest Apache on Ubuntu
In continuation of the previous post about installing the latest PHP on Ubuntu, a similar approach for installing the Apache web server will be reviewed here.
Again, the same issue exists with the latest Apache version available in the original Ubuntu 24.04 repository, where it is tied to version 2.4.58.
As it is possible to notice when adding the ppa:ondrej/php repository, there is also a similar repository available for Apache. This can be added using a single command.
How to Install Latest PHP on Ubuntu
PHP is available on Ubuntu out of the box, but there are several reasons not to install it from the default distribution. Usually, the available version is outdated and tied to a specific release.
For example, Ubuntu 22.04.5 includes PHP 8.1.2, while Ubuntu 24.04.3 includes PHP 8.3.6. These versions are outdated compared to current releases. Additionally, PHP 8.1 coming with Ubuntu 22.04 will soon reach EOL, making it an unsuitable option.
Introduction
In the beginning there was a word, and the word was two bytes.
After more than two decades of working in database engineering, it’s time to organise things and start publishing articles on a regular basis. With solid experience, there is much I have to share, yet there is still much more I don’t know and wish to discover.
So let Research and Development begin.