Reach the phone

Quick check: can you say why localhost failed, put the LAN IP on the phone, and restart the server from a two-line runbook?

Pass at 70%. Feedback appears as you go, and only your first answer to each question counts.

Question 1 of 6

The server banner reads Serving HTTP on 0.0.0.0 port 8000. What does 0.0.0.0 mean here?

Show answer

Answer:

The server is listening on all interfaces, not only loopback. A client that can reach this machine's LAN IP on port 8000 can talk to it.

A full-credit answer shows: A strong answer covers: (1) all interfaces, not just 127.0.0.1; (2) that is why the LAN URL can work.

0.0.0.0 as a bind address is every door. 127.0.0.1 as a bind would have been laptop-only (objective 2).

Question 2 of 6

python3 -m http.server 80 fails with PermissionError: [Errno 13] Permission denied for an ordinary user. Why does 8000 work?

Show answer

Answer:

Ports below 1024 are privileged. Port 80 needs extra rights. Port 8000 is above that line, so an ordinary user can bind it.

A full-credit answer shows: A strong answer covers: (1) ports below 1024 are privileged; (2) 80 is in that range; (3) 8000 is not.

The privileged-port line is 1024. That is a Unix convention; on Linux the sysctl default is 1024 (objective 5).

Question 3 of 6

The phone still cannot load http://192.168.x.x:8000. Put these checks in the order that eliminates a whole class each time: firewall; server running in the right folder; phone using the LAN IP not localhost.

Show answer

Answer:

  1. Is the server running, in ~/projects/first-site? 2. Is the phone using the LAN IP, not localhost? 3. Then the firewall.

A full-credit answer shows: A strong answer puts server/directory first, then the URL the phone typed, then firewall. Order may swap the first two if both are named before firewall.

Do not start with the firewall. Confirm the server is up and the phone is asking for the laptop, then look at filters (objective 6).

Question 4 of 6

The two-line runbook is: start python3 -m http.server 8000 inside ~/projects/first-site; stop with Ctrl-C.

Show answer

Answer: True

Start in the right folder on 8000. Stop with Ctrl-C — you should see Keyboard interrupt received, exiting. That is the whole runbook (objective 6).

Question 5 of 6

Why does http://localhost:8000 work on the laptop and fail on the phone?

Show answer

Answer: localhost means the machine that is asking — the phone asked itself

The banner already said 0.0.0.0 — the server was willing. The phone used the wrong name for the laptop (objectives 1, 2).

Question 6 of 6

Your LAN IP is 192.168.1.42. Which URL do you type on the phone?

Show answer

Answer: http://192.168.1.42:8000

The third address uses the LAN IP and port 8000. localhost and 127.0.0.1 are the phone talking to itself. file:// is not on the network at all (objective 3).

Erase saved progress?

This erases all quiz scores, reading progress, project checklists, and your name on the certificate. It cannot be undone, and it affects only this course in this browser.