DEV Community

Sourav Kumar
Sourav Kumar

Posted on

WEB SERVERS FOR BEGINNERS

Image description
This article is helpful for beginners who want to understand web servers. A web server is simply a computer system or a combination of software and hardware that serves websites and web pages. It works on a client-server architecture where the client requests a browser by entering a URL, which is then sent to the respective server. The server processes the HTTP request or URL, checks the files at that location, generates a copy, and sends it back to the client.

A web server comprises a hardware part and a software part. The hardware part contains the website data, such as HTML files, CSS files, JavaScript files, and assets like images and PDFs. It also includes the web server software. The software handles the HTTP request, performs all the processing, and returns the HTTP response with some data or, in case of an error or missing data, an HTTP response indicating the issue. An example of such an error is the 404 error, which many developers customize extensively as it is quite common to encounter this page.

To host files, you first need to store the website files, including HTML, and related assets like images, CSS, and JS files. While it's possible to use your computer as a web server, it is preferable to use a dedicated web server provided and managed by a third party.

Web servers deliver two types of content: static content and dynamic content. Static content refers to serving static web pages, which do not have dynamic data. In these cases, there is minimal involvement of a database, and there is no need for server-side programming languages like Python or Java to render the pages.

On the other hand, dynamic content serves web pages that continuously deal with changing data based on demand. These pages require significant interaction with a database before displaying the data to users. Server-side programming languages like Java are used to render dynamic pages. Popular platforms like Quora and Wikipedia employ dynamic servers, where predefined templates using HTML, CSS, and JS are used to present data that changes and adapts based on user demand.

Top comments (0)