In order to construct a secure resource that can be accessed through an API, we must utilize an authorization header with a token or bearer. In this article, I will guide you how to obtain the authorization header, extract the token or bearer. Then authenticate it against a database table and return a JSON output in PHP.
Most of the old servers are either on 16.04 or 18.04. It's time for you to upgrade. Mine are all on 20.04, even though it is fine to leave it as is for now, but as you know I like to keep up with the latest software and pace of OS. So I decided to upgrade to latest Ubuntu 22.04. In this article I am going to guide you how to upgrade your Ubuntu server to 22.04 LTS.
Modern web is more about compression and one of it are images. There are many things which can be minified and compressed like CSS, JS, server side compression and even HTML of the page. Here I am going to show you how to convert PNG images to WebP format with Imagemagick while maintaining the same quality but reduced size.
Normally I update my system when there is a notification about updates. But for some time I did not get any notification. Firefox was stuck at 105 version and so was KDE plasma at 5.25.x. I was curious and ran sudo pacman -Syu and got an error, error: failed to synchronize all databases.
I was adding a repository for latest PHP version and got an error of command not found. It's easy to fix, read on how to fix add-apt-repository: command not found.
Apache by default have gzip compression enabled on all recent versions. But brotli is much better compression than gzip. If you would like to enable brotli on Apache on Ubuntu, read on how to do that.