LINUX WEB SERVERS

Linux Apache and Nginx Web Server Playbook

Install, structure and troubleshoot production-style Linux web servers, then understand where virtual hosts and reverse proxies fit.

Book 3 | Chapter 17

Chapter opening

Chapter 17 moves from the course overview into linux apache and nginx web server. The aim is not to memorise product menus or commands. The reader should understand what problem the technology solves, how it fits into the wider servers and virtualization technical textbook, what normal operation looks like, and how to prove the result in the field.

The previous chapter introduced linux samba file server playbook. This chapter continues the sequence by focusing on linux apache and nginx web server playbook, so the reader can connect the architecture to a more specific operational problem.

Servers textbookChapter 17

Learning objectives

  • Explain the main purpose of Linux Apache and Nginx Web Server in plain language.
  • Identify the components that must work together for the service to operate.
  • Use evidence to separate a design problem from a configuration or physical fault.
  • Describe the business impact of a failure and the evidence required for handover.

Why this matters in a real company

This subject matters because servers infrastructure supports normal business operations. Understanding the design makes purchasing, troubleshooting and recovery decisions easier to explain and verify.

Course: Servers and Virtualization Technical Textbook

PLAIN ENGLISH

Technical terms used in this chapter

You do not need to memorise the jargon first. Understand what each term does and why somebody running a company would care about it.

Virtual Host

Web Virtual Host

A web-server configuration that lets one server host multiple websites using different names or addresses.

In everyday business: One server can host several business websites separately.

Apache

Apache HTTP Server

A widely used web server that serves websites and web applications.

In everyday business: One Linux server can host internal or public business websites.

Nginx

Nginx

A web server and reverse proxy commonly used for websites, APIs and application front ends.

In everyday business: It can serve websites or route incoming web traffic to application servers.

DNS

Domain Name System

The service that translates names into IP addresses and helps Windows domain clients find services.

In everyday business: People and applications can use names instead of remembering network numbers.

NAT

Network Address Translation

A router or firewall function that changes IP addressing as traffic crosses a boundary.

In everyday business: Many private office devices can share one public Internet address.

See the complete plain-English glossary

BUSINESS TRANSLATION

What this means outside the server room

This topic affects the systems staff depend on for sign-in, files, applications and business continuity. The technical design determines how easy the environment is to manage and how painful a failure becomes.

DNS

What it means: DNS translates names into IP addresses and also helps many business services locate each other.

In normal business language: It is the company phonebook for systems. Staff type a name such as fileserver or portal instead of remembering a number.

Why the decision matters: Good DNS design reduces configuration mistakes and is especially important for Windows domains, cloud integrations and internal applications.

Firewall

What it means: A firewall controls which network connections are allowed between users, systems and external networks.

In normal business language: It is a security checkpoint between parts of the company network. It should allow legitimate work while blocking unwanted access.

Why the decision matters: Firewall rules should describe real business flows such as 'staff may reach accounting on HTTPS', not unexplained broad permits.

NAT

What it means: NAT changes IP addresses as traffic crosses a network boundary.

In normal business language: It is similar to a company switchboard: many internal extensions can share one public number.

Why the decision matters: NAT helps with address use and publishing services, but it is not a substitute for firewall security.

Chapter contents

  1. 17.1 Apache vs Nginx
Name-based web virtual hosting
site-a.example site-b.example site-c.example Apache / NginxReads host nameSelects site configuration One Server IPMany websites

17.1 Apache vs Nginx

Both can serve static content and route requests to applications. Apache is highly modular and uses VirtualHost configuration. Nginx uses server blocks and is widely used as a web server and reverse proxy.

Apache basic checks

apachectl configtest
apachectl -S
systemctl status httpd

Nginx basic checks

nginx -t
systemctl status nginx

Reverse proxy

A reverse proxy accepts the client connection and forwards requests to an application server. This can centralise TLS termination, hostname routing and access policy, but the backend application still needs secure configuration.

Logs

Read access and error logs before changing configuration. HTTP status codes, upstream timeout messages and TLS errors often reveal the layer that failed.

What fails

  • Editing config without syntax testing.
  • Opening firewall ports but forgetting DNS.
  • Serving multiple sites without explicit hostnames/default behaviour.
  • Proxying to an application that only listens on localhost/another port without matching configuration.
WORKED BUSINESS SCENARIO

Scenario: turn the technology into an operational service

A company depends on this technology every day. The technical configuration may be correct, but the real requirement is predictable operation, evidence when something fails and documentation another technician can understand.

What the chapter teaches us: Treat the subject as a service with a purpose, dependencies, normal behaviour, failure modes and a recovery method.

Think it through

  1. What business process depends on this component?
  2. What would normal operation look like?
  3. What evidence would prove the cause of a failure?
PRACTICAL WORK

Hands-on lab

Host two lab sites on one server using two DNS names. Verify each name reaches the correct document root, then test an unknown Host header.

Troubleshooting exercise

Both DNS names show the same website. Check DNS, enabled site configuration, server_name or ServerName matching, default site order and config reload.

Chapter field checklist

  • I can explain the subject without relying only on acronyms.
  • I can draw or describe the main traffic, storage, power or service path.
  • I know what normal operation should look like.
  • I know which logs, counters or test results prove the result.
  • I can explain the business impact if this component fails.
  • I would document the final configuration and evidence at handover.

Chapter summary

Linux Apache and Nginx Web Server Playbook should now be understood as a business service with a technical implementation, not simply a collection of commands or product names. The important habit is to know the purpose, understand the dependencies, measure the result and document what was proven.

END OF CHAPTER

Review questions

  1. Explain the subject in plain language to a business owner.
  2. List the main dependencies that must be healthy before this service can work.
  3. Describe one realistic failure and the first three pieces of evidence you would collect.
  4. Explain what should be documented at handover.

A good answer should explain the reason, not only repeat a product name or command.

Technical references

Use the current product documentation and project requirements for production work.