Ravindra BagaleCourses & study guides मराठी Track your progress

Chapter 7: Static Website Hosting (3 OSes × 2 Web Servers)

AWS Cloud

7.2 The hosting matrix

Six combinations may sound like a lot, but look – the idea is the same everywhere: files in a folder, a config that points to that folder, correct permissions, and reload. Package paths and names can differ, along with service activation and host security controls. Verify the active configuration before applying a step. Got it?

We will host the same site in all six combinations. The named examples use a dedicated /var/www/mysite training root and a server block or virtual host for the selected server. Use an approved unique path. The default-root demonstration is only for a disposable setup that has no unrelated site.

OS Web server Install Site config file Document root used Web-server user Extra step
Amazon Linux 2023 Nginx dnf install nginx /​etc/​nginx/​conf.​d/​mysite.​conf /var/www/mysite nginx —
Amazon Linux 2023 Apache dnf install httpd /​etc/​httpd/​conf.​d/​mysite.​conf /var/www/mysite apache —
Ubuntu 22.04/24.04 Nginx apt install nginx /​etc/​nginx/​sites-​available/​mysite + symlink /var/www/mysite www-data Verify the site include and retain the existing default on shared hosts.
Ubuntu 22.04/24.04 Apache apt install apache2 /​etc/​apache2/​sites-​available/​mysite.​conf /var/www/mysite www-data Enable the authorized site using a2ensite. Preserve unrelated sites.
CentOS Stream 9 Nginx dnf install nginx /​etc/​nginx/​conf.​d/​mysite.​conf /var/www/mysite nginx Verify the active firewall and SELinux policy; inspect or apply approved labels as needed.
CentOS Stream 9 Apache dnf install httpd /​etc/​httpd/​conf.​d/​mysite.​conf /var/www/mysite apache Verify the active firewall and SELinux policy; inspect or apply approved labels as needed.

Common package default roots for a disposable test: Confirm the selected server’s active root before putting any file there. Nginx on AL2023/CentOS → /usr/share/nginx/html; Nginx on Ubuntu → /var/www/html; Apache on all three → /var/www/html.

Pre-requisites for every combination

  1. Use the approved EC2 training host and management path. An external test needs permission for the exact caller, listener and route. A loopback test needs no public inbound rule.
  2. Confirm the actual guest login and access method for the selected image. Common Amazon Linux and Ubuntu examples use ec2-user and ubuntu. Verify the CentOS Stream image publisher’s instructions.
  3. Check that the intended address and port can be used. An overlapping bind can fail. A shared server’s active service is outside a site-only exercise.

Ravindra Bagale's Tip

Nginx and Apache can both be installed. Starting two independent services on an overlapping address and port can report Address already in use. Inspect the listener’s owner and use the approved isolated service or another planned listener. Leave existing sites and services running unless their owner has authorized a change.

Lab

Choose the row matching your training OS and web server. Record the expected site configuration, root and worker identity. On permitted Linux, inspect the chosen TCP listener with ss -ltn and confirm its address and port. Use the supplied worksheet if the actual service is outside your scope.

Keep the same website while learning six deployment environments

Mauli Dairy publishes the same three teaching files for each exercise: an HTML page, a stylesheet and a small rate-sheet download. There are three operating system choices and two web-server choices. This produces six combinations, but the browser still needs the same content at the same allowed path. The job is to select the steps that belong to the actual host, then demonstrate the same public artifact and HTTP response. Treat the matrix as a translation table for operating tasks.

Start by separating four decisions. First, determine the operating system and release so you know which package manager and support policy apply. Second, choose Nginx or Apache and find the matching service and configuration conventions. Third, designate a directory containing the approved files. Fourth, verify how the selected site's socket, host name, access controls and file permissions let a permitted client receive them. The HTML should not need a rewrite from Nginx to Apache just because the server package uses another configuration syntax.

Compare a familiar example. On Ubuntu the Apache service is usually labelled apache2. On Amazon Linux and CentOS Stream the analogous package and service are commonly called httpd. Both implement Apache HTTP Server, but their packaging, included paths and tools differ. A command failure saying apache2.service was not found could mean you picked the wrong packaging row. It doesn't prove the application was never installed or that all routes are broken.

