Linux Labs

Web stack / Final lab

A site and its database on two machines

hard ~50 min
Not running Starting usually ~20 s
Report a problem

Situation

The orders site app.lab.test and its PostgreSQL database used to live on one machine, node2. The site has moved to node1: nginx with HTTPS and the application, the lab-shop service, now run there. The shop database stayed on node2. Since the move, curl https://app.lab.test/ on node1 answers with an error instead of the order list.

node1 is your terminal. Run commands on node2 over SSH: ssh node2 'command', or enter its shell with ssh node2 and come back with exit. sudo works without a password on both machines. There is no other way into node2, so don't lock yourself out of SSH.

Task

  1. curl https://app.lab.test/ on node1 gets HTTP 200 and the order list from the database on node2.
  2. The shop role logs in to the database from node1 with its password, and with a wrong password neither shop nor postgres can log in from node1.
  3. Port 5432 on node2 is open to node1 and closed to other addresses on the network, and stays so after node2 reboots.

The lab has no internet access, only the network between node1 and node2. Everything you need is installed on both machines.

Visible only to you. Saved as you type.

All notes

Lab goals

0 of 3
  • curl https://app.lab.test/ on node1 gets 200 and the order list from the database on node2 — not checked yet
  • From node1 the shop role logs in with its password, and with a wrong password neither shop nor postgres gets in — not checked yet
  • Port 5432 on node2 is open to node1 and closed to other addresses on the network — after a node2 reboot too — not checked yet

Hints

0 of 3 open · they open one at a time
Hint 1
Show the solution after 3 failed checks

Leave the lab?

The machine keeps running for 10 more minutes, then it is removed. Files are lost; completed goals stay.

Loading…