The term web server can refer to either the hardware (the computer) or the software (the computer application) that helps to deliver web content that can be accessed through the Internet.
The most common use of web servers is to host websites, but there are other uses such as gaming, data storage or running enterprise applications
The primary function of a web server is to deliver web pages to clients.
The communication between client and server takes place using the Hypertext Transfer Protocol (HTTP). Pages delivered are most frequently HTML documents, which may include images, style sheets and scripts in addition to text content.
A user agent, commonly a web browser or web crawler, initiates communication by making a request for a specific resource using HTTP and the server responds with the content of that resource or an error message if unable to do so. The resource is typically a real file on the server’s secondary storage, but this is not necessarily the case and depends on how the web server is implemented.
While the primary function is to serve content, a full implementation of HTTP also includes ways of receiving content from clients. This feature is used for submitting web forms, including uploading of files.
Many generic web servers also support server-side scripting using Active Server Pages (ASP), PHP, or other scripting languages.
This means that the behavior of the web server can be scripted in separate files, while the actual server software remains unchanged. Usually, this function is used to create HTML documents dynamically (“on-the-fly”) as opposed to returning static documents.
The former is primarily used for retrieving and/or modifying information from databases. The latter is typically much faster and more easily cached but cannot deliver dynamic content.
Web servers are not always used for serving the World Wide Web.
They can also be found embedded in devices such as printers, routers, webcams and serving only a local network.
The web server may then be used as a part of a system for monitoring and/or administering the device in question. This usually means that no additional software has to be installed on the client computer, since only a web browser is required (which now is included with most operating systems).
Features of web server
- Virtual hosting to serve many web sites using one IP address
- Large file support to be able to serve files whose size is greater than 2 GB on 32 bit OS
- Bandwidth throttling to limit the speed of responses in order to not saturate the network and to be able to serve more clients
- Server-side scripting to generate dynamic web pages, still keeping web server and website implementations separate from each other