Machine images and administrator choices can change the installed layout. The table uses common package defaults as evidence to verify, not as promises about every host. Work on an isolated authorized guest or a paper copy. The objective is to learn how to find and validate the right configuration, not to replace the default publication path of an existing server. A working site in another combination can continue using its own packages, port and document root.

Use the headings in the matrix to ask one question at a time

Operating systemPackage and service names for common distributionsCommon configuration approachQuestions worth verifying
Amazon Linux 2023nginx or httpd, typically via DNF.Each package has its own main config and can use the corresponding conf.d directory under the expected includes.Which package repository and release does the image use? What exact configuration is loaded?
Ubuntu Servernginx or apache2, typically via APT.Common package layout distinguishes available site definitions from enabled sites.Which site is enabled, which package service owns the listener and what permissions does the intended worker run with?
CentOS Stream 9nginx or httpd, typically via DNF.Use configured include paths and check security policy and any active host firewall before declaring the server reachable.What security mode, active zone and filesystem context apply to the selected path?

Follow a chosen row from left to right. Confirm the current OS using an approved shell. Identify the package and installed service with the system's package tools and service manager. Find the active configuration, planned host name and root directory. Identify the worker user, which can differ from the listener's administrative process. Check the test client's allowed access. A successful package install does not complete all of those tasks; it only provides the software and distribution defaults.

On a machine with a custom image, the active Apache binary might use a different configuration file, or Nginx might use a prefix override and a custom include directory. Confirm how the operating system actually starts that service. A visible file under /etc is not proof that the running process reads it. Compare the service unit and the server's reported configuration under the account's permitted scope. A site in an enabled directory can still contain a directive with a wrong path or mismatched name, so continue to a useful request.

Keep the published example root consistent across the chapter's paper drills so that differences in host packaging stand out. A real deployment still picks an authorized dedicated directory. If another site already uses the printed path, use a distinct owner-approved one for your exercise. Do not treat a course path as permission to overwrite what's already there.

Install with the host’s package tools and identify the exact service unit

Amazon Linux 2023 uses DNF as its package management tool. Its yum command can provide compatibility in typical setups, but course instructions should use the documented native tool and supported repositories. CentOS Stream 9 also commonly uses DNF. Ubuntu uses APT tools for standard packages. The package manager checks configured repositories and installed files. Follow the account's approvals for software changes and use currently supported sources rather than adding a random repository to make a name resolve.

Package name and service name often match but are separate types of records. An install request obtains packaged files and registration. A service manager reads a unit that starts a process with specific arguments and environment. Check the actual unit's status and configuration. On a distribution where package installation can start a service automatically under its policy, inspect the listener afterward. Two packages can both be installed even when only one should own the chosen listener.

Service state and boot enablement answer different questions. A process can be active now without being enabled at boot. A unit can be enabled for future startup while currently stopped, failed or conditioned on other settings. Inspect each under the approved environment. Do not change boot enablement just to check whether the current server is alive. Check the service, listener and intended response first. Label changes you make in an authorized disposable environment so the next user can see what persists after restart.

If a distribution-specific command is missing, stop and determine the operating system, package layout and access level. It may be the wrong command for that host. It may also mean a utility is not installed in the minimal image. The absence of one command does not prove there is no service. Use the platform's supported read-only equivalent or ask the administrator. The matrix gives clues to the next check rather than a reason to install both web servers on every machine.

Verify that the site configuration is actually loaded

A Nginx site typically uses a server block. An Apache site can use a VirtualHost block. Each can bind the selected listener, match the intended host and relate requests to file and directory handling. The form of the configuration is different, and the site can still serve the same public artifact. Do not paste Apache directives into an Nginx file or rely on a similar-looking root path to establish that the rest of the configuration fits.

On Amazon Linux and CentOS Stream, package configurations commonly include suitable snippets from a conf.d directory. On Ubuntu, nginx's package ordinarily uses sites-available and sites-enabled and loads the latter through its main configuration. Apache's Ubuntu packaging provides site activation tools such as a2ensite. A file left only in an available directory typically isn't active unless the documented include links it. Verify what your actual main config includes before adding a new file or symlink.

