- A computer that is responsible for accepting HTTP requests from clients, which are known as web browsers, and serving them web pages, which are usually HTML documents.
- A computer program that provides the functionality described in the first sense of the term.
Although web server programs differ in detail, they all share some basic common features.
Every web server program operates by accepting HTTP requests from the network, and providing an HTTP response to the requester. The HTTP response typically consists of an HTML document, but can also be a raw text file, an image, or some other type of document.
Usually web servers have also the capability of logging some detailed information, about client requests and server responses, to log files; this allows the Web master to collect statistics by running log analyzers on log files.
Origin of returned content
The origin of the content sent by server is called static if it comes from an existing file or dynamic if it is dynamically generated by some other program or script called by web server. Serving static content is usually much faster than serving dynamic content.
Web servers usually translate the path component of a Uniform Resource Locator (URL) into a local file system resource. The URL path specified by the client is relative to the web server's root directory.
Consider the following URI as it would be requested by a client:
The client's web browser will translate it into a connection to www.example.com with the following HTTP 1.1 request:
GET /path/file.html HTTP/1.1 Host: www.example.com
The web server on www.example.com will append the given path to the path of its root directory. On Unix machines, this is commonly /var/www/htdocs. The result is the local file system resource:
The web server will then read the file, if it exists, and send a response to the client's web browser. The response will describe the content of the file and contain the file itself.
Each web server can handle a limited number of concurrent client connections (usually between 2 and 60000) and it can serve only a certain maximum number of requests per second depending on its own settings, the HTTP request type and the hardware and software limits of the OS where it is working.
To partially overcome these limits, most popular web sites use common techniques like:
- using different URLs to serve
static content (i.e. http://images.example.com) and dynamic content (i.e. http://www.example.com)
by separate web servers;
- using many web servers that are grouped together so that they act or are seen as one big web server, see also: Load balancer.
The symptoms of an overloaded web server are:
- requests are served with noticeably (long) delays (from 1 second to a few hundreds of seconds);
- 500, 503 HTTP errors are returned to clients (sometimes also unrelated 404 error may be returned);
- TCP connections are refused or reset before any content is sent to clients.
In 1989 Tim Berners-Lee proposed to his employer CERN (European center for nuclear research) a new project, which had the goal of easing the exchange of information between scientists by using a hypertext system. As a result of the implementation of this project, Berners-Lee wrote two programs: a browser called WorldWideWeb and the world's first web server, which ran on NeXTSTEP. Today, this machine is on exhibition for all to see at CERN's public museum, Microcosm.
The four top most common web or HTTP server programs are:
- Apache HTTP Server from the Apache Software Foundation.
- Internet Information Services (IIS) from Microsoft.
- Sun Java System Web Server from Sun Microsystems, formerly Sun ONE Web Server, iPlanet Web Server, and Netscape Enterprise Server.
- Zeus Web Server from Zeus Technology.
There are thousands of different web server programs available, many of them are specialized for some uses and can be tailored to satisfy specific needs.
See Category:Web server software for a comprehensive list of HTTP server programs.
- HTTP, HTTPS
- Tiny web servers
- CGI, FastCGI, ASP, PHP
- Virtual hosting
- LAMP_(software bundle)
- Web browser
- Web log analysis software
- List of Web servers