Fixing Nginx 502 Errors on a Home-Lab HTTPS Site

Troubleshooting certificate and path configuration issues

502 from Nginx? Let’s Fix the HTTPS Path & Cert Issues

A 502 Bad Gateway is the first thing you’ll see when you expose a service behind Nginx in a home‑lab.
It usually means the proxy can’t talk to the backend – often because the SSL certificate is wrong, the upstream URL is mis‑typed, or the upstream host is unreachable.
Below is a step‑by‑step walk‑through that covers the most common pitfalls, shows how to verify each piece, and explains the trade‑offs you’ll face when choosing a solution.

[Read More]

Auditing Stale SSH Keys on Production Servers

Using ssh-keygen and fail2ban to reduce brute-force risk

Auditing Stale SSH Keys with ssh-keygen -l and Protecting with fail2ban

SSH keys that sit unused for months can become a silent backdoor if a private key ever gets compromised. On a production server the safest way to keep the key list lean is to audit it regularly and block any brute‑force attempts that surface while you’re cleaning up.

1. List all authorized keys with fingerprints

The authorized_keys file lives in each user’s ~/.ssh/. To see which keys are actually present, run:

[Read More]

Automating Let's Encrypt Renewal Without Downtime

Renewing certificates on a single-node web server

Automating Let’s Encrypt renewal on a single‑node web server without downtime

Let’s Encrypt certificates expire every 90 days. On a single‑node web server the usual approach is to run certbot renew from cron and reload the web service. The trick is to avoid any traffic loss while the new cert is in place. Below is a minimal, production‑ready recipe that works with Apache, Nginx, or any systemd‑managed web server.

1. Install Certbot and the web‑root plugin

# Debian/Ubuntu
sudo apt-get install certbot python3-certbot-nginx   # or python3-certbot-apache

# RHEL/CentOS
sudo dnf install certbot python3-certbot-nginx

The nginx or apache plugin automatically configures the web‑root challenge and reloads the server after a successful renewal.

[Read More]

Recovering an Ubuntu VPS Running Out of Disk

A cleanup script that keeps Apache logs writable

Disk exhaustion is the most common cause of a sudden “500 Internal Server Error” on a small VPS.
When the filesystem that holds /var/log/apache2 is full, Apache can’t rotate or write new logs, and the web server silently stops accepting requests.
The fix is usually a quick cleanup, but doing it manually every time is error‑prone and can leave you with the same problem again.
Below is a practical, repeatable script that:

[Read More]

Recovering a VPS Disk That Fills at Midnight

Using LVM snapshots and automated alerts

Disk‑full crashes are the most common reason a VPS goes from “alive” to “dead” overnight.
A log file or a database that blows past the allotted space will make the kernel refuse any further writes, and every process that needs to touch the disk will start failing. If you’re running a website, mail server, or database, that’s a service outage you can’t afford.

The silver lining? A handful of LVM tricks and a tiny monitoring script can get you back up in minutes and keep future incidents at bay.
Below I walk through a real‑world scenario on a Debian‑based VPS, but the ideas carry over to any distro that uses LVM and systemd.

[Read More]

Rootless Podman volumes: how to keep data safe across upgrades without root

Rootless Podman Volumes: Keeping Your Data Safe Across Upgrades

Rootless Podman lets you run containers without ever touching sudo.
That’s great, but it also means every volume lives in your home directory.
When you bump Podman or your distro, the storage layout can change and all your data can get wiped.
Below is a practical, coffee‑talk style walk‑through that shows how to sidestep this trap.


Why Rootless Volumes Are Different

When you run

[Read More]

Fixing ProxyJump timeouts when a VPN drops your IP address.

ProxyJump timeouts when a VPN drops your IP address

When you hop through a bastion with ssh -J, the jump host keeps a TCP tunnel open to the target.
If you’re on a VPN that can change your public IP or even tear the tunnel down, that tunnel can stall or die.
The result? A hanging SSH that eventually spits out “Connection timed out” or “Connection reset by peer”.
For homelab users who rely on VPNs for remote access, this is the kind of annoyance that keeps you awake at night.

[Read More]

Stopping Laptop Overheating with ionice

Adding ionice -c3 to a nightly rsync backup

Nightly rsync and the heat problem

When I first set up a nightly cron job to copy my home directory to an external SSD, the laptop’s fan stayed at full blast all night. The CPU hit 90 °C, and the battery life dropped noticeably. I blamed the SSD’s sluggish write speed, but the real culprit turned out to be the I/O scheduler giving the backup process too much priority. Adding ionice -c3 (the idle class) to the rsync command brought the temperature back to sane levels without sacrificing backup reliability.

[Read More]

Taming Background Tasks with Nohup and Systemd: A Homelab Lesson Learned

Introduction to Background Tasks

As someone who’s spent years running a homelab, I’ve found that managing background tasks is crucial. These tasks need to keep running even after I’ve logged out of my system, and they’re essential for things like backups, system monitoring, and maintenance scripts. I used to rely on screen and tmux to keep these tasks running, but I’ve recently switched to using nohup and systemd. In this article, I’ll share my experience with these tools and provide some practical examples.

[Read More]

Fixing DNS Resolution in a Homelab

Troubleshooting Unbound and systemd-resolved

Introduction to DNS Resolution Issues

I’ve been running my own homelab for years, and like many of you, I’ve had my fair share of DNS resolution issues. Last year, I decided to ditch my router as a DNS server and set up Unbound and systemd-resolved on my Linux machines instead. The goal was to improve DNS resolution speed and security, but as you can probably guess, it wasn’t all smooth sailing.

[Read More]