In this article, we will talk about one of the most important and fundamental concepts of IT, and that is a web server. We will explain what servers are, what they do, and how they do it. A server is a computer software and its underlying hardware that accepts requests via HTTP or its secure version HTTPS. HTTP is a network protocol created to distribute web content. A user can access a server via HTTP or HTTPS protocol by sending a request to the server, the server then checks the availability of the content and returns a proper answer to the request of the user. If the content is not available, the server responds with an Error message. There are many types of answers that a server will return to the user, These responses are three-digit numbers like 404 error. The request that the user sends to the server can be in the form of a URL or an address of a website. The URL is entered in a web browser, then the web browser sends the request to the server. There are 2 types of servers, static and dynamic. We will talk about more details of them throughout this article

What is a web server?

The term web server can refer to hardware, software or a computer sofware with its underlying hardware. On the hardware side, a web server is a computer that stores web server software and a website’s component files (for example, HTML documents, images, CSS stylesheets, and JavaScript files). A web server connects to the Internet and supports physical data interchange with other devices connected to the web.
On the software side, a web server includes several parts that control how web users access hosted files. At a minimum, this is an HTTP server. An HTTP server is software that understands URLs (web addresses) and HTTP (the protocol your browser uses to view webpages). An HTTP server can be accessed through the domain names of the websites it stores, and it delivers the content of these hosted websites to the end user’s device.
As explained earlier, whenever a browser requests a file via HTTP, when the request reaches the correct hardware (webserver), the software (the HTTP server) accepts the request then finds the requested file and sends it to the browser, and if the server doesn’t find the requested document, it returns the 404 error

static server vs. Dynamic server:

To create a website you need either the static web server or a dynamic one. A static web server, or stack, consists of a computer (hardware) with an HTTP server (software). We call it “static” because the server sends its hosted files as-is to your browser. On the other hand, A dynamic web server consists of a static web server plus extra software, most commonly an application server and a database. We call it “dynamic” because the application server updates the hosted files before sending content to your browser via the HTTP server.

Why do we need to host the files?

Every web page has a number of files containing the HTML documents, CSS style sheets, JavaScript codes and some files such as photos or other documents.All these files need to be stored somewhere on the web server. The first question that comes to the mind is that why not storing all these data on our own computer system? Of course this is possible but it is better that we save the files on the server because:

1. A dedicated web server is typically more available. (up and running)
2. Excluding downtime and systems troubles, a dedicated web server is always connected to the Internet.
3. A dedicated web server can have the same IP address all the time. This is known as a dedicated IP address. (not all ISPs provide a fixed IP address for home lines)
4. A dedicated web server is typically maintained by a third-party. Thus, finding a good service provider is an important part of creating a website.

What is HTTP and what does it do?

HTTP is the acronym of Hyper Text Transform Protocol and it specifies how to transfer hypertext (linked web documents) between two computers. HTTP is a texual protocol meaning that all commands are plain-text and human-readable. Also, it is a stateless protocol which means that Neither the server nor the client remember previous communications. For example, relying on HTTP alone, a server can’t remember a password you typed or remember your progress on an incomplete transaction. You need an application server for tasks like that.
HTTP provides clear rules for how a client and server communicate. Each interaction between the client and server is called a message. HTTP messages are requests or responses. Client devices submit HTTP requests to servers, which reply by sending HTTP responses back to the clients.
HTTP requests are sent when a client device, such as an internet browser, asks the server for the information needed to load the website. The request provides the server with the desired information it needs to tailor its response to the client device. Each HTTP request contains encoded data, with information such as:
1. The specific version of HTTP followed. HTTP and HTTP/2 are the two versions.
2. A URL. This points to the resource on the web.
3. An HTTP method. This indicates the specific action the request expects to receive from the server in its response. Some of the famous methods are POST and GET.
4. HTTP request headers. This includes data such as what type of browser is being used and what data the request is seeking from the server. It can also include cookies, which show information previously sent from the server handling the request.
5. An HTTP body. This is optional information the server needs from the request, such as user forms — username/password logins, short responses and file uploads — that are being submitted to the website.

HTTP Status Codes:

In response to HTTP requests, servers often issue response codes, indicating the request is being processed, there was an error in the request or that the request is being redirected. Common response codes include:
1. 200 OK. This means that the request, such as GET or POST, worked and is being acted upon.
2. 300 Moved Permanently. This response code means that the URL of the requested resource has been changed permanently.
3. 401 Unauthorized. The client, or user making the request of the server, has not been authenticated.
4. 403 Forbidden. The client’s identity is known but has not been given access authorization.
5. 404 Not Found. This is the most frequent error code. It means that the URL is not recognized or the resource at the location does not exist.
6. 500 Internal Server Error. The server has encountered a situation it doesn’t know how to handle.

What are the Proxy Servers?

Proxies, or proxy servers, are the application-layer servers, computers or other machines that go between the client device and the server. Proxies relay HTTP requests and responses between the client and server. Typically, there are one or more proxies for each client-server interaction.
Proxies may be transparent or non-transparent. Transparent proxies do not modify the client’s request but rather send it to the server in its original form. Nontransparent proxies will modify the client’s request in some capacity. Non-transparent
proxies can be used for additional services, often to increase the server’s retrieval speed.
Web developers can use proxies for the following purposes:
1. Caching. Cache servers can save web pages or other internet content locally, for faster content retrieval and to reduce the demand for the site’s bandwidth.
2. Authentication. Controlling access privileges to applications and online information.
3. Logging. The storage of historical data, such as the IP addresses of clients that sent requests to the server.
4. Web filtering. Controlling access to web pages that can compromise security or include inappropriate content.
5. Load balancing. Client requests to the server can be handled by multiple servers, rather than just one.

Conclusion

In this article, we have got familiar with the concept of web servers, what they are, what they do, and how they do it. Then we got to know about dynamic and static web servers. In addition to all of these, we introduced the HTTP protocol with the details of its functionality, status codes, and proxy servers. This article will give you the basic perspective of IT and if you want to find a career in this field. You need to learn these basics and become familiar with the said concepts.

Download this Article in PDF format

3d websites

Arashtad Custom Services

In Arashtad, we have gathered a professional team of developers who are working in fields such as 3D websites, 3D games, metaverses, and other types of WebGL and 3D applications as well as blockchain developemnet.

Arashtad Serivces
Drop us a message and tell us about your ideas.
Fill in the Form
Blockchain Development