Linux Labs

Packages, services, and logs / Stage 7 of 13

Diagnosing a failed service

Not running Starting usually ~20 s
Leave the lesson

Step 7 of 8 · lab · 15 mineasy

Fix nginx

The nginx site stopped opening after yesterday's work. Find the cause and bring the site back.

Situation

The server ran a website on nginx. After yesterday's work on the server the site stopped opening: curl http://localhost/ says Couldn't connect to server. Nobody remembers what exactly was changed.

Task

  1. The default site answers at http://localhost/ with status 200 again.
  2. nginx runs as a systemd service, and its configuration passes the nginx -t check.
  3. The default site — the file /etc/nginx/sites-enabled/default and its listen lines — stays in place: fix the error rather than work around it.

The tools you need (nginx, curl) are already installed. There is no internet on this machine.

Lab · on your own

No commands are given in this lab: type them in the terminal yourself. Goals are checked on the machine after every command.

Goals

0 of 4
  • The nginx configuration passes nginx -t — not done yet
  • The nginx service is active — not done yet
  • http://localhost/ returns HTTP 200 — not done yet
  • The default site is still in place — not done yet
Ctrl+Enter
Starts the machine node1 · Ubuntu 24.04

The machine is starting

Hints

0 of 3

Lab goals

0 of 4
  • The nginx configuration passes nginx -t — not done yet
  • The nginx service is active — not done yet
  • http://localhost/ returns HTTP 200 — not done yet
  • The default site is still in place — not done yet
node1 Ubuntu 24.04

Lab goals

0 of 4
  • The nginx configuration passes nginx -t — not done yet
  • The nginx service is active — not done yet
  • http://localhost/ returns HTTP 200 — not done yet
  • The default site is still in place — not done yet
Loading…