Internet Windows Android

How does a web server work. Web server (Web Server): what is it for, how it works and how it works

If a computer connected to the network is used daily, if the Internet is also connected to the mobile gadget, then each user from time to time encounters the word “server”. Moreover, this word can be found in different combinations, and not every user understands what it is about. What is hidden before the word "server", and why do users need it?

The concept of "server" can hide a hardware device and software for it (hardware and virtual). The hardware server is a separate computer. It is needed to ensure the operation of other PCs and office equipment. The virtual server is software. In this case, a particular server combines these two types.

First, remember that its job is to maintain the network and users, not to manage the network. Users themselves set tasks for the server, and it quickly solves them. The better the server, for example, such as HP servers, the better it performs its duties.

The work of large companies that have a lot of electronic equipment installed is already difficult to imagine without connecting all these devices into one network. The server in the enterprise allows remote control of office equipment and allows PCs to interact with each other.

A server breakdown or failure in its operation can end in disaster

In enterprises, servers allow you to optimize the work of all departments. But in everyday life, we often encounter the operation of servers. In particular, tellers at cash desks and banks use the server to print out documents and make payments. The server supports the work of all mailers, social networks and communication managers.

The server provides access to the network. All sites are stored on servers. It provides shared hosting. This service is provided by hosting companies.

A server is a certain program, device or software and hardware complex that implements some services. In turn, a service is a service that performs some actions requested by the client. Let's take a closer look at how the server works.

Components of the client-server scheme

Let's see what the server itself consists of and what external components it cannot do without. First, the server loses its meaning in the absence of clients. The principle of the server is to fulfill the needs of clients. The client forms the requirements for the server and takes on some of its work. Therefore, more often they talk not just about the server, but about the client-server system. The client makes requests to the server, through which he expresses his will. Therefore, the next, second component of the system will be the formal language in which these requests are made. There are a great many of these languages ​​and the choice of one or another directly depends on the server. Requests to the server must somehow be delivered. The third element is the communication channel between the client and the server through which data is transmitted. This is most often either a local network, or the Internet, or local connections of one machine. The server must somehow accept and recognize the incoming request. The receiving device - the so-called external interface, represents several ports that the server continuously (or not continuously) listens to. Accepted requests are sent to the server software, where they are processed in accordance with how the server is programmed. And depending on the received request, this or that service is launched with certain initial data. Services will be the last component of the system. After the end of the service, the result of the execution is sent to the client via the same communication channel. Or, if the service is interactive, then in the process of its operation there will be an intensive data exchange via the client-server channel.

What is a server for?

Now the main purpose of client-server systems is to move the load from the client machines to the server machine. That is why the computing power of a conventional server is a couple of orders of magnitude higher than that of a conventional home computer. But sometimes such an organization of the system gives the entire load to the clients, and the server serves to organize their work and interaction. Or strictly the opposite, the server performs all the calculations, and the clients serve only to issue information to the user. As you can see, there are a lot of ways to use the client-server model.

Pros and cons of the model

The advantages are obvious - the very principle of the server operation ensures the convenience of working with the system, ease of management, and the correct distribution of the load on the machines. And the downside is the query language and related components. If the user accidentally or deliberately sends an ill-formulated request to the server, then if such an error was not provided by the programmer, the system will crash. Knowledgeable people make deliberately incorrect requests so that a system designed to issue a weather forecast to a client outputs to an attacker, for example, the credit card data of all users (unless, of course, the same server is responsible for the map data and the weather forecast). And the happy attacker first goes and transfers to himself all the money of all users of the service, and then long and thoughtfully runs away from the “K” department investigating this crime.

Safety

The client-server model of organizing the work of the system is a very convenient thing in programming, management and operation. But in order for such a system to be usable, each component of a working circuit must be protected both from intruders and from users who do not know how the server works, but press all the buttons that they can reach in an arbitrary sequence. In order to be able to store, transfer and process important data in the system, for example, information about payment cards, the information security system of the server must meet the requirements specified by law.

We have released a new book, "Social Media Content Marketing: How to get into the head of subscribers and make them fall in love with your brand."

A web server is a server that receives requests from the user and gives them responses - a document, page or site.


More videos on our channel - learn internet marketing with SEMANTICA

Any computer can be made a server. To do this, you need to install a special shell.

