HfogDocsv1.0.0

Websites are down

A runbook for administrators — what to check first when the websites or the panel stop answering, which commands to run, where the logs are and how to switch to the standby.

Work through these steps in order. Most outages end at step 3 or 4. Run the commands as root over SSH.

Tip: the watchdog may already have restarted a service that hung. Look at its log before you restart anything yourself, and pause it while you work (step 4).

1. How much is down?

  • One website: the problem is that website — its code, its database, its domain or certificate. Look at the website's logs (/home/<user>/logs/) and at Websites › Logs in its Control Panel.
  • Every website, the panel still opens: the web server, PHP or the database. Go on with step 2.
  • Nothing answers (websites, panel, email): the server itself, its network or its disk. If you can't reach it over SSH either, go to step 7.

2. Ask the server

bash
hfog-agent health                              # services, configuration, disk, memory, SSL, clock, mail queue
tail -n 50 /var/log/hostfog-watchdog.log       # what the watchdog found and restarted
df -h / && df -ih /                            # a full disk (or no free inodes) stops everything

A full disk is the most common cause: free space first (Server health has Free up space), then go on.

3. Look at the services

bash
systemctl status nginx apache2 php$(cat /etc/hostfog/php_default)-fpm mariadb --no-pager
systemctl status hostfog-api --no-pager        # the panel program

With OpenLiteSpeed as the web server, use lshttpd in place of apache2. A service that is failed or keeps restarting says why in its journal: journalctl -u nginx -n 50 --no-pager (any service name).

Test the configuration before you restart a web server — a broken file stops it from starting again:

bash
nginx -t
apache2ctl configtest

4. Restart what does not answer

Pause the watchdog first, so that it does not restart services while you work on them:

bash
/usr/local/hostfog/bin/hfog-agentd watchdog-pause 60

Then restart only what is broken:

bash
systemctl restart nginx
systemctl restart apache2                       # or lshttpd
systemctl restart php$(cat /etc/hostfog/php_default)-fpm
systemctl restart mariadb
/usr/local/hostfog/bin/hfog-api restart         # the panel, without a gap

Server Admin › Server › Server health › Services restarts them from the panel too. When you are done:

bash
/usr/local/hostfog/bin/hfog-agentd watchdog-pause 0

5. Read the logs

Log What it says
/var/log/hostfog-watchdog.log services that did not answer, restarts and whether they helped
/var/log/nginx/error.log, /var/log/nginx/hostfog-error.log Nginx's errors, websites that could not be reached
/var/log/apache2/error.log Apache's errors
/home/<user>/logs/ each website's access, Apache error and PHP error logs
journalctl -u php8.3-fpm PHP-FPM (use the PHP version of the website)
journalctl -u mariadb MariaDB: crashes, a full disk, tables that need repair
journalctl -u hostfog-api the panel program
/var/log/hostfog-cron.log the panel's scheduled jobs

More logs are listed under Logs.

6. Busy, not broken

When every service runs but pages are slow or time out, the server may be overloaded: look at Resource usage for the busiest accounts, and at top or ss -s on the server. A single account using all CPU or memory can be limited under Resource limits.

7. Switch to the standby

When the server is gone — no SSH, or a hardware or network failure your provider confirms — and it has a standby:

  1. Open Server Admin › Accounts › Standby & failover on the main panel. When the main panel itself is the server that is gone, open the standby's own panel instead: it shows This server is the standby of ….
  2. Click Promote now on the pair, type the standby's name and confirm. Two-step sign-in is needed.
  3. The standby rebuilds the accounts, starts the websites, email and databases, and points the DNS records at itself. With records kept at most 5 minutes, visitors follow within minutes.

An automatic pair does this by itself when the standby and the witness both can't reach the primary.

8. Tell your customers

Post an incident on the Status page while you work, and close it when the websites are back.