Showing raw Markdown: the renderer could not load.
## Questions ### 1. Which description of a server is correct? *Objective: 1. Explain what a server is and how it differs from a personal computer.* - A) A special kind of machine that can only be bought from a server manufacturer. - B) Any computer that waits for requests and answers them. - C) The screen on which a website is displayed. - D) A program in the browser that draws web pages. ### 2. A friend hosts a small website on the laptop they use every day, and visitors often get no answer. Which reason is the most likely? *Objective: 1. Explain what a server is and how it differs from a personal computer.* - A) Laptops are not able to run server programs. - B) The laptop is asleep, off or on a home connection, so it is not always available. - C) A website can only be shown to one visitor per day. - D) Websites only work in data centres that have a screen. ### 3. You type `www.example.com` in a browser. What is the first thing that must happen before the page can be requested? *Objective: 2. Describe what happens between typing a web address and seeing the page (name, request, response).* - A) The server draws the page and sends a picture of it. - B) The name is looked up (DNS) to find the server's IP address. - C) The browser downloads the whole Internet. - D) The server asks you for a password. ### 4. In the log line `"GET /about.html HTTP/1.1" 404 -`, what does `404` tell you? *Objective: 2. Describe what happens between typing a web address and seeing the page (name, request, response).* - A) The server crashed and cannot answer. - B) The browser has no Internet connection. - C) The server answered, but it has no file at the path `/about.html`. - D) The page was found and sent successfully. ### 5. A company wants to publish a simple page of opening hours and does not want to install updates or make backups. Which option fits best? *Objective: 3. Compare ways of publishing a website: your own computer, shared hosting, a rented server and the cloud.* - A) Run a server on an office computer. - B) Rent a virtual server and look after it. - C) Use shared or static hosting where the provider runs the server. - D) Build a private data centre. ### 6. A company needs to install its own special software on the server, with full control of the system. What is the trade-off of renting a virtual server for this? *Objective: 3. Compare ways of publishing a website: your own computer, shared hosting, a rented server and the cloud.* - A) You get full control but you must do the updates, security and backups yourself. - B) You get no control but the provider does all the work. - C) You can only publish files, never run software. - D) It is free and needs no maintenance. ### 7. You start a web server with `python3 -m http.server 8000 --bind 127.0.0.1`. What does `127.0.0.1` do? *Objective: 4. Run a small web server on your own computer and open it in a browser.* - A) It is the password of the server. - B) It makes the server answer only requests coming from your own computer. - C) It is the number of visitors allowed. - D) It makes the server available to the whole Internet. ### 8. You start the server in a folder, open `http://127.0.0.1:8000`, and the browser shows a list of files instead of your page. What is the most likely cause? *Objective: 4. Run a small web server on your own computer and open it in a browser.* - A) The folder has no file called `index.html` (or you started the server in a different folder). - B) The browser is too old. - C) Port 8000 is closed on the Internet. - D) Python only shows file lists when it is running as a client. --- ## Answer key <details> <summary>Show answers</summary> | # | Answer | Explanation | |---|---|---| | 1 | B | A server is a role: any computer that waits for requests and answers them. It is not a special machine (A), and the browser, not the server, draws pages (C, D). | | 2 | B | A laptop can run server software, but it sleeps, gets switched off and has a home connection, so it is not always available. Data centres have no screens (D) and a website can serve many visitors (C). | | 3 | B | The browser needs the server's IP address before it can send a request, so it first looks the name up in DNS. The server never sends a picture of the page (A): it sends files, and the browser draws them. | | 4 | C | 404 means Not Found: the server is working and answered, but has nothing at that path. A crash (A) would give no answer at all, and success is the 2xx family (D). | | 5 | C | With only a page to publish and no wish to maintain a server, a provider-run service avoids updates and backups. A rented virtual server (B) leaves those jobs to you. | | 6 | A | A rented virtual server gives full control, so installing software is possible, but updates, security and backups become your job. Shared hosting is the one that gives little control (B). | | 7 | B | `--bind 127.0.0.1` makes the server listen only on "this computer", so nobody else on the network can reach it. It is an address, not a password (A) or a limit (C), and it does the opposite of D. | | 8 | A | When a folder has no `index.html`, the Python server shows a directory listing. Check that you started it in the right folder and that the file name is exactly `index.html`. | </details>