Chapter 7: Static Website Hosting (3 OSes × 2 Web Servers)
Interview Questions
These questions help you prepare for discussions about static hosting. When you reply, describe what you actually tested in the dairy lab and what the result established.
हे प्रश्न static hosting वर चर्चा करायला मदत करतात. उत्तर देताना dairy lab मध्ये तुम्ही प्रत्यक्ष काय तपासलं आणि त्याचा काय निकाल आला हे सांगा.
ये सवाल static hosting की चर्चा की तैयारी में मदद करते हैं। जवाब देते समय बताओ कि dairy lab में तुमने क्या जाँचा और उसका क्या नतीजा मिला।
- Q1. What is a document root?
- The selected site’s ordinary file lookup starts at its document root. A local path often combines the root and URL path, subject to index, alias or other specific routing rules.
- Q2. How does one server host multiple websites on the same IP and port?
- Name-based virtual hosting: the web server reads the HTTP
Hostheader and chooses the matchingserver_name(Nginx) orServerName(Apache) block. - Q3. A static site returns 403 Forbidden. How do you troubleshoot?
- Confirm the intended vhost and path, read the error log, and check its directory and authorization rules and worker access along the path. If host policy applies, compare actual and expected labels and any relevant audit event before changing a label.
- Q4. What is the difference between
sites-availableandsites-enabledon Ubuntu? - On the expected Ubuntu setup, available definitions can be selected by links in the included enabled directory. Inspect the actual include, validate the configuration and apply it before testing the new named response.
- Q5. How do you upload a local folder to an EC2 instance?
- Use the authorized transfer and staging path for the assigned instance, such as SCP or SFTP with host identity verification. Compare the approved public manifest and use the site’s normal publisher to install those files in the intended release.
- Q6. How do you add HTTPS to a site on EC2?
- Choose the approved identity and TLS endpoint, then validate control through the appropriate ACME method. HTTP-01 starts on port 80. Install the certificate, verify the real HTTPS route and configure and test appropriate renewal and deployment.
Explain how the static site works using evidence from your lab
An interviewer may start with “Where did you put the website files?” and then ask why one URL worked while another returned a welcome page. Practise answering from an actual observation. Describe the role of the component in one sentence, tell the story of a particular request, then point out the check that distinguished your result from a plausible alternative. If you ran only a local fixture, say exactly what it verified and what a separate cloud deployment would still need.
Use an example such as the Mauli Dairy order notice and recipe blog. They share an approved service in the classroom, but they have separate content and logs. You can use those same facts to explain HTTP, address and host selection, Apache or Nginx configuration, releases and rollback. Change the example to match what you actually built. The questions here prepare you to reason about the work in an interview, including situations you could investigate even if you did not personally operate them.
Interview questions with worked explanations
What does a document root tell the web server?
It identifies the filesystem directory that supplies files for normal requests handled by a particular site. For example, with root /var/www/orders, a normal request for /hours.html can map to /var/www/orders/hours.html. A request for / may use the configured index file. More specific rules, such as an alias or rewrite, can change that simple mapping. Start with the selected virtual host and the rules for the exact path. A copy of the website in the administrator's home folder is separate from this configured root.
Use a diagnosis to make the answer concrete. If the administrator copied the public release into /var/www/orders/build and left the root at its parent, the expected index might be one directory too deep. The appropriate fix depends on what the deployment defines as the public directory. Inspect the approved manifest and the parsed site mapping. Then request the exact URL through the intended hostname and verify the resulting marker. That shows a content-path problem with independent evidence instead of assuming a file was missing entirely.
How do you distinguish a static page from a dynamic request?
A static file response reads already prepared bytes for the requested resource. An HTML page, stylesheet or event poster can be served this way. The page may still run JavaScript in the reader's browser. That code can interact with the visitor or call a separate API. The serving of the HTML remains a static file response while the API request can involve an application and database. Identify which response the question refers to because a single website visit can involve both mechanisms.
Suppose the lab homepage shows the scheduled collection time and also has a button that calculates an estimate. The script can compute locally in the browser; the server only sent static files. A button that posts an order to an application introduces a backend request with its own authorization and data handling. Uploading source files for that backend to the static document root cannot make them execute correctly. An interview answer should distinguish browser code, prebuilt site files and backend execution by following a concrete operation.
How can different websites use the same IP address and port?
First the client connects to the chosen address and port. Then the HTTP request indicates which name it intends. HTTP/1.1 uses a Host field, and later versions normally use equivalent authority information. A web server uses the eligible listener group and the requested name to select a site definition. Nginx commonly uses server_name. Apache uses ServerName and optional aliases. Each block can configure its own document root, logs and access rules.
With one test listener both orders.mauli.example.test and recipes.mauli.example.test can return a separate /about.html. Use curl's temporary address mapping so both commands connect to the same listener while retaining their names in the URLs. Confirm that they return different planned bodies. An IP-only request may show the listener's default and tells you little about whether an exact configured name works. In a real deployment DNS also needs to lead clients to the approved destination.
What happens if no configured virtual host matches the name?
There is usually a fallback within the address and port group that handled the connection. In Nginx it can be configured with default_server on the listener, otherwise the first appropriate server block can act as the default. In Apache the first eligible vhost normally handles unmatched requests in that group. On a fresh Ubuntu package it might be the existing welcome site. On a managed server it could be a deliberately chosen neutral response. Check the complete loaded config and the site owner's policy.
A strong follow-up is to explain your verification. A known unmatched name selects the baseline fallback. The new name selects a different root and serves your approved marker. Both can return 200 for their own valid pages. Include the expected fallback in your acceptance plan, especially when touching a shared server. Removing a default without checking its responsibilities can change another site's behaviour and still leave the intended name misspelled or absent from the active configuration.
What are Ubuntu's available and enabled site directories for?
The available directory conventionally stores candidate definitions. The enabled directory contains the entries selected by the package's active include. Often they are symlinks to those definitions. On Ubuntu, administrators commonly create the Nginx link explicitly, while a2ensite can manage the Apache link. These paths are a package convention. Find the relevant include and confirm that it actually reaches your file. A dangling link or a missing extension can produce a different parse result from simply saving a well-formed candidate.
Describe the three states. A valid draft can be written and remain excluded. An enabled entry can make it part of the configuration on disk. Only a successful activation and meaningful request can establish that the running daemon is serving it. Read the full named mapping after validation and send an intended host request after the approved reload. A site may need to be disabled by removing only its enabled link and applying the revised configuration, while its candidate remains available to review.
What would you check if a configuration test passes but the website still uses its old rules?
Confirm the command tested the same binary and actual inputs as the service. The syntax check can succeed while the candidate is outside its includes, an old definition is still selected, or a warning indicates the new name was ignored. After checking the parsed map, see whether the service adopted it through the approved start or reload. Read recent service logs and repeat the exact intended request. A saved file and a running process are two separate observations.
For a concrete example, a user saves the recipe block with a misspelled extension under an include that only reads *.conf. The parser never opens it. Another user puts the file in the correct place and forgets to reload. Both symptoms may produce the previous page. Under the first case the expected site is absent from a full config inspection. In the second it can appear in the disk configuration, but the observed active response remains old until the process successfully adopts it. Use one test for each gate.
What is a safe approach to uploading public files to an EC2 instance?
Start with the normal authorized login and intended staging path. Use an approved transfer such as SCP, SFTP or another site process. Confirm the server's identity through the normal host verification and keep keys private. Compare the received directory with the reviewed public manifest. Then publish the approved files under the expected root through the owned release process. A successful transfer indicates the client wrote files where directed. It does not show that the named web server now uses those bytes.
Suppose the student cannot write inside the managed public root and considers changing its permissions broadly. The approved staging path is the correct initial destination for a normal login. The site's publisher can install only the required files with the intended modes. Confirm that their parent directories are accessible to the worker and that unexpected private files stayed in staging. Check an updated content marker and independent asset request afterward. This answer connects safe transfer, correct filesystem placement and actual acceptance.
What is the first step when one static URL returns 403?
Identify the selected site and request. Read the relevant error context and determine how the URL maps to a public file or directory. A directory with no index and no allowed listing can give 403 while a direct file still works. A file can be refused by Apache authorization, ordinary modes or a host policy such as SELinux. Check the exact path and all ancestors from the service account's perspective. Test a known legitimate file as a control and keep policy changes scoped to evidence.
For a CentOS Stream fixture, record actual and expected labels and, if present, a closely matching audit event. The same mode bits and different labels can explain why an administrator and the worker get different outcomes. restorecon applies the file-context policy for that path; it does not choose a content type based on the intended use you forgot to configure. A missing expected mapping calls for a reviewed narrow mapping. A broad chmod or a global policy change before this diagnosis can obscure the reason for a refusal.
How do you distinguish a service problem from remote connectivity?
Record one complete expected URL and test the intended local vhost through its listening address. If local works and an approved remote client cannot connect, compare that client's destination, scheme and address family. Inspect the actual binding and applicable cloud route and traffic rules. Guest firewalls and security groups act separately. Use an authorized target and do not assume every training exercise should be public. If both fail before an HTTP response, inspect service health and socket ownership before changing website files.
One supporting observation is a log entry from the relevant site. An accepted HTTP request usually leaves evidence where the service is configured to record it. A missing record could reflect the wrong vhost or disabled or buffered logging, so it is not proof by itself. Combine the offered listener, concrete client error and request trace. If the outside request returns a 403 from the intended server, a connection has already succeeded and your next check concerns the refusing component rather than granting more public access.
Why can a successful HEAD request miss the deployment problem?
HEAD usually asks for metadata corresponding to GET but omits its response body. It can be a useful small test for status and headers when the server supports it. It does not prove that the body contains the approved release, nor does it make subsequent requests for style or image assets. A request to the wrong hostname can also make HEAD succeed against the default site. The useful answer is that HEAD is one limited observation in a larger check.
For example, a script using curl -I http://localhost receives status 200. The default page is healthy, but the requested orders name still shows an older version. A named GET test reads the intended welcome marker and a separate request tests an important stylesheet. Compare the actual type and body at each path. When the interviewer asks which command you ran, give the interpreted result with the hostname and path. The command alone does not establish anything about the site that should have been selected.
What should you check when the browser has no style but the page is 200?
Open the browser network view and inspect the actual stylesheet request. A relative reference can resolve beneath a nested page and produce a request to an unintended path. An asset URL can return 404 or send an HTML fallback with status 200. The meaningful evidence is the URL, response type and CSS bytes from the expected host. Also check whether the browser reused a cached asset or blocked a mixed-content request from the protected document.
Give a small trace: the document /news/index.html links to css/notice.css. The client asks for /news/css/notice.css, while the intended published file is at /css/notice.css. In a host-root deployment a deliberate root-relative link can fix that example. For a site served under a path prefix the correct URL has to include its deployment context. Apply one link or mapping fix, verify the independent resource request and keep the known-good HTML result as a control.
How would you design a useful custom 404 page?
First identify the missing-resource behaviour. The server returns the helpful public body and retains the intended 404 status. The page can offer a link to an available route without making the missing URL return a successful homepage by default. In Nginx an error_page rule can serve the content from a local URI. Apache's local ErrorDocument path can do the corresponding job. An external redirect can change the result observed by the client, so check the scope and status of the configured action.
In the lab request a unique absent path at the named site. Show the 404 line, the helpful body marker and the corresponding access log from the expected vhost. If you put a stylesheet link in the error page, remember that the browser still sees the original missing URL when interpreting a locally rendered error. Test one missing nested path to verify the style URL under that condition. A screenshot of the nice message alone cannot establish the actual missing-resource status.
Which claims about static hosting on EC2 and S3 would you compare?
EC2 gives you a guest where you operate the OS, a web server and its connectivity. It can be useful for learning Nginx and Apache configuration or for a deployment that needs control of the host. A static S3 origin stores public site objects without requiring you to manage that guest. The S3 website endpoint has distinct website behavior and does not support direct HTTPS. A deployment using CloudFront can expose an HTTPS viewer endpoint and have its own origin configuration and cache behaviour.
Explain which S3 origin type you would choose for the requirement. CloudFront origin access control works with an appropriate regular bucket origin. An S3 website endpoint is configured as a custom origin and cannot use that OAC feature. Index, redirects, object access and cache policy still require deliberate setup. The comparison should follow the workload and management responsibility instead of promising that one method is always cheaper, faster or mandatory. This chapter's preference is an EC2 experiment because it lets you observe the host's own service and file mapping.
How would you add HTTPS to the assigned public site?
Identify which controlled DNS name or eligible address the client will use. Choose where TLS terminates and an authority the intended clients trust. For a Let's Encrypt DNS name, validate control with a suitable ACME method. HTTP-01 initially reaches port 80, while DNS-01 uses a DNS record. Certificate installation is a separate operation, and the normal protected website needs an accessible HTTPS listener. Test the served chain and identity using the actual hostname, then verify the site's HTTP response over that connection.
Follow-up questions often connect TLS to multiple sites. SNI can carry the name in the TLS handshake before HTTP sends its host information. An HTTP Host override on a bare IP URL does not necessarily exercise the required TLS identity. Keep the hostname in the URL and override just the destination in a controlled check if needed. Finally plan renewal and adoption by the active listener. Repeat the certificate probe after renewal. A first issue and an enabled job do not by themselves prove the server will present the replacement.
How can an address change break a previously working cloud site?
An automatically assigned public IPv4 address can change across an EC2 stop and start. A saved address URL, old DNS answer or external routing rule can still point at a prior destination. Start by inspecting the assigned endpoint and the actual A or AAAA answer returned to the affected client. DNS answers can be cached. A successful loopback request on the new guest proves the local service and chosen vhost, not where a separate reader's DNS takes them.
A stable associated address such as an Elastic IP is one approach for a direct public IPv4 endpoint. A load balancer or CDN can supply a different approved destination. Choose the planned address model and keep DNS and certification ownership clear. A document root or server_name configured for the same hostname need not change because its endpoint address changed. Test the normal named route and the served release after any intended address update, and verify the old endpoint does not still carry traffic needed by another owner before retiring it.
How do you preserve a working site while activating another?
Identify the existing listener, service and fallback. Use a new owned configuration entry, unique site name and prepared root, with a scoped private copy of what will change. Confirm the include map and validate the whole selected configuration. Apply the change under the service owner's approved procedure. Then request both the new host and one known existing control, along with the expected fallback when relevant. This proves independent operation on the same service instead of checking only the new landing page.
A behind-the-scenes difference is whether the change involves config or just served file bytes. Replacing a published file within the current root can require no reload, while selecting another root or vhost changes startup inputs. Another process already bound to the port may own an unrelated site. In that case use an isolated high-port or disposable practice service. If a shared change needs to be reverted, restore the exact previous entry and release selection with validation and the same acceptance matrix.
What would you write in a troubleshooting handoff?
Start with the expected request, the observed result and the smallest known-good control. Include the relevant hostname, path, scheme and approximate time. Identify the environment and whether the client took the normal route or a temporary destination override. Add one piece of supporting evidence, such as a vhost log entry or exact client error. Then give the next candidate check that would distinguish the problem. This is more useful than listing every tool you know.
For example, the named orders about page returned 200 with the approved marker from the instance, but a permitted remote laptop could not connect to the URL on port 80. Confirm the outside destination and guest binding, and hand the evidence to the network owner. If the laptop instead got 200 from the old welcome site, the selection and destination checks take priority. Keep unrelated client logs and secrets out of your handoff. Choose one request and one diagnostic difference so the owner can reproduce it quickly.
Lab one. Use a real response matrix as interview evidence
For this exercise you need Python 3. The loopback fixture returns a distinct marker for two practice names. It uses a small purpose-built handler to model routing and returns a custom missing-resource body. You will send both names to the same socket, check the status and marker, then compare an absent path and a HEAD response. This lab checks HTTP behavior with real local connections; it does not claim to validate an Apache or Nginx package configuration. Use the standalone virtual hosting lesson for a comparison with those actual servers.
python3 - <<'PY'
from http.client import HTTPConnection
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
from threading import Thread
orders = "orders.mauli.example.test"
recipes = "recipes.mauli.example.test"
markers = {orders: b"Orders exercise release\n", recipes: b"Recipes exercise release\n"}
class Practice(BaseHTTPRequestHandler):
def reply(self, include_body):
name = self.headers.get("Host")
if self.path != "/about.html":
code, message = 404, b"Exercise page is missing\n"
else:
code, message = 200, markers.get(name, b"Fallback exercise release\n")
self.send_response(code)
self.send_header("Content-Type", "text/plain")
self.send_header("Content-Length", str(len(message)))
self.end_headers()
if include_body:
self.wfile.write(message)
def do_GET(self):
self.reply(True)
def do_HEAD(self):
self.reply(False)
def log_message(self, format, *args):
pass
with ThreadingHTTPServer(("127.0.0.1", 0), Practice) as listener:
thread = Thread(target=listener.serve_forever, daemon=True)
thread.start()
try:
cases = (
("GET", orders, "/about.html", 200, markers[orders]),
("GET", recipes, "/about.html", 200, markers[recipes]),
("GET", "unknown.example.test", "/about.html", 200, b"Fallback exercise release\n"),
("GET", orders, "/retired-offer", 404, b"Exercise page is missing\n"),
("HEAD", orders, "/about.html", 200, b""),
)
for method, name, path, code, marker in cases:
conn = HTTPConnection("127.0.0.1", listener.server_port, timeout=3)
try:
conn.request(method, path, headers={"Host": name})
response = conn.getresponse()
body = response.read()
assert response.status == code and body == marker
if method == "HEAD":
assert int(response.getheader("Content-Length")) == len(markers[name])
print(method, name, path, code, body.decode().strip() or "(no body)")
finally:
conn.close()
finally:
listener.shutdown()
thread.join(timeout=5)
PY
Give an interview answer based on the printed rows. The first two have the same path and connection address but produce different markers after the hostname decision. The third is a successful fallback. The missing route returns a helpful body along with 404. HEAD returns metadata and no body despite a successful status. Those are observations, with an explicit scope. No DNS records, certificate authorities or cloud access rules were tested. Stop the isolated fixture by letting it exit normally; its server thread shuts down within the script.
Lab two. Rehearse a change explanation with a partner
Use the output of the loopback script or a real training deployment you performed. Pick one prompt from the first half and one troubleshooting prompt from the second half. Ask your partner to introduce a single change such as a wrong hostname, a missing file or an unavailable remote route. Describe one additional observation that would narrow the cause. Say which platform action you would defer until that observation is available. Keep your proposed change inside the approved site's scope.
State a simple definition of the relevant mechanism, such as “the document root is the starting directory for the selected site's file mapping.”
Give a concrete case and request. Include the intended host and path, how the connection was directed and which result or file you expected.
Pick a control and explain its value. For example, a second working path on the same vhost can distinguish a missing file from a whole listener problem.
Report the observed scope. Distinguish a local demonstration from a verified public deployment and name any verification you did not need for that scenario.
A passing answer should let the listener draw the request path and point to a specific observation that supports the conclusion. If your answer would fit any server outage without changing a word, add the exact hostname, status or file marker. If it relies on an untested assumption, describe how you would check it. There is no cloud cleanup for this spoken exercise. Keep your own anonymized evidence notes for further practice.
Follow-up questions for explaining tradeoffs and edge cases
Does setting up two virtual hosts isolate two customers from one another?
It gives the requests separate routing and configuration. Their document roots can have distinct publication workflows. The workers may still run with access to both sites, and reloading or stopping one shared service can affect all virtual hosts. They can also share CPU, memory, storage and log facilities. If the owners need strong security or deployment boundaries, decide which service identity, process and infrastructure separation the requirement calls for. Authorization needs its own controls; the host value in an HTTP request is not a user credential.
A useful example is a training server that hosts two public notices under one trusted team. The use of separate sites is enough to distinguish visible content and logs. If the operators have to prevent one publisher from writing the other release, make those filesystem controls explicit. If the requirements go further and include independently managed maintenance or process failures, the single shared service may be insufficient. Explain the responsibility and threat boundary before promising that a virtual host solves it.
How would you explain a cached old page after a successful deploy?
Compare the expected published file and the true origin response first. Then compare the browser's actual URL, cache evidence, and the client route to any intermediate proxy or CDN. An earlier successful request may have stored a response according to its cache policy. A conditional request can receive 304, meaning the client may reuse its stored representation rather than receiving a new body. A correct origin request cannot establish which response some outside cache served for a different hostname or path.
Give a version-aware test plan instead of a blanket flush instruction. Request the origin and deployed URL with the same content marker and inspect the associated cache metadata. Check the stylesheet link generated in the current HTML. If it identifies the prior asset by name, replacing another file cannot repair that link. If the approved design uses versioned asset names, validate the new name and allow older documents to retain their expected assets until the release plan permits removal.
What would you verify before moving a site between Ubuntu and CentOS Stream?
Keep the public release manifest stable and check each target system's process and policy settings independently. On Ubuntu confirm the package's site include and enabled link mechanism, and the actual service unit. On CentOS Stream check RPM package names, the effective include and current file context mapping. Inspect the actual user and directory policies rather than assuming the site's owner, root or worker is the same. Guest firewall configuration can also differ. Verify a named local path before testing any outside route.
| Check | Observation to record | Reason |
|---|---|---|
| Package and unit | Distribution, installed version and actual unit command. | The package name and wrapper can change between systems. |
| Site config | Included file, named socket group and selected document root. | A working definition on disk must be picked up in this service. |
| File access | Publication owner, worker identity, ordinary modes and any relevant host policy. | A different process or host can require different access. |
| Acceptance | Expected name, exact path, status, media type and body marker. | HTTP evidence can compare the same logical site across installations. |
The table is an answer framework, not a promise that six combinations have exact universal directory paths. An interviewer may mention a custom configuration. Ask about the actual settings and how the package is invoked. Keep your practice response focused on the stable mechanism and cite the system details you actually observed.
What kind of backup do you need before changing a shared host's root?
Preserve the approved prior release and the exact site entry that selects it, along with any relevant enablement link or hosting parameters. Store the configuration and public files in an approved nonpublic backup location. A routine machine or volume backup may serve broader recovery needs. When changing one vhost, practise restoring its specific pointer and prior files so you can verify the scope of backout without rolling back another site's successful work.
During the interview say what post-restore evidence you would collect. The old named homepage and asset should regain their markers, and their expected missing path should keep the right status. A control site remains available. For a config rollback check syntax and effective mapping before activating it. A successful restore to disk and the running service's response are separate acceptance points. This distinction shows the practical value of a backup more clearly than a statement that snapshots are always enough.
How would you explain 0755 and 0644 without treating them as universal fixes?
Read the three permission digits as owner, group and others. A directory mode of 0755 lets its owner read, write and traverse it and permits other users to read and traverse under the ordinary mode check. A file mode of 0644 allows only the owner to write and makes its bytes ordinarily readable by group and others. That can be appropriate for a deliberately public sample. The service still needs traversal on its parent path, and site and host policy can add conditions. Avoid explaining an octal mode as permission to visit any URL.
Give an example involving a privately staged directory. Its owner can read the file and the file itself is 0644. If the web worker lacks search access to the staging directory, the access path fails. The intended design is to publish a reviewed copy into a suitable root. Opening the home folder or giving the server ownership is unnecessary. This answer is stronger than memorizing two numeric values because it connects the mode to who performs the operation, which path is traversed and what the site is supposed to serve.
What is the difference between an active service and a service enabled at boot?
Active describes the unit's current runtime state as seen by the service manager. Enablement usually describes configured activation through earlier or future targets such as boot. A service can be active for this training session without being enabled for boot. It can also be enabled and currently stopped. Check both states because a machine restart tests a different condition from a file update. Then verify the exact socket and expected site response, because a running healthy unit may serve another vhost at the same address.
In a shared change, capture the before and after state. A trainee should not disable an unrelated service just to get a lab listener. If their own task needs a test at boot, obtain an isolated instance and agree how to restore its original startup state. If they only need to compare content mapping, an ordinary local executable on a temporary loopback port can prove that without changing any unit. An interview answer should connect systemd's observations to the lifecycle the assignment actually requires.
Where does browser feedback fit when the origin's tests pass?
A named origin request verifies the selected resource for its test route. A browser can use another address family, follow redirects, validate a different TLS endpoint and fetch several dependent resources. It can also use cached responses and apply policies to their types or trust. When a browser report differs from the origin, first compare the exact URL and requested asset with its status, headers and body. Avoid assuming a new origin process behaves incorrectly just because the screenshot is stale.
Reproduce the closest visible failure and keep a separate origin control. If the public page refers to an older versioned file, correct the published reference or release selection. If the normal DNS path reached an earlier machine, compare that address with the new approved target. When the origin and client routes intentionally differ, state the limit of each test during the interview. A clear explanation of uncertainty is useful when the next observation depends on a service the candidate did not administer.
Check your reasoning
Both practice names use the same listener. The wrong site appears only for a bare IP request. Which check tests the configured named route?
Show answer
Use the intended hostname and the approved destination. The bare IP can select the fallback. Compare the body marker and expected site log.
The candidate vhost exists and syntax passes. The active config dump does not mention its file. What state is missing?
Show answer
The definition isn't part of the parsed inputs for that service. Inspect the actual include pattern and expected enabled entry.
An index-less directory returns 403 but its readable file returns 200. What did the two requests establish?
Show answer
The server can refuse to present a directory listing while allowing direct access to its intended public document. The successful file request is distinct.
Certbot reports HTTP-01 failure before the site has a certificate. Which initial network port matters?
Show answer
HTTP-01 validation begins on port 80. Test the specific challenge URL through the approved public path. The final HTTPS listener normally uses port 443 separately.
What body evidence does a successful HEAD request supply?
Show answer
HEAD omits the response body. Use a named GET and check the intended content, plus its required assets.
Practise an interview answer with a concrete control
Explain the two labelled hostname rows and the unmatched row from the local fixture. Your answer should distinguish how the endpoint was reached from how the website was selected.
Build a concise answer for a mismatch between the selected vhost's release and the staging tree. Name the file and response checks you would run before touching service policy.
Choose an HTTPS or 403 question and ask a partner to add one constraint, such as a private route or a file already labelled correctly. Revise your diagnostic plan so each proposed observation addresses that constraint.
Revision cards
- Document root
- The selected site's normal filesystem start for public paths, subject to scoped alternate mappings.
- Default site
- The eligible fallback for the listener when the requested name has no match.
- Enabled configuration
- Candidate selected by a loaded include and, after activation, used by the process. Verify the steps separately.
- Request scope
- One intended host, scheme, destination and path. Add a related control to make the comparison meaningful.
- TLS handshake
- Authenticates an eligible server identity and establishes protection before the HTTP request proceeds.
- Verified rollback
- Restore the prior specific inputs and prove the relevant HTTP paths and protected controls still respond as planned.
Official sources
- HTTP request, authority, methods and status
- HTTP cache policy and validation
- Nginx request selection
- Nginx root and error mapping
- Apache address and name selection
- Apache core directory and error directives
- Ubuntu Apache site helpers
- Ubuntu Nginx layout
- Linux path resolution
- SELinux troubleshooting
- VPC security groups
- EC2 Elastic IP addresses
- S3 static website endpoint behavior
- CloudFront S3 origins and access controls
- Let's Encrypt challenge methods
- TLS Server Name Indication
- TLS identity verification
- Curl address override and HTTP methods