Run the appropriate configuration check before applying a permitted change. Nginx nginx -t tests the configuration syntax and tries to open files it references under the invoking permissions. Its detailed configuration output can reveal site settings, so handle it privately. Apache supports checks such as apachectl configtest or a platform-appropriate apache2ctl configtest and can report virtual-host configuration. A successful test is a check of that input and environment. It does not establish the right hostname, served response or known file ownership.

Test an intended host with an identifying marker in its response. A valid configuration can still select another virtual site as a default. Compare the site's actual listener and host matching, rather than simply reading the first site in a sample config. Verify the public request path and asset responses when the lab is meant to use them. Switching directly to a default root for a live site can overwrite an unrelated publication. A named dedicated root helps keep that change scoped.

Find what owns the address and port before changing services

The common classroom shorthand “only one web server on port 80” refers to the ordinary collision when two independent services both try to bind overlapping TCP listeners on the same network address and port. A process can serve many virtual hosts through one socket. Two servers can also use distinct ports or interfaces under an explicitly designed topology. A reverse proxy can accept the public request on one listener and connect to a backend on another. The actual binding and selected route determine the behavior.

Before enabling a service, read the intended Linux listener view. On a supported Linux host, ss -ltn shows listening TCP endpoints numerically. A port filter can scope the check. A privileged process view may be needed to map a socket to a daemon or container if the normal user cannot see it. Ask the owner before using elevated inspection. A short listing with the exact listening address is more useful than matching every occurrence of digits 80 anywhere in diagnostic output.

127.0.0.1:80 is an IPv4 loopback listener. 0.0.0.0:80 means the socket uses a wildcard IPv4 bind. IPv6 may use another address and binding policy. Reading that socket still does not prove a public route or inbound permission. Compare the socket and intended path. An occupied port on this host doesn't automatically justify stopping whichever process owns it, particularly when it may serve another website.

If a second process can't start because of a conflict, find the active owner and approved topology. On a disposable lesson host its operator may choose one server, or use a deliberately different local port for the other practice. On a live shared host preserve its configured processes. Record the expected socket before making changes and check which service actually returns the request. A port change only solves part of the deployment if host names, proxy targets and allowed access still refer to the old one.

Check the server’s file access and every relevant network policy

A web server serving a static site needs to traverse the parent directories needed for the selected file and read the file. The host package typically runs worker processes under a designated account such as nginx, apache or www-data. Verify the actual runtime identity. The process that initially binds a socket may have a different identity from the worker reading files. The user who uploaded the site needs approved write access, which does not mean the reader process or every local user should be able to modify it.

A CentOS Stream 9 system can also use SELinux policy. SELinux is a security control that can evaluate contexts for processes and objects beyond ordinary mode bits. A custom root can have permissions that look correct but still carry an inappropriate label for the web process. Inspect the current policy mode, actual labels and allowed placement. Use the approved label procedure only for the intended content tree. Avoid turning SELinux off or making the entire tree writable to diagnose a scoped reading issue.

Likewise, a host might use firewalld, UFW or another configured firewall. Its rules are separate from an EC2 security group or subnet policy. A listener can accept a local request before network clients can reach it. Check the actual configured path and approved guest firewall policy when the client is outside the host. Do not assume the service exists on every image or copy a command that opens a broad network zone for a local preview. Read status first and coordinate any required change under the lab's scope.

Use an order that reduces guessing. Confirm the service port and selected hostname, then test the correct root and permissioned local request. If it succeeds locally but the intended remote client fails, check the approved network path, routing and filters. An HTTP 403 from the right endpoint indicates a responding service, while a network timeout is a different observation. Compare known response, relevant logs and permissions rather than replacing all the defaults from another distribution.

Choose the correct package and activation route from a disposable worksheet

You need Python 3 or paper. The worksheet treats the chapter's common packaging choices as example records. It never installs packages, reads an operating system or runs a server. Start by writing a pair such as Ubuntu and Apache, then explain what package, service name and configuration route the usual lab would check.

python3 - <<'PY'
combinations = {
    ("al2023", "nginx"): ("dnf", "nginx", "nginx conf.d include"),
    ("al2023", "apache"): ("dnf", "httpd", "httpd conf.d include"),
    ("ubuntu", "nginx"): ("apt", "nginx", "nginx enabled site include"),
    ("ubuntu", "apache"): ("apt", "apache2", "apache2 enabled site include"),
    ("stream9", "nginx"): ("dnf", "nginx", "nginx conf.d include"),
    ("stream9", "apache"): ("dnf", "httpd", "httpd conf.d include"),
}
examples = [("ubuntu", "apache"), ("stream9", "nginx"), ("al2023", "apache")]
for operating_system, server in examples:
    manager, service, include = combinations[(operating_system, server)]
    print(f"{operating_system}, {server}: {manager}, {service}, {include}")
PY

Expect Ubuntu Apache to select APT, apache2 and the Apache enabled site include. The CentOS Stream Nginx row should give DNF, nginx and its conf.d include. Amazon Linux Apache should use DNF and httpd. Confirm the intended installed files and enabled configuration on the actual target before using a printed path. A custom source build can use a different layout, so a course matrix is a starting point.

Now choose a fourth example with Ubuntu and Nginx. Explain which part of the earlier Ubuntu Apache row stays and which changes. APT remains the package manager under the common package options, but the service and server configuration syntax change. The underlying HTML, asset bytes and response path do not need to change just because the package manager stays. Make that distinction clear in your answer.

If the code reports an unavailable key, choose the exact short OS and server names from its six simple dictionary entries. A real machine reporting a different distribution needs supported instructions for its own layout, not a forced match to one of the three examples. This exercise creates no resources or files. Keep only the worksheet results needed to show how you identified the host.

Inspect one authorized Linux environment without changing service state

Use an approved read-only session on a training host, or use the sample observations described after the commands. Begin with the operating system information and listen addresses. These commands are for Linux and need the distribution's installed tools. If a machine lacks one, use its approved alternative read-only view or stay with the paper exercise. Commands in a container can show that container's namespace and process view, which can differ from the host.

cat /etc/os-release
ss -ltn 'sport = :80'
systemctl list-units --type=service --all nginx.service apache2.service httpd.service

Expect the OS release identifier and version, socket rows for any visible listener on the selected port, and service results visible to the account. The service check does not start, stop or enable anything. An empty socket list indicates there is no observed matching listener in that view at the time. If the approved listener port is another value, check it specifically instead of assuming the site uses 80.

Choose only the documented installed service name for the next inspection. The example uses a placeholder to replace. Read whether it is active and enabled and compare its start command to the configuration layout. On a system where a supervisor other than systemd starts the web server, use that supervisor's permitted read-only information rather than trying to enable a second service.

LAB_WEB_UNIT='REPLACE_WITH_APPROVED_UNIT'
systemctl is-active "$LAB_WEB_UNIT"
systemctl is-enabled "$LAB_WEB_UNIT"
systemctl cat "$LAB_WEB_UNIT"

The observations can differ. A service can be inactive now but enabled. Its unit can contain overrides that choose a different configuration path. Full service definitions or config dumps can contain environment references or details that should be kept private. For classroom notes record only the fields your scope permits, such as the service name, listener and approved route. Do not change another user's service to compare outputs.

For a paper result, suppose /etc/os-release shows Ubuntu, the available unit is apache2, and a listener is present on 127.0.0.1:80. The intended preview is local. That setup can be valid despite no external connection. A second result on Amazon Linux shows httpd installed and nginx already listening on a public-facing socket for a shared site. The right answer is to preserve that listener and use the approved isolated exercise. No cleanup is necessary for a read-only inspection.

Move a prepared site between combinations without changing its meaning

Mauli first tests the site under Amazon Linux Nginx and later wants a practice copy under Ubuntu Apache. Freeze the approved content version. The files that a browser should receive can remain identical, and the host configuration will differ. Prepare the Apache site's root, virtual host and read permissions on a separate approved target. Use the actual names, ports and directory layout of the target package. Do not place the Apache config under Nginx's include paths.

A good comparison uses an equivalent request. Ask for the home route, nested document, stylesheet and intentionally missing training route with the expected host and scheme. Compare status, content type and useful marker. A server can return 200 with the correct home page and still mishandle a nested directory or asset. Check index behavior and MIME mappings. A default welcome page confirms a process can answer one request. It does not prove the migrated site has been selected.

Keep a note for behavior that depends on configuration rather than content. Custom error handling, compression, redirects, caching headers and directory listing are possible examples. The chapter's site can meet its core behavior without matching every incidental server header. Write which details are required by the site's owners and verify them on the replacement. For a production migration, plan the allowed DNS or load balancer change only after the candidate passes the intended checks.

Rollback also needs an equivalent check. Keep the previous approved release and configuration available according to policy. If the new target fails, restore the authorized name or request path to the known working version and verify the expected resource responses. Avoid stopping a host unrelated to the migration or restoring a global config that would change other sites. A safe transfer compares the intended host at both ends and respects the scope of each service.

Use the matrix to narrow four packaging and deployment failures

ObservationLikely layer to inspect nextExample evidence
APT examples fail on the Amazon Linux guest.Operating system, package manager and configured repository.OS release value and documented DNF packaging for the actual release.
A new Ubuntu site file exists but the default site answers.Enabled site include, host selection and active configuration.Relevant service startup and the configured enabled-site record. Correct Host and response marker in a test.
A CentOS worker cannot read a file even with ordinary modes that look correct.Actual process identity, path traversal and SELinux labeling under the enabled policy.Network response from the correct site, relevant error, expected ownership and context.
Starting Apache fails after Nginx already serves the same listener.Actual address, family, port and resource owner.Listener view and service status. Keep the existing service unless its owner approves any action.

Use only the first interpretation supported by the result. A package command failure isn't a reason to open a firewall. A failed hostname match isn't a reason to recopy all files. An access violation isn't permission to disable host security. A listener conflict isn't a reason to stop a global service when the exercise can use an isolated environment. Match evidence to the targeted correction and then verify the expected response.

Capture the difference between the site content and its transport. If a local HTTP request works and clients can’t reach the public address, inspect the actual network path and appropriate policies. If a local request uses a bare IP and finds a valid but unintended host, confirm the selected name. If the correct host returns the wrong type for a stylesheet, inspect which path and mapping resolved it. The next check should test the smallest meaningful uncertainty.

Check which root a fresh package installation actually serves

A new Nginx or Apache install often has a default virtual host and a welcome page. That landing page is useful for proving the service starts. It is not the same thing as your intended site. Depending on the package and active definition, examples such as /usr/share/nginx/html or /var/www/html might be used by the welcome page. Do not assume that a printed path applies to an already configured machine. Inspect the actual site selected for your request. If the server is shared, treat the existing default root as another owner's configuration until verified.

Suppose version A of Mauli uses a site-specific root called /var/www/training-mauli. You copy the reviewed assets to a package default path instead, and the named request still serves old content. That is expected because the configured root did not change. A second request to an unmatched hostname might now show the accidental copy. The two observations tell you that more than one site mapping is in use. Repair only your candidate directory or approved configuration under the owner's scope.

Use identifying documents in a disposable exercise. Add a short release label to the intended root and check that the exact host and path return it. The package welcome page can serve as contrast in that environment. On a machine serving other domains, preserve existing behavior and avoid overwriting the welcome page automatically. A trained operator uses the relevant host definition and included file to explain why the response came from a particular directory.

File changes and configuration changes also differ. Replacing an approved static file can make its new bytes available without a config reload, subject to the server and cache behavior. Changing the document root or virtual host usually needs an approved configuration apply. Record whether the test concerns a release artifact or the active server mapping. It is easier to roll back one supported scope when you know which kind of change was made.

Distinguish shipped package paths, local overrides and the running process

A package's file list can show what it originally installed. On RPM-based hosts, an authorized worker can use a read-only RPM query such as rpm -ql nginx for the installed package. On Ubuntu, dpkg -L apache2 can list files registered for that package. Packaging can split config, modules and binaries among related packages. The absence of every Apache path in one queried package does not mean Apache cannot be present. Use the documented packaging and actual service definition together.

Make a three-column checklist. Column one records the installed binary and package's documented configuration paths. Column two records locally approved overrides, for example an include or systemd drop-in. Column three records what the running service currently uses. If a team changed its startup option to select another prefix or config, column three can disagree with a generic package tutorial while still being correct for that host. A local package manifest cannot tell you whether the operator reloaded an approved new setting.

There is a useful lesson in an unexpected syntax check. You run the server test using a default command and it reads a different config from the managed unit. Both can produce valid outputs about different inputs. Inspect the exact working config context and invocation before sharing the result. If a syntax command prints another site's configuration or logs, keep those details under the administrator's scope. Do not circulate a full config dump to prove one teaching route works.

Keep operating-system maintenance independent from hosting content. At the time of class, choose a supported release and package source permitted by the owner. Once installed, record package and version where the operating policy requests it. An update can change module support or default behavior, so use the intended regression check before publishing changes. Hosting four files does not prevent their server from needing updates and a recovery plan.

Work a file access problem from the parent directories down

Mauli uploads its rate page under an operator's personal directory. The file's mode shows readable bytes to an intended group, but the web process cannot serve the page. It may be unable to traverse one of the parent directories or may not belong to the relevant group. It may also be prohibited by the configured serving policy. The first useful question is which worker attempts to open which exact path after host and location selection. Resolve that before changing the file's permissions.

For a preapproved static root and a trained operator, inspect owner and group plus each parent directory's permissions along the path. Reading a regular file requires relevant read access. Traversing a directory requires its search permission. A distribution using SELinux in enforcing mode can add a label-based condition. Under Apache, directory-specific authorization can impose another restriction even after operating-system access is allowed. A 403 visible in the browser can come from different forms of denial. Check local server logs and actual loaded directives within the approved scope.

Imagine moving the exercise from Ubuntu to CentOS Stream. The uploaded bytes can be identical, while the process account and access policy differ. Do not simply replace every owner with one username from the prior platform. The service process generally needs to read the approved files, while deployment writes can remain under the authorized deployment owner. Keep private source and data outside the site serving area. If policy blocks a custom location, use the approved supported placement and labels.

Write the success test from the actual service's perspective. The configured named site returns the correct marker and type for a known sample page and asset. A missing teaching file remains missing. Unrelated names and directories are outside this exercise. If a read-only account can't inspect the relevant worker details, ask the resource owner for scoped evidence. The goal of the fault diagnosis is a narrow repair in the place that owns the access decision.

Prepare a site change without disabling an unrelated default site

Some class examples remove a default site so the only learner page answers a bare IP. That can be useful on a new, disposable machine. It is the wrong default on a shared host. Add or select a named site through the documented include, preserve the previously active configuration and validate that the intended request selects your definition. A server can host multiple sites without deleting the default one. The default is often useful evidence when a request is sent to an unrecognized name.

Prepare a simple allowed test with the known new hostname. If an approved sandbox has a loopback listener for your demo names, a command-line client can send a request using that explicit host or a scoped resolve setting. For a real HTTPS test, use the approved name and trusted certificate so both TLS and HTTP site-selection behavior are checked. A bare address request can exercise a fallback instead. Record which test you ran and what response was expected for that exact request.

Use a small change order. Capture current approved site and service information, prepare the candidate in the scoped configuration, run the selected server's validation, apply through the supported mechanism and verify the target response. Before and after an authorized change on a shared host, the owner may verify safe baseline responses for related sites. Do not probe sites without permission. If the candidate fails validation, preserve the active service and fix the candidate offline.

After an approved application, distinguish a configuration test from runtime. The service might reload and keep prior workers temporarily while connections finish. A live response has to come from the intended path. Verify "which site" with a marker and "which asset" with the expected content type or small body value. If you cannot explain which configuration reached the listener, ask for the relevant service and host comparison before editing unrelated roots or firewall rules.

Prepare a deployment checklist for one matrix row and a comparison

  1. Select Ubuntu Apache and Amazon Linux Apache. Write what differs in package manager, service unit, configuration enablement and inspection. Include a method of proving the intended files and requests stayed the same. Explain how a unit with a familiar name can still use custom configuration.

  2. Explain how two independent web servers can coexist under an approved design. Identify their exact listener addresses or ports and how the client reaches the correct one. State why two unrelated services binding the same wildcard socket would conflict in the common case.

  3. Give a verification sequence for a CentOS Stream static file that returns a 403. Check which site answers, actual URL and path, worker identity and ordinary and SELinux access controls as applicable. Name the evidence that would justify a scoped correction without disabling unrelated policy.

  4. Draw a local-only preview and an intentionally reachable public site. For each identify the listener, allowed caller and actual request test. Show why the class's loopback practice needs no worldwide public security group rule, and why a running process alone does not establish public reachability.

Interview questions and worked answers

Why do apache2 and httpd both appear in the matrix?

They commonly name different distributions' packages or service units for Apache HTTP Server. Verify the OS and installation layout. The activity of serving HTML can be the same while the package manager, include locations and service checks differ.

Why can an available configuration file fail to affect the site?

The service loads the configuration selected by its start arguments and includes. A package can separate available site files from enabled files. Check the actual loaded or enabled definition and the requested host, then test the response. A file present under a default path is not sufficient.

Does every server process sharing the same host need a different public port?

One process can use a listener to serve several named virtual hosts. Separate public processes typically cannot bind the same overlapping socket under ordinary conditions. Distinct listeners or an approved reverse proxy design can separate two services. Check the actual network addresses and selected route.

How can readable file modes still produce a 403?

The process needs the right identity, directory traversal, file reading and any platform access controls such as SELinux in an enforcing configuration. A server can also deny the configured path independently. Inspect the actual request and narrow evidence before editing permissions.

What does a syntax test prove before a reload?

It checks the selected configuration under that tool and context. An expected hostname and useful response need their own test after the authorized application. A syntactically valid site can still map to an unintended directory or default listener.

Check your choice of package, listener and file controls

  1. Which is the usual Ubuntu Apache service name in this chapter? A. apache2. B. nginx. C. dnf.

    Show answer

    A. Ubuntu commonly packages the service as apache2. Amazon Linux and CentOS Stream use httpd in common packaged setups, and DNF is a package manager. Verify the host's actual labels.

  2. A site file is present only in an available-sites folder and the service does not include it. What should you inspect? A. Active or enabled site configuration. B. Only instance CPU. C. The client's laptop file extensions.

    Show answer

    A. Configuration presence is not activation. Find the include path and its selected files, then inspect the correct hostname and response after an approved change.

  3. A listener is bound to 127.0.0.1:80. What does this establish? A. Every internet client can reach it. B. It listens on IPv4 loopback for this host. C. It has the correct production TLS certificate.

    Show answer

    B. The address is local loopback. Reachability from another machine and TLS identity need separate configuration and tests.

  4. What is the next check after a syntactically valid candidate starts? A. The actual intended site URL and response. B. Just the package installation time. C. Remove unrelated site files.

    Show answer

    A. The expected response verifies host selection, appropriate file handling and useful content for the test. Syntax and package existence alone cannot prove those outcomes.

  5. Which change helps diagnose a wrong SELinux context responsibly? A. Inspect applicable labels and the exact allowed setup. B. Disable SELinux across the machine. C. Make every project directory writable.

    Show answer

    A. Identify the exact worker, file and policy affecting the request and follow the approved scoped procedure. System-wide changes do not help verify which access control was expected.

Revision cards

OS and package
Read the actual release first. Use the intended package repositories and service naming for that system.
Server configuration
Server blocks and virtual hosts can provide similar results with platform-specific directives and include conventions.
Active file
Check which includes and service invocation the daemon actually uses. A saved file can still be inactive.
Listener
Identify address, port, family and process. One listener can serve multiple names.
Policy layers
Verify ordinary permissions and any platform policy, then the host and cloud network rules for intended clients.
Comparable result
Check the same page, required asset, missing route and version marker across authorized configurations.

References