Guides tagged “linux”

Step-by-step MdmHost guides about linux, sorted A-Z.

280 guides · page 10 of 14

  • Protect Nginx with Fail2ban: bad bots, scanners and auth

    Turn on Fail2ban's built-in Nginx jails to ban password guessers, vulnerability scanners and clients that hit your rate limits, then test each filter against your real logs.

    IntermediateLinux server5 min read
  • Protect SSH from brute-force attacks with Fail2ban

    Install Fail2ban, create a safe jail.local for SSH, check which addresses are banned and unban yourself if you mistype a password too often.

    IntermediateLinux server2 min read
  • Proxy WebSocket connections through Nginx

    Make WebSockets work behind Nginx by passing the Upgrade and Connection headers, using a map for connection_upgrade, raising read timeouts, and testing the socket.

    IntermediateLinux server5 min read
  • Push images to Docker Hub or GitHub Container Registry

    Publish your own Docker images to Docker Hub or GitHub Container Registry. Log in with access tokens, tag images properly, keep them private and pull them on your VPS.

    BeginnerLinux server5 min read
  • Rate limit requests in Nginx with limit_req

    Slow down brute-force logins, scrapers and API abuse with Nginx limit_req and limit_conn, using burst and nodelay so real visitors are not affected.

    IntermediateLinux server5 min read
  • Rate-limit SSH and other ports with ufw limit

    Use ufw limit to slow down SSH brute-force attempts. Learn how the 6-connections-in-30-seconds rule works, apply it to a custom SSH port, pair it with Fail2ban and test it.

    BeginnerLinux server5 min read
  • Read and manage Nginx access and error logs

    Find Nginx's access and error logs, understand each line, give every site its own log, set error_log levels, pull out top IPs and URLs, and keep logs rotated.

    BeginnerLinux server5 min read
  • Redirect HTTP to HTTPS in Nginx

    Send every plain HTTP visitor to the secure HTTPS version of your site with one return 301 in Nginx, while keeping Let's Encrypt renewals working and avoiding redirect loops.

    BeginnerLinux server5 min read
  • Redirect www to non-www (or the reverse) in Nginx

    Pick one hostname for your site and send every other version to it with a clean 301 redirect in Nginx, keeping HTTPS and the full request path.

    BeginnerLinux server5 min read
  • Reinstall the operating system on a Virtualizor VPS

    Reinstall your VPS with a new OS template such as AlmaLinux, Ubuntu, Debian or Windows in Virtualizor, set the root password, and know what to back up first.

    BeginnerVirtualizor VPS2 min read
  • Repair Corrupted MySQL InnoDB Tables on a Linux VPS

    Confirm InnoDB corruption with CHECK TABLE, start MySQL with innodb_force_recovery to dump readable data, then rebuild the tables from that dump.

    AdvancedLinux server6 min read
  • Reset a Forgotten MySQL Root Password on Linux

    Recover access to MySQL or MariaDB on a Linux VPS by starting the server with skip-grant-tables, setting a new root password and restarting normally.

    IntermediateLinux server5 min read
  • Restore a single file or folder from a restic snapshot

    Find the right restic snapshot, restore just one file or directory to a temporary path, and put it back in place without running a full restore.

    BeginnerLinux server5 min read
  • Roll back a bad deploy using Docker image tags

    Tag every release, pin the version in your Compose file, and switch back to the previous image when a deploy breaks production. Includes verification and rollback of the database step.

    IntermediateLinux server6 min read
  • Run a Discord Bot 24/7 on a VPS with Docker

    Keep your Discord bot online around the clock by packaging it in a Docker image, passing the token as an environment variable and letting a restart policy bring it back after crashes or reboots.

    BeginnerLinux server5 min read
  • Run a private Docker registry on your VPS

    Host your own private Docker registry with the official registry image. Add TLS through a reverse proxy and basic auth, push and pull images, run garbage collection and size the storage.

    AdvancedLinux server5 min read
  • Run a Telegram bot with Docker and auto-restart it

    Containerise a Telegram bot, keep it running with a Docker restart policy, and read the logs when something breaks.

    BeginnerLinux server5 min read
  • Run Docker in rootless mode on Ubuntu

    Set up Docker rootless mode on Ubuntu so the daemon and containers run as a normal user. Covers the setup tool, the user systemd service, ports below 1024, storage and the trade-offs.

    AdvancedLinux server5 min read
  • Run PHP-FPM with Apache using proxy_fcgi and mpm_event

    Move Apache from mod_php and the prefork MPM to PHP-FPM with mpm_event and proxy_fcgi. Use less memory, serve more visitors and pick a PHP version per virtual host.

    IntermediateLinux server4 min read
  • Schedule restic backups with systemd timers on a Linux VPS

    Create a restic backup script, a oneshot systemd service and a timer unit so your Linux VPS backs itself up on a fixed schedule, with logs you can read in journalctl.

    IntermediateLinux server3 min read

Browse by topic

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.