Apache Logs Show the Load Balancer's IP, Not the Client's: Fixing It Behind HAProxy

You put HAProxy in front of two Apache servers, everything balances nicely, and then you open the access log on one of the web servers. Every single request comes from the same IP: the load balancer. This guide explains why that happens, the quick fix (log the X-Forwarded-For header), and the cleaner fix with mod_remoteip, plus the detail most guides skip: the quick fix can be faked by any client. ...

December 6, 2026 · 5 min · Sysadmin Field Notes

How to Replace GRUB with systemd-boot on Debian 13 (Trixie) Without Breaking Secure Boot

Debian 13 can install systemd-boot instead of GRUB, but only from the Expert install mode of the installer. If you already have a normal install with GRUB, you can switch afterwards, and most guides make it look like two commands: apt install systemd-boot and bootctl install. On a machine with Secure Boot enabled, that is not enough. I did this on a Debian 13 VM (OVMF with the Microsoft keys enrolled) and ran into three problems the short guides skip: ...

December 6, 2026 · 9 min · Sysadmin Field Notes

PHP Sessions Keep Resetting Behind HAProxy: Sticky Sessions with a Cookie

Classic symptom after putting a load balancer in front of two PHP servers: users get logged out at random, a cart empties itself, a multi-step form forgets what you typed. Nothing is “broken” on either server. The problem is where PHP keeps sessions. Below is a minimal way to reproduce it, the explanation, and the fix with HAProxy’s cookie-based persistence (sticky sessions). Reproduce it in one minute Two Apache + PHP backends (apache1, apache2) behind HAProxy with balance roundrobin. On both servers, create /var/www/html/session.php: ...

December 6, 2026 · 4 min · Sysadmin Field Notes

uWSGI Won't Stop (and Your systemd Service Keeps Failing): SIGTERM Means Reload

I was moving a Django app from “uWSGI running in a terminal” to a proper systemd service. The service would not start, kill did nothing useful, and later systemctl restart took a minute and a half. All three problems had the same cause: uWSGI does not treat SIGTERM as “stop”. If you only want the fix, it is this line in your unit file: KillSignal=SIGQUIT The rest of this post explains what is going on, so you can recognise it next time. ...

December 6, 2026 · 5 min · Sysadmin Field Notes