Intermediate · 12 min · practise every command in the built-in terminal

🎯 Mission Briefing: Service Down

The company website just went dark. Customers are seeing "connection refused" errors. Your team lead is watching over your shoulder in a video call, waiting for an update.

Your objective

Diagnose why the nginx service is down, check its logs for the root cause, and bring it back up.

Diagnosis toolkit

systemctl status nginx          # Is it running? Since when? Any errors shown?
journalctl -u nginx -n 50       # Recent log lines for the service
journalctl -u nginx -p err      # Just the errors
ps aux | grep nginx             # Is a process actually running?

Recovery

sudo systemctl restart nginx
systemctl status nginx          # Confirm it's active (running)
sudo systemctl enable nginx     # Make sure it comes back after a reboot too

After the fire is out

Always confirm and report:

systemctl is-active nginx
curl -I http://localhost

Practice tasks

  1. Check the status of the nginx service to see why it might be down
  2. Check the service's recent logs for the root cause
  3. Restart the service to bring it back up
  4. Confirm the service is now active
  5. Verify the site responds again

Commands in this lesson

Missions