Requirements for the technical part are determined by the amount of allocated resources and speed requirements. The larger they are, the more powerful the computer should be.
To make it clear, let's give an analogy. You go to the library and ask for a book. The librarian finds the right one and passes it to you. The library is a server, it stores all the data. The librarian is the shell that accepted the request and sent the response. You are a client.
You can send a librarian for more information - similar to clicking on a link. The difference is that the same resource on the Internet can be read by an unlimited number of users at the same time.
Customer service is carried out according to a similar principle: when we come for a book, we can ask a librarian a question (search engine) or look into an index (YandexCatalog). This helps you find the information you need.

What does a web server do

Its main task is to store information. Pages, files, images, text content.
Tasks:

  • Receive requests.
  • Run programs in special programming languages ​​(server).
  • Build web pages.
  • Send them back to the user.
  • Protect information.
  • Perform visitor identification.
  • Keep a call log.
  • Serve other types of requests: mailto, etc.

To understand how a web server works, you need to understand how information is transmitted over a network. It is based on rules called protocols: any URL begins with a type indication (ftp, http://, https://, etc.).
Hyper Text Transfer Protocol - transfer protocol. Site pages always look like a hypertext document. It is the end result of any server or client program.

  • When a user enters an address or clicks a link, the browser sends the request, encoding the information according to these rules.
  • The host to which this address is bound runs the server programs. Each of them performs its own functions.
  • The received data is decrypted, the commands are executed.
  • Hypertext is formed, encoded and sent back.
  • The browser receives the response, converts the code to html, and displays the page on the screen.

What is needed for a web server

We need a machine that will process all requests. Estimate the load that the server must support. It depends on the number of visitors: the more requests, the more power is required.

There are special companies that provide hosting services. You are renting a server. You are given a quota for hosting site files.
But if you have a simple site, then you can do it on your own.

When the issue with the server is resolved, you need to bind a static IP address to it.

The site becomes available on the web server after the domain name is registered, the DNS service resolves the addresses - binding the IP address (for example, 111.111.111.111) and the domain name (www.site.com).

The most common servers

Apache

It is a free, freely distributed product that has a lot of advantages:

  • Ongoing developer support.
  • Modules for working with server-side programming languages ​​PHP, Perl, Python, Ruby, ASP, etc.
  • Open source. Various programmers are involved in the revision to fit their needs. For example, the Russian-speaking community adapts it to the Russian encoding.
  • . It was originally created for Unix, but is now supported by Windows, Mac OS, BSD, Linux, OS/2 and Novell NetWare.
  • Safety.

When installing, specify the name of your host, for example, localhost. In the htdocs folder, which lies inside the Apachex.x folder (where x.x is the version number), copy any html page. Or create it in notepad by entering any text and save it with the html extension.

Once the file is in the folder, open your browser and type in the address: localhost://PAGENAME.html. Your text will appear on the screen - the page is opened from the server. If you see the error "Unable to access the site", then Apache is not running. Its icon is in the tray.
Click on it and select "Play". After that everything will work.

NGNIX

The share of active sites operating on it is 21.13% (Netcraft research). It is mainly used by large companies and professional developers: Yandex, Mail.ru, Rambler, etc. NGNIX can withstand a huge load of visitors, is reliable, safe and thoughtful.
It is distributed freely, but paid versions of Plus have appeared, costing from $ 2,500.

IIS

His fame is provided by the big name of the developer. It is a set of web services and is integrated with Windows. The native programming platform is ASP.NET, but you can implement an alternative, such as PHP.

Full hosting requires the installation of a server operating system from Microsoft - Windows Server. The 6th version was not intended for hosting at all, full support began in the 7th. It is purchased automatically along with the operating system and depends on its characteristics.

Installation packages

For novice programmers and developers, tools are created that allow you to deploy a web server on your computer in a few clicks.

  • openserver. A portable development environment that includes many databases, programming languages ​​and their versions, as well as additional services. For example, the PhpMyAdmin database interface. Today it is the most popular installation kit. Works even from a flash drive. Free download at low speed. For 100 rubles, the speed increases significantly.
  • Xampp. Actively maintained package: Apache, Php, Perl, MariaDB, etc. Has a control panel. Download for free.
  • . A very convenient set of all the necessary tools, including Apache, PHP, MySQL, PhpMyAdmin. Unfortunately, the latest version includes outdated distributions. In general, they are suitable for training. Judging by the forum, the project is no longer supported.

Below we provide an adapted translation of the article The non-techie's guide to servers by Kannen Chandrasegaran, a developer from Panopto. Please note that the article is intended for beginners who are not familiar with the concept of the server side of the application and servers.

From office life

It is difficult to be a “non-techie” in an IT company, believe me! Marketers, sales managers, accountants - it doesn't matter - from time to time they run into their tech-savvy colleagues. It could be programmers or system administrators.... In any case, "non-techies" feel like they've had an important part of their brain amputated. Or they landed on an unknown planet with intelligent non-humanoid life. Or…

Sometimes, of course, everything ends well. Here, for example, the girl - "", is walking down the corridor. Nothing portends trouble: she is heading to the left, you are to the right, and as quickly as possible ... No, this time it didn’t blow. You are already sitting at the table with her, and trying to overcome the awkward silence, you ask: “And ... what exactly do you do?”. She starts to say something, but you do not immediately understand what she is talking about. It seems that the words are familiar: the user interface, applications, and - for sure, Facebook is a site. Yeah, there are buttons, menus ... You somehow figured out the intricacies of her work, nod goodbye to her and your paths diverge in the corridors of a large office.

But sooner or later you will not be so lucky: you will meet a server engineer. Or back-end developer. Not knowing what kind of wilds you will now get into, you naively ask the same question and ... get abracadabra in response. You hear a lot of foreign words, and thoughts run through your head: “Is it decent to ask what an API is?”, “We use “bede” (DataBase) all the time, right, or what?”, “Who the hell is this Jason (json)?? Your engineer friend is trying to tell you about servers, but does not understand how difficult it is for you to understand his speech filled with professional terms. You've probably heard the word "server" before, but it's used in so many different contexts that it's hard to grasp its meaning. Well, let's try to understand this term.

Down the rabbit hole

When an ordinary person (in the sense, not a programmer or admin) uses an application, all he sees is an interface, a picture that reacts to some obvious (most often) actions. In fact, what users understand by an “application” is usually its front-end, that is, the front, part, wrapper with which they interact. But about what is inside, that is, about what makes the application work, users know very little. Let's say you send me a message, for example, on Whatsapp or Viber. It looks like a message is coming from your smartphone to mine. Let's take a closer look at this process. Let's say you send me a message when my phone is turned off, and then you turn off your smartphone yourself. And so, I turn on my phone, and still I receive your message, although our phones did not work at the same time. Looks like we missed something! This is “something”, the component we missed - the back-end or server.

Speaking of front-end and back-end, programmers usually mean separating the user part of the application from the program logic. So, the front-end (front-end) is the interface part of the application, and the back-end (back-end) is its server part.

Servers

In essence, a server is a computing machine, a computer that is connected to the Internet and is constantly turned on. When an application needs some information, it contacts the server. When an application needs to communicate with another user of the application, it is the server that facilitates their interaction. The terms server, back-end, and API are often used interchangeably.

Warehouses or storage systems

The main task of the server is data storage. This includes files: photos, videos and documents. The server stores them in a structured way, similar to folders on your computer, so they can be accessed by applications. Also stored on the server information. All applications contain information essential to their operation.

You can present such information in the form of a set of tables. For example, an application needs to store information about a user and their password in order to be able to authenticate. Your application can be a restaurant guide, in which case the server will store information about each restaurant. In addition to the information itself, the server also records connections between data. For example, a user likes a restaurant in an app on a smartphone, and the server remembers this relationship between the restaurant and the user.

This allows you to answer many questions. For example:

  • How many users liked this restaurant?
  • What restaurants does this user like?
  • Which cuisine dishes do several users like at once?
Information and relationships between data are stored in database(DB). There are many types of databases, but all of them are:
  • can store information
  • can store relationships between data
  • may receive requests about information and respond to them as single data or a set of data, depending on the request.
There are many types of databases, each with its own advantages and disadvantages. If you hear terms such as SQL, MySQL, MongoDB, CouchDB, Redis, then you should know that we are talking about databases.

Interaction

The key task of the server is to interact with the application and other servers.

Many application tasks require interaction with the server. For example, if the user is looking for something, the search query is sent to the server and the result comes from there. If a user sends a message to another user, it first arrives at the server. And then from there it is sent to the application of another user, most often in the form of a sent notification. The interfaces that a server exposes so that applications can interact with it are commonly referred to as API. Well, some interface functions can be compared with endpoints(endpoints), for example, with search or authorization on the site. To the uninitiated, this interaction may seem strange. The two most common interoperability formats are JSON and XML.

XML on the left, JSON on the right At first glance, the formats look hard to read. It is important to understand that the server is just a computer, like your laptop or smartphone. The application on your phone accepts user input in voice or text form, through voice recognition, or by touching the screen. The application processes this information and then gives a response in the form of an image on the screen. A smartphone is a computer that interacts with a human, so input and output are provided in a human-friendly manner. A server is a computer that communicates only with other computers. A person perceives information due to such things as: font size, text color and formatting. But that doesn't mean anything to the computer.

Server Application

If you want to create an app that will run on your phone, you will also need an app that will run on the server. Server applications are built using server-side programming languages ​​and frameworks, popular variants of which are Java, Ruby on Rails, Node.js, PHP, ASP.NET.

We can say that the API is the "doors" of your server and the application knows to knock on them. The database stores all your information. And the server application is the “brain” that ties everything together. It receives and responds to requests that come to it through the API, adds and retrieves information from the database, and makes decisions. For example, when a user application sends login information, the request comes through the API, the correct login information is stored in the database. It is up to the server application to compare them and respond accordingly to the application using the API.

Hardware

When you hear the word "server" you most likely imagine this picture: cabinets with flickering light bulbs in a closed room. Probably, to complete the picture, the only thing missing is Tom Cruise, who will come down from the ceiling and steal something. Many large companies own their own servers and entire data centers (those huge rooms with gleaming cabinets). Facebook and Google have hundreds of servers around the world. When you run a huge service with millions of users, running your own servers can be significantly cheaper and provide better performance. Instead of maintaining their own servers, many developers use cloud services. Services such as Amazon Web Services, Azure and Digital Ocean offer the possibility of using "virtual servers". These services own and maintain the hardware, and the developer simply uploads the server application to it. Some service providers provide the backend as a service, allowing you to have a simple backend without having to write the server application yourself.

Do all applications need a backend?

Most applications you are familiar with most likely have a backend component. Of course, you can find programs without a server part. For example, some productivity apps. An easy way to find out if an application has a backend is like this: If the answer is "no", it means that the application definitely has a backend server.

I hope you have an understanding of what the back-end of an application is. Maybe the next time you meet your fellow programmers, you can not only understand what they are talking about, but also use some damn "Jason" in your conversation.

More small businesses can appreciate the benefits of having a network

The words "server" and "network" for many people conjure up huge computer rooms in the bowels of large corporations, run by bespectacled techies in windowless rooms. Fortunately, times have changed.

Today, networks with servers can be seen in more than 20% of US small businesses with more than one PC, and this percentage continues to grow, according to analysts. What's more, analysts say that organizations with fewer than five PCs are now adopting more servers and networks, as users have already begun to appreciate the convenience and high performance of working on a public network.

But who are these people who manage these servers and networks? If you run your own business, then you can be yourself. Or entrust it to your office manager, marketing specialist or even accountant - anyone with a sufficient technical background can handle this task.

"I'm seeing more and more small organizations running servers, even in single-employee offices," says Laura DiDio, small business analyst at Boston-based consulting firm The Yankee Group. “They allow you to get more return on the dollar invested in technology.”

All roads lead to the server
Let's look at the reasons that motivate small businesses to install servers (servers are computers that provide services, commands, and centralized management to workstations called "clients"). But first, let's see why networks with servers already work in user offices.

Take the already familiar Laura DiDio. She works part-time at her country house and wants to make the most of her technology spending. “I have two laptops at home, two high-speed connections, three phone lines, and a server running Microsoft Small Business Server,” Laura says.

The server is the engine of her system. It allows DiDio to centralize and secure PC data, control files, easily create backups and work efficiently with clients - clients receive the same service as if she were not at home, but in her Boston office.

“The server allows me to work more flexibly, install whatever I want, and give me a professional image,” says Laura.

Another server proponent is Harry Brelsford, a technology reseller consultant and technical writer based in Bainbridge Island, Washington. He has three client PCs and a server in his office. Here he provides technology consulting services to about 20 companies and also writes books on the subject (he has already written 10 such books).

“The server and network help me a lot,” says Brelsford. - “If I need a file, I know exactly where to look for it. I also have more confidence in the stability of the system no matter what I do. You just do the job better and without rework. You can forget about lack of disk space, file clutter, insufficient processor power and data loss.”

DiDio and Brelsford are talking about Dell and Hewlett-Packard servers that cost no more than $1,000. They run the new Microsoft Windows Small Business Server 2003 software ($599 for the Standard Edition). Such a complex is very attractive for managers who know how to count their money. The Standard Edition also includes Microsoft Exchange Server 2003.

Ray Boggs, vice president of small business and home office development at IDC, a technology consulting firm in Framingham, Massachusetts, agrees. He says that while all small organizations can benefit from moving to client/server technologies, those with 15 PCs or more will benefit the most. This is achieved through new hardware and software designed specifically for this market and a sharp increase in the number of transactions.

“Server prices continue to drop and their functionality continues to improve,” says Boggs.

Eight reasons to buy a server
So, after listening to the opinion of analysts and ordinary users, we have eight reasons to purchase a server for your small business, instead of doing without it or relying on a peer-to-peer networking environment.

  1. You will bring order to chaos. By centralizing data on the server, you can better manage critical business information. Sharing files and other data from all PCs is much easier than moving data from one PC to another. And as DiDio points out, older PCs can take on a new lease of life if their files and data are uploaded to a server. "Many people buy servers and are in no hurry to get rid of their old PCs and laptops," she says.
  2. The best data protection. Windows Small Business Server 2003 provides two features that help users better protect their information assets by making it easier to back up and restore critical data. This is a wizard for setting up archiving and volume shadow copying.
  3. Better cooperation when doing business. The network supported by the server is not only about facilitating data sharing. Windows Small Business Server 2003 comes with Windows SharePoint Services, software that allows your employees and other team members to collaborate over the Internet. By installing SharePoint, you get a company intranet portal with a user-friendly interface that allows you to share and organize your data. Services come with help documents and resources. The server is also required if you need to support business-critical applications, such as Microsoft Business Solutions, on multiple PCs.
  4. Increasing staff mobility. Servers enable remote access to the network and data to authorized employees who are away from the office, on the road, or working in local offices. With the Internet Workplace feature, users of Windows Small Business Server 2003 can access data on the server over the Internet. Employees away from the office can also connect to the company intranet via SharePoint
  5. Sharing high-speed access. "The real catalyst for selling servers to small businesses is high-speed Internet access for all the computers on the network," says IDC's Boggs. - “If your business uses three or more remote access accounts, it's time to buy a server and switch to high-speed access. The return on investment will be very fast due to the growth of labor productivity.”
  6. Quickly set up new computers, add users, and deploy new applications. Are you planning to grow your business? By managing data from a common center, it's easier to coordinate the addition of new PCs, software, and licenses. You can also better manage firewalls and control data threats, deploy antivirus protection, and detect intrusions.
  7. Increasing computing power. The server expands the network capabilities by allowing you to store large amounts of data, freeing up memory and increasing the efficiency of using individual PCs. "Small businesses today need more computing power to run Web services, manage Web sites, send out emails, and use better tools and applications," says DiDio. (Boggs adds that the day is not far off when many people will have servers running at home, helping students with PCs to complete school assignments and teenagers to buy games and other complex programs online.)
  8. Create a professional image for your business and increase customer engagement. Server software such as Windows Small Business Server 2003 allows you to combine your email accounts (AOL, Yahoo!, Hotmail, etc.) into one company account, enhancing your image with customers and partners. "You can have multiple aliases for the same root email address," says Brelsford. - "A server can give weight to your business." DiDio: "Not only does it get you more bang for your buck, it also makes you look more professional to the people you want to do business with."
How do you know when it's time to buy a server?
  • Your business has two or more remote access accounts.
  • You want to centralize and organize your data (you can't always find what you need).
  • You want to share hardware such as printers and fax machines between two or more PCs (when using peer-to-peer networks for this purpose, a large number of cords and wires are required).
  • You want to make backups easier to ensure better data protection.
  • Many of your employees who are often on the road, away from the office, or work in local offices need to connect to the network.
  • You want to cover your entire business with an internal network (employees who are out of the office do not always remember that they need to contact you from time to time).
  • You need a lot of storage space (and your overloaded PCs shudder and groan as you add more data).
  • You would like to run financial software or other business-critical applications on multiple PCs.
  • Your company is growing and you are planning to take on new employees and add computers (congratulations!).
  • You have a modest business and would like to look professional (and bigger than you really are).
  • Your PCs are very old and you would like to get rid of them. The server will make the transition process painless.
  • Your PCs are very old, but you would like to keep them. The server will take over the load from the PC.