Skip to main content

CompTIA A+View full course outline

Web Servers(OBJ.2.3)

By Jonathon Eades Founder & IT InstructorUpdated

15 min read

A web server is software that delivers web content to clients over a network. When you type a URL into your browser or click a link, your request travels to a web server, which processes the request and sends back the appropriate content—typically HTML pages, images, videos, or other files. The browser then renders this content for you to view.

Web servers are the foundation of the internet, hosting everything from simple personal blogs to complex enterprise applications. They also power internal company websites, application backends, and APIs that mobile apps and services depend on.

How Web Servers Work

Web servers operate on a request-response model. A client (usually a web browser) sends a request, and the server returns a response.

The Request-Response Cycle

When you enter a URL like https://www.example.com/page.html, several steps occur. First, your browser performs a DNS lookup to find the IP address of www.example.com. Then the browser establishes a TCP connection to the server on port 80 (HTTP) or port 443 (HTTPS). The browser sends an HTTP request specifying the resource it wants, in this case /page.html. The web server receives the request, locates the file, and sends it back with an HTTP response. Finally, your browser receives the response and renders the page.

This entire process typically happens in milliseconds, though complex pages may require dozens of additional requests for images, stylesheets, scripts, and other resources.

HTTP Methods

HTTP defines several methods that describe what action the client wants to perform.

GET requests retrieve a resource from the server. This is the most common method, used when loading web pages.

HTTP GET request diagram. A client browser sends a GET request to a server, and the server returns index.html with a 200 OK response.

POST sends data to the server, typically when submitting forms or uploading files.

HTTP POST request diagram. A client browser submits a form containing a name and email address to a server using POST, and the server replies with a 201 Created response.

PUT uploads or replaces a resource at a specific location.

HTTP PUT request diagram. A client sends PUT /user/123 carrying an updated user_123_v2.json document, replacing user_123_v1.json on the server, which replies 200 OK.

DELETE removes a resource from the server.

HTTP DELETE request diagram. A client sends DELETE /user/123, the server removes user_123_v2.json, shown crossed out beside a wastebasket, and replies 200 OK.

HEAD retrieves only the headers of a response, useful for checking if a resource exists without downloading it.

HTTP HEAD request diagram. A client sends HEAD /index.html and the server returns only the response headers, such as Content-Type and Content-Length, with a 200 OK status and no message body.

HTTP and HTTPS

Web servers communicate using HTTP (Hypertext Transfer Protocol) or its secure variant, HTTPS.

HTTP Ports

HTTP uses TCP port 80 by default. Traffic on this port is unencrypted, meaning anyone monitoring the network can read the content being transmitted. While still used for some public content, HTTP is increasingly deprecated in favor of HTTPS.

HTTPS and TLS

HTTPS uses TCP port 443 and encrypts all traffic using TLS (Transport Layer Security). This encryption protects sensitive data like login credentials, payment information, and personal details from interception.

HTTPS requires an SSL/TLS certificate issued by a Certificate Authority (CA). The certificate verifies the server's identity and enables encrypted communication. Modern browsers display a padlock icon for HTTPS connections and warn users about unencrypted HTTP sites.

Benefits of HTTPS include: encrypted data transmission preventing eavesdropping, authentication confirming you're connected to the legitimate server, data integrity ensuring content hasn't been modified in transit, and improved search engine rankings since Google prioritizes HTTPS sites.

HTTP Status Codes

Web servers return status codes indicating the result of each request. These codes help troubleshoot issues.

1xx Informational codes indicate the request is being processed.

2xx Success codes mean the request succeeded. Code 200 (OK) is the standard success response.

3xx Redirection codes indicate the resource has moved. Code 301 means permanently moved, while 302 indicates a temporary redirect.

4xx Client Error codes indicate problems with the request. Code 400 means bad request, 401 means unauthorized (authentication required), 403 means forbidden (access denied), and 404 means not found.

5xx Server Error codes indicate the server failed to fulfill a valid request. Code 500 is a generic internal server error, 502 is a bad gateway error, and 503 means the service is unavailable.

Popular Web Server Software

Several web server applications dominate the market, each with distinct strengths.

Apache HTTP Server

Apache has been one of the most widely used web servers since the mid-1990s, and it still runs a large share of the web alongside Nginx. It's open source, runs on virtually any operating system, and offers extensive customization through modules.

This lesson is part of ExamWizardz Pro

Unlock every lesson, unlimited practice tests, and the AI tutor.

See Pro pricing

or start with a free account

Test yourself on this topic: free Network Services and Servers practice questions — no account needed.