Internet Windows Android

How to work with a clean server. How a web server works

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.

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.

As a rule, for an ordinary user, such concepts as “web server” or “hosting” are associated with something completely incomprehensible. Meanwhile, there is nothing complicated in this matter. Let's try to explain what a web server is, why it is needed and how it works, without going into technical details, but, so to speak, on the fingers. We will separately dwell on the question of how to create and configure such a server on a home computer terminal or laptop.

What is a web server?

The most important thing in this matter is to understand that a server of this type is nothing more than a computer on the Internet with the appropriate software installed.

But this absolutely does not mean that you cannot create your own configuration at home. Since Windows operating systems are more common for us, questions on how to create a web server on Ubuntu (Linux) will not be considered.

What are web servers for?

This type of server stores a lot of information on the Internet. At the same time, the same antiviruses refer to them to update their own databases. The user also has a direct relationship with such servers, making requests in the browser (search for information, accessing a page, etc.).

So it turns out that all the pages present on the Internet are stored precisely on web servers, to which, on the one hand, a user request or an installed program is accessed, and on the other hand, the result is given by the very server to which access is attempted.

How does it all work?

All users are used to the fact that to enter some resource on the Internet (web page) that contains information of a certain type, the www (or http) prefix and the subsequent name are simply entered in the address bar. But no one thinks about how the web server understands the request and gives the result.

In fact, here you need to distinguish between the concepts of server and client. In our case, the page hosted on the Internet is stored on a remote server. The user computer acts as a client, from which the call is made.

To access the Internet, programs called web browsers are used. They translate the user's request into a digital code that is recognized by the web server. The server processes it and issues a response in the appropriate code, and the browser already converts millions of zeros and ones into a normal form with text, graphic, sound or video information that is placed on the page.

Most Popular Web Servers

Of all the server software, Apache and Microsoft IIS are considered to be the most common. The former is more popular and is more commonly used on UNIX-like systems, although it can be installed on a Windows environment. In addition, the Apache server is completely free software and is compatible with almost all known operating systems. However, as noted, this software is intended mainly for professional programmers and developers.

The software product from Microsoft is designed for the average user, who can install and configure such a web server for Windows without the additional help of a qualified specialist.

Nevertheless, based on official statistics, the Apache software uses about 60% of all existing servers, so we will consider the issue of installing and setting up the initial configuration using its example.

Web server on home computer: installation

For installation, you will need to download a special server package, abbreviated as WAMP, which includes three main components:

  • Apache is a server software shell that can work independently, but only if there is no dynamic content on the hosted pages.
  • PHP is a programming language used by add-ons to manage dynamic content servers like WordPress, Joomla, Drupal.
  • MySQL is a unified database management system used, again, when creating websites with dynamic content.

Installation can be done from the WampServer package. To do this, just follow the instructions of the "Wizard", which at one of the stages will prompt you to select an Internet browser that will be used by default.

To do this, you will need to go to the folder with the browser executable file (if it is not Internet Explorer, it is usually located in the Program Files directory). Along the way, the browser itself should be added to the Windows Firewall exception list. At the final stage, a check mark is placed in front of the immediate launch item, after which the corresponding icon will appear in the system tray, which you need to click on and change to select the launch of the local host (localhost).

If everything is done correctly, the server home page will appear. Next, you will be prompted to install additional components (if this is not done, the system will give an error). Basically, the installation concerns additional add-ons, elements and components that will be used by the server in the future.

An example of setting up and testing a server

Setting up a web server is somewhat more complicated. First, in the system tray menu, navigate to the WWW folder (where add-ons or HTML files are stored). After that, write the following text in Notepad:

WAMP test!

Hello!

"; ?>

You can simply copy the text into Notepad and save the file as index.php in the same WWW folder (although you can do without, since this step is only used to check the local host). Instead of a greeting, you can insert any other text or phrase.

Then in the browser you need to refresh the page (F5), after which the content will be displayed on the screen. But for other computers, the page will not be available.

To open access, you need to change the httpd.conf file by writing in the section that starts with the following lines:

Order Allow, Deny

Instead of an afterword

Of course, with regard to understanding the essence of the functioning or settings of a home web server, only the most initial and brief information is given here, so to speak, for a general understanding. In fact, all processes are much more complex, especially in terms of converting requests and issuing responses, not to mention the server settings at home. If the user has a desire to understand these issues, one cannot do without at least basic knowledge of the same WordPress add-on and the PHP language. On the other hand, for the publication of primitive pages containing mostly only textual information, this initial information can also be used.

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.

If you type in the address bar of your browser http://www.site/how-web-server-work/ and press the Enter key, this page of our Website will appear on the screen.

At the most basic level, this is what happened: Your browser formed a connection to the Web server, sent a request for the Web page of the page, and received it.

Now a little more:

The URL has three parts:

1. Protocol (http)

2. Server name (www.site)

3. Page URLs (how-web-server-work)

The browser contacts the domain name server to translate the site name www.site into IP address, which it uses to connect to the server machine. The browser then makes a connection to the Web server at the specified IP address on port 80, or whatever it is intended to be (We'll discuss ports later in this article).

Following the HTTP protocol, the browser sent a request to the server, requesting the file http://www.site/how-web-server-work/

note that cookies can also be sent from the browser to the server.

In response, the server generated dynamic web page and sent back HTML text to display this page in your browser. Cookies can also be sent from the server to the browser in the page header. The browser reads the HTML tags and renders the Web page on the screen.

Internet

So what is the "Internet"? The Internet is hundreds of millions of computers connected together in computer network. The network allows all computers to communicate with each other. A home computer can be connected to the Internet using a variety of methods and devices - from a primitive modem for a telephone line, to uploading a connection over a local area network ( LAN) with an ISP ( ISP).

Major ISPs maintain fiber optic lines for an entire country or region. Backbone networks are laid all over the world, connected by fiber-optic lines, submarine cables or satellite channels. Thus, every computer on the Internet is connected to every other computer on the Internet.

Clients and Servers

In general, all computers on the Internet can be divided into two categories: servers and clients. Computers that provide services (such as Web servers, FTP servers, cloud services) to other machines are servers. Machines that are used to connect to these services − clients. When you connect to Google to perform a search query or use any of its services, Google provides its computer (perhaps a whole cluster of powerful computers) to serve your request. So Google provides the server. Your machine can also provide services to someone on the Internet. Thus, the user's machine is usually a client, although it can also become a server if necessary.

The server may provide one or more services on the Internet. For example, a server computer may have software installed that allows it to act as a Web server, e-mail server, and FTP server. Client computers that connect to the server direct their requests to special software running on the shared server computer. For example, if you use a Web browser on your computer, it will "talk" to a Web server on the server computer. Your email application will "talk" to the email server, and so on.

IP addresses

To connect all these machines to a network, each computer on the Internet has a unique address called IP address. A typical IP address looks like this:

The four numbers in an IP address are called octets because they can take values ​​between 0 and 255 or 2 8 possible values.

Every computer on the Internet has its own unique IP address. The server has a static IP address that rarely changes. A home computer often has an IP address assigned by the ISP when the machine connects to it. This IP address is unique for this session, but may be different next time. Thus, an ISP only needs one IP address for each router it supports, not for each client.

If you are on a Windows machine, you can view a lot of information about the Internet on your computer, including your current IP address and hostname, with the command ipconfig. On a UNIX machine, type nslookup on the command line to display the machine's IP address.

Domain names

Because most people have difficulty remembering the sequence of numbers that make up IP addresses, and because IP addresses sometimes need to be changed, all servers and sites on the Internet also have human-readable names called domain names. For example, www.. This is easier for most of us to remember. www.site than to remember 5.9.205.233

The name www.site actually consists of three parts:

1. The name of the World Wide Web (www). In fact, you can do without the explicit indication of "www", although, formally, it will be a different network.

2. Domain name (qriosity)

3. In the zone of the top-level domain (ru)

domain names govern Domain name registrars. Registrars create top-level domain names and ensure that all names in the top-level zone of a domain are unique. The registrar also provides contact information for each domain name and launches a service whois A that points to the owner of the domain. The hostname is created by the owner of the domain.

Domain name servers

A set of servers called domain name servers(DNS) maps human-readable names to IP addresses. These servers contain simple databases containing names and IP addresses, and they are distributed throughout the Internet. Most individual companies, ISPs, and major universities support small DNS. There are also central DNS that use data supplied by Domain Name Registrars.

When you enter the URL http://www..site, passes it to the domain name server, the server returns the correct IP address for www.site. A number of name servers may be involved in getting the correct IP address.

So, to recap what we've read: The Internet is made up of millions of machines, each with a unique IP address. Many of these machines are servers. This means that they provide services to other computers on the Internet. Many of these servers are email servers, Web servers, FTP servers, cloud service servers.

Ports

Any server makes its services available over the Internet using numbered ports, one for each service available on the server. For example, there is a server computer running a Web server and an FTP server. The web server will typically be available on port 80 and the FTP server will be available on port 21. Clients connect to the service on a specific IP address and on a specific port.

Each of the most popular services is available on a known port number, but you can assign your own port number to any service.

If the server accepts connections on a port from the outside world, and if the firewall does not protect the ports, you can connect to a predetermined port from any computer on the Internet and use the service. Note that there is nothing that forces you to keep the Web server on port 80, for example. If you installed your server and loaded the Web server software on it, you could put the Web server on port 999, or whatever another unused port. Then, if, for example, your machine is known as xxx.yyy.com, then it can be connected with the URL http://xxx.yyy.com:999 -":999" explicitly specifies the port number on which to reach your Web server. If no port is specified, then the browser simply assumes that the Web server is reachable on the well-known port 80.

Protocols

Once a client is connected to a service on a given port, it accesses the service using a special protocol. Protocol is a set of logical level agreements that allow programs to exchange data. For joint work of computers on the Internet, a family of protocols TCP / IP is used. The web server uses the HTTP protocol.

Optional: Security

You can see from this description that the Web Server is a fairly simple piece of software. It takes the name of a file sent using the GET command, gets the file, and sends it to the browser. Even if you take into account all the code for handling ports, the program of the simplest Web server consists of no more than 500 lines of code. Full blown Web servers are more complex, but fundamentally very simple.

Most servers set some level security to service processes. The simplest option is to request a login and password to gain access to the server. More advanced servers add additional security by establishing an encrypted connection between the server and the browser so that sensitive information (such as credit card numbers) can be sent over the Internet.

This is really all that a Web server needs, which serves standard, static web pages. Static pages are pages that do not change unless the webmaster edits them.

Optional: Dynamic Pages

What dynamic Web pages? For example:

1. Any guest book allows you to enter a message in an HTML form, and displays new and old entries automatically.

2. Any search engine allows you to enter keywords in the HTML query form, and then it dynamically creates a page based on searching for information on these keywords.

In all these cases, the Web server does more than just "search for a file". It processes information and generates pages depending on the specifics of requests. In almost all cases, the Web server uses so-called scripts— program code written in PHP, Perl, Java and other programming languages ​​to complete this process.

The pages of our site are also dynamic, created with PHP using MySQL databases.