What are web servers and how do they work (with examples httpd and nodejs)
Published at : 10 Dec 2020
A web server is a software that Serves web content through the HTTP protocol. It is the foundation of the internet and any website out there must be sitting and hosted on a web server. Web APIs can also be hosted on some sort of a web server. A web server can serve static or dynamic content. You can use an out of the box web servers such as apache tomcat or IIS or you can write your own from scratch to expose pieces of functionalities such as API. In this video we will explain what is a web server, how it works and we will then go through and spin off two types of web servers. Im going to put jump codes so you can skip to your favorite part of the video.
2:13 What is web server?
7:40 How web servers work?
10:00 Blocking single threaded web server
19:00 Code example Apache (httpd)
29:00 Code example NodeJS
- What is a web server?
- [ ] Software that serves web content
- [ ] Uses HTTP protocol
- [ ] Static and dynamic
- [ ] Used to host web pages or APIs.
- How it works? (Slide)
- process starts and listen to a port (usually 80) , a client makes a request to the web server, this establishes a TCP connection between client and server if its HTTPS it does TLS, then finally the GET request get sent. Now different implementation of webservers shine here, some servers use the same process to execute the request on the main thread. Which means the server cant accept any more requests until that is done this is referee to as Blocking single-threaded HTTP server). Other web servers implement this different and accepts new requests all the time and start new thread of execution.
- Web servers (apache, tomcat, nodejs http-server, NodeJS express, Python Tornado 🌪
- Demo (tomcat and nodejs)
software engineeringhow web servers workwhat is a web server?