What Is a Web Server?

Category: Web Servers ยท Updated 2026-10-30

A web server is software that listens for requests from browsers over HTTP or HTTPS and answers with web pages, images or data. The same term also describes the computer that runs this software. Apache, Nginx and LiteSpeed are the best-known web server programs.

Software vs. hardware: two meanings

People use "web server" for two different things. The software is a program such as Apache or Nginx that understands the HTTP protocol. The hardware is the physical or virtual machine in a data center that runs that program and holds your files. A hosting plan gives you access to both.

What a web server does, step by step

  1. It listens on network ports, usually 80 for HTTP and 443 for HTTPS.
  2. It receives a request such as GET /pricing/ HTTP/1.1 together with headers like the domain name and the browser type.
  3. It decides what to do from its configuration: serve a file from disk, pass the request to an application (PHP-FPM, Node.js, Python), or forward it to another server.
  4. It builds a response with a status code (200 OK, 404 Not Found, 500 Internal Server Error), headers and the content.
  5. It writes the request to an access log and any problem to an error log.

Static and dynamic content

Static content is a file that is sent exactly as stored: HTML, CSS, JavaScript, images, fonts. A web server does this extremely fast. Dynamic content is generated at the moment of the request, for example a WordPress page assembled from PHP code and database rows. For this the web server hands the work to an application runtime and then forwards the result.

This is why caching matters: turning a dynamic page into a stored static copy removes most of the work.

Web server vs. application server

A web server speaks HTTP and serves files. An application server runs business code, for example a Java, Node.js or Python application. In many real setups both exist: the web server faces the internet and passes requests to the application behind it, which is called a reverse proxy arrangement.

Frequently asked questions

What is a web server in simple words?

A web server is a program that waits for requests from browsers and sends back web pages, images or data. The term can also mean the computer that runs the program.

What is the difference between a web server and web hosting?

A web server is the software and machine that serves files, while web hosting is the service of renting space and resources on such a machine. When you buy hosting you are renting access to a web server that someone else maintains.

Which web server is the best?

There is no single best option. Apache is flexible and widely supported, Nginx is very efficient with many simultaneous connections and static files, and LiteSpeed offers Apache compatibility with built-in caching. The right choice depends on your application and on what your host supports.

Which ports does a web server use?

By default web servers use port 80 for unencrypted HTTP and port 443 for encrypted HTTPS. Applications behind a reverse proxy often listen on other local ports such as 3000 or 8080.

Can I run a web server on my own computer?

Yes. Tools such as Apache, Nginx or a local development stack let you run a web server on your machine for testing. For a public website you would still want a hosted server with a stable IP address, uptime and security updates.

What is a reverse proxy?

A reverse proxy is a server that sits in front of one or more application servers, receives requests from the internet and forwards them to the right backend. It can also handle HTTPS, caching and load balancing.

Related topics