Glossary

Web server

The software that receives requests from browsers and sends back pages and files.

In plain English The program that answers visitors' browsers and sends them your website. Also used for the computer it runs on.

A web server is the program that receives requests from browsers and sends back web pages, images and files. The word also means the computer that runs it. The common programs are Nginx, Apache, LiteSpeed and Caddy.

What it does

  1. Listens on port 80 for HTTP and 443 for HTTPSHTTPS The secure version of the web, shown by the padlock. Everything sent between you and the site is scrambled so nobody in between can read or change it. More about HTTPS →.
  2. Reads the requested name and path, and picks the matching site.
  3. For a static file, such as an image or stylesheet, sends it straight from disk.
  4. For a dynamic page, passes the request to a program, such as PHP-FPM or a Node.js app, and returns its answer.
  5. Records the request in its access log, and any problem in its error log.

It also handles HTTPS certificates, compression, redirects, cachingCache A saved copy of something, kept so it does not have to be made or fetched again. Like keeping a printed copy instead of reprinting it for every person who asks. More about Cache → headers and access rules.

Choosing one

ServerKnown for
NginxEfficient with many connections; common on VPS setups and as a reverse proxy
ApacheFlexible; per-folder .htaccess files; common on shared hosting
LiteSpeedApache-compatible, fast, with built-in WordPress caching; commercial
CaddySets up HTTPS certificates automatically; simple configuration

For most sites, any of them is fast enough; the difference that matters more is caching and the code behind them.

The logs

When anything goes wrong on a website, the web server’s error log is the first place to look. On NginxNginx A fast, popular program that sends web pages to visitors and can pass requests on to apps behind it. More about Nginx → it is /var/log/nginx/error.log. See how to install Nginx on Ubuntu.