In very general terms, a web server is a computer connected to the Internet that takes requests from clients such as a web browser and then serves the requested content back to these clients. Web servers are what make browsing websites on the World Wide Web possible.
A web server comprises two parts: the hardware and the software. A web server is essentially a computer (comprising hardware such as a processor, memory, and disk storage) that is running specialized software that enables the computer to take requests and serve content when connected to the internet.
The most important piece of software that turns a computer into a web server is the HTTP server software. This piece of software is what enables the computer to respond to HTTP requests, such as the request of a web browser to fetch the contents of a HTML file stored on the disk storage of the server.
There are many choices of HTTP server software. Two of the most commonly used HTTP server software are Apache and Nginx. To run Apache or Nginx HTTP server software, they must be installed on an operating system running the Linux distribution. If the web server uses Windows as its operating system, Microsoft offers its Internet Information Services (IIS) HTTP server, or you can install Apache on it.
Apache and Nginx HTTP server software are popular because they are free and open-source. They are also very high-performing and stable, capable of serving large volumes of HTTP requests on very modest hardware. Also, because they run on the Linux operating system, which is itself also free, open-source and very stable, the cost of operating a web server using Apache or Nginx is much lower compared to using Microsoft’s IIS, contributing to their popularity.
Although the HTTP server software is the most important piece of software that enables a computer to serve content to clients, the HTTP server software is limited to server only static content. This means that the HTTP server software can only serve permanently complete HTML web page files as-is. If the content on these web page files must be updated, they are updated manually by a human and then re-uploaded onto the server to be served.
Serving dynamic content on web servers is increasingly common due to the popularity of content management systems such as Wordpress. To serve dynamic content, two other types of software are needed.
Dynamic content differs from static content in that there are no permanently complete HTML web page files on the server waiting to be served. Instead, HTML web page files are generated by small pieces of programs on the server called scripts that assemble necessary and most-up-to-date information to create and serve these files when the web server receives a request.
In order to run scripts, the scripting language software used to create these scripts must be installed on the server. One of the most popular scripting languages for hosting dynamic content on web servers is called PHP (recursive acronym for PHP: Hypertext Preprocessor).
To serve dynamic content, other than scripts, a database management system software is also needed because to generate HTML web page files, scripts also need to retrieve the most updated data from a database. A database management system works with the scripts to store and retrieve a website’s information in real-time. One of the most popular database management systems is MySQL.
The collection of software to turn a computer into a web server is sometimes also called a stack. One of the most common stacks is the LAMP (Linux, Apache, MySQL and PHP) stack. Modern web servers typically require a stack to serve a wide variety of content on the World Wide Web.
HTTP is a protocol used to connect to web servers by web browsers to request content to view. This is also used to transfer larger files, and is often used for software updates.
HTML refers to the Hyper Text Markup Language. It is the backbone of every website in existence; all browsers must understand this language to render a visible page.