Final challenge: the shop is broken in three places
The last Ninja challenge: three changes in one night broke the shop in three places. Find each fault from the outside in, and fix them all properly.
Three people made three changes last night, none of them told anyone, and this morning the shop doesn't work for anybody. Your job: make http://web/api/products answer from your laptop again.
There's more than one fault, and each one hides the next. The checklist fills in as you fix them, and only for real fixes: no turning the firewall off, no pinning things that should work by themselves.
Work from the outside in, the way you did when the website was down:
- What exactly fails? Read curl's error from your laptop. "No route to host", "timed out", "refused" and "502" each point somewhere different.
- Can I reach the machine?
ping, anddigto compare what DNS says with what your laptop uses. - On the server: the firewall (
sudo ufw status), the services (systemctl status), and their logs (sudo journalctl -u). - Prove it from your laptop, where the customers are.
This is the end of the Ninja level, so the hints start small. web, db and the router are pretend machines inside this page, and Reset puts the night's mistakes back if you want another go.
Your turn
Make http://web/api/products answer from your laptop. Fix every fault properly.
Your task
Make http://web/api/products answer from your laptop. Fix every fault properly.
- Your laptop reaches web at its real address (not done yet)
- Port 80 on web lets requests in, firewall still on (not done yet)
- The API answers from your laptop (not done yet)
The checklist ticks itself off as you work in the terminal: any way that gets the result counts.
Hints come one at a time, then one way to do it. Try each before the next.
What this lesson uses, in one place.
ping- Check that another machine answers More on ping
dig- Ask a DNS server about a name More on dig
ufw status- On or off, and the rules (numbered: with numbers for delete) More on ufw
systemctl status- Is it running? recent log lines More on systemctl
journalctl -u- Only this service More on journalctl
curl- Fetch a URL, or test a web server More on curl
Every everyday command on one page: the Linux commands cheat sheet.