Amir Shahamiri فا

~ / articles / Infrastructure

Infrastructure

17 articles on software, infrastructure and business.

2026 17

How to Fix 502 Bad Gateway in Nginx with PHP-FPMFix 502 Bad Gateway in Nginx with PHP-FPM: read error.log, fix socket path and permissions, pm.max_children, timeouts, header buffers and nginx -t. 2026-10-10 9 min What Is a VPS? VPS vs. Shared vs. Dedicated HostingWhat is a VPS, what is it used for, and how does it compare with shared hosting and a dedicated server? Find out which one fits your website or app. 2026-10-09 8 min What Is tmux? A Beginner's Guide to Keeping SSH Sessions AliveWhat is tmux and how does it work? A tmux guide from scratch: sessions, windows and panes, the prefix key, detach and attach, tmux.conf and a cheat sheet. 2026-10-09 8 min How to Create a systemd Service on Linux (Unit File Guide)Create a systemd service on Linux: write a unit file with User, WorkingDirectory, Restart and EnvironmentFile, enable it and read logs with journalctl. 2026-10-09 8 min How to Create SSH Keys and Connect to a Server (Windows & Linux)Generate SSH keys (ed25519) on Windows, Linux and macOS, copy them to a server, use ~/.ssh/config, add a key to GitHub and fix common SSH errors. 2026-10-09 8 min rsync Command in Linux: Copy and Sync Files Between ServersThe rsync command in Linux with examples: -avzh, the trailing slash rule, dry-run, the risks of --delete, exclude, custom SSH ports and resuming transfers. 2026-10-09 8 min Linux Server Monitoring: What to Watch and Which Tools to UseLinux server monitoring made simple: what to watch (CPU, load average, memory, disk, services), built-in tools, Netdata, and a cron health-check script. 2026-10-09 9 min Linux Server Disk Full? How to Find and Free Up SpaceLinux server disk full? Find the culprit with df, du and ncdu, then fix deleted-but-open files, logs, the journal, apt, Docker, inodes and alerting. 2026-10-09 8 min Essential Linux Commands for Server AdministrationEssential Linux commands for managing an Ubuntu server, grouped by task, with real examples and a cheat sheet of the 25 you will use every day. 2026-10-09 8 min How to Install Docker on Ubuntu 24.04 (Docker Engine)How to install Docker on Ubuntu 24.04 from the official repository: post-install steps, hello-world test, docker.io vs. docker-ce, and full uninstall. 2026-10-09 7 min Free SSL Certificate with Let's Encrypt and Certbot on UbuntuGet a free SSL certificate from Let's Encrypt with Certbot on Ubuntu for Nginx or Apache, for .ir or any domain: auto-renewal, wildcards and common errors. 2026-10-09 8 min Docker Compose Explained with a Real Example (Postgres + Redis)Docker Compose explained: what it is and how it works, with a web app, PostgreSQL and Redis, volumes, healthchecks, depends_on and everyday commands. 2026-10-09 9 min DNS Records Explained: A, AAAA, CNAME, MX, TXT, NS and CAADNS records explained with examples: A, AAAA, CNAME, MX, TXT, NS and CAA, what TTL means, why CNAME can't go on the root domain, and checking with dig. 2026-10-09 9 min Cron Jobs in Linux: Crontab Syntax Explained (and systemd Timers)How cron jobs work in Linux: the five crontab time fields with examples, /etc/cron.d, environment pitfalls, logging, flock and systemd timers. 2026-10-09 9 min Bash Scripting Basics: Automate Repetitive Tasks on LinuxBash scripting basics for Linux: shebang, set -euo pipefail, quoting, arguments, conditionals, loops, functions, exit codes, logging and shellcheck. 2026-10-09 9 min The 3-2-1 Backup Rule in Practice: Backups You Can RestoreThe 3-2-1 backup rule in practice: consistent MySQL and PostgreSQL dumps, a bash script with rsync, scheduling with cron, and regular restore tests. 2026-10-06 9 min Ubuntu 24.04 Server Hardening: The First Hour, Step by StepUbuntu 24.04 server hardening in the first hour: a non-root user, SSH key-only login, ufw, automatic security updates, fail2ban and time sync. 2026-10-04 9 min