Select a local web server for Windows. Web Server: what is it for, how it is designed and how it works The most common web servers

Hi, This article covers the 5 most popular options for setting up a server for a web application. What options are there and which one to choose?

There are many factors to consider when choosing a server environment, such as performance, scalability, availability, reliability, cost, and ease of management.

The article presents a set of the most commonly used server environments with a brief description of them, including pros and cons. All concepts can be used in different combinations with each other, and each environment has different requirements, so there is no single correct configuration.

1. Everything on one server

The environment is on the same server. For a typical web application, this will include a web server, an application server, and a database server. A special case of implementing this set is , the name of which is an abbreviation for Linux, Apache, MySQL and PHP, on a single server.

Usage example: Good for quickly deploying an application as it is the simplest configuration of all, but offers little in the way of scalability and component isolation.

Pros:

  • Simplicity

Minuses:

  • The application and database share the same server resources (CPU, memory, I/O, etc.), which, in addition to potentially poor performance, makes it difficult to determine the source (application or database) of this poor performance.
  • It is difficult to scale horizontally.

2. Dedicated database server

The database management system (DBMS) can be separated from the rest of the environment to eliminate competition for server resources between the application and the database and to enhance security by removing the database from the DMZ, the public Internet.

Usage example: Good for quickly deploying an application, but also eliminates the problem of the application and database competing for the same system resources.

Pros:

  • The application and database do not compete for the same server resources (CPU, memory, I/O, etc.).
  • You can vertically scale each component (application and database) independently of each other by adding additional resources to the desired server.
  • With certain settings, this can improve security by removing the database from the DMZ.

Minuses:

  • The installation process is a little more complex than with a single server.
  • Performance problems may occur if the network connection between two servers has a long response time (for example, the servers are geographically distant from each other) or there is insufficient bandwidth for the data being transferred.

3. Load balancer (reverse proxy)

Load balancers can be added to a server environment to increase performance and reliability by distributing the load across multiple servers. If one of the servers goes down, other servers will process incoming traffic until the downed server is up and running again. A load balancer can also be used to serve multiple applications over the same domain and port using a reverse proxy.

Examples of reverse proxy-supporting software include HAProxy, and Varnish.

Usage example: Useful for environments that require scaling by adding additional servers, also known as horizontal scaling.

Pros:

  • Makes horizontal scaling possible, that is, the resources of the environment can be increased by adding new servers to it.
  • Can protect against DDOS attacks by limiting client connections to an acceptable number and frequency.

Minuses:

  • A load balancer can become a performance bottleneck if it is starved of resources or poorly configured.
  • May create additional complications that require additional effort from the administrator, for example, working with applications that require so-called “sticky sessions”.

4. HTTP Accelerator (caching reverse proxy)

An HTTP accelerator, or reverse proxy that caches HTTP requests, can be used to reduce the time required to serve content to the user through various methods. The basic technique used with HTTP accelerator is to cache responses from a web or application server in memory, so that subsequent requests for the same content can be processed quickly and with fewer unnecessary interactions with the web or application server.

Examples of software that supports HTTP acceleration: Varnish, Squid, Nginx.

Usage example: Useful for dynamic web applications with heavy content or a large number of files that can be accessed simultaneously.

Pros:

  • Improves site performance by reducing the load on the web server's processor through caching and compression, thereby increasing the number of users served.
  • Can be used as a reverse proxy load balancer.
  • Some caching software can protect against DDOS attacks.

Minuses:

  • Requires tuning to achieve best performance.
  • If the nature of user requests does not allow for effective caching, this can reduce server performance.

5. Database replication according to the Master-Slave scheme

One way to improve the performance of a database system that experiences many more read requests than write requests, such as in content management systems (CMS), is to use master-slave database replication. This scheme assumes the presence of one master and one or more slave nodes. In this case, all writes are directed to the master node, and read requests can be distributed among all nodes.

Usage example: Gives a good increase in application performance in terms of reading from the database.

Here is an example of a master-slave database replication with one slave node:

Pros:

  • Improves database read performance by distributing read requests across slave nodes.
  • Can improve write performance by using the master node exclusively for writes (so it doesn't waste time servicing read requests)

Minuses:

  • A database application must have a mechanism for determining which nodes to send read and write requests to.
  • Slave node updates are asynchronous, so there is a chance that the data may not be the most recent when queried.
  • If the master node stops working, you cannot make any database updates until the problem is resolved.
  • Does not have built-in backup facilities in case of failure of the main node.

Example: Combining Concepts

You can load balance cache servers, in addition to application servers, and use database replication in a single environment. The goal of combining these methods is to gain the benefits of each approach without the added complexity.

Here's a rough diagram of what a server environment might look like:

Let's assume that the load balancer is configured to recognize static requests (such as images, CSS, JavaScript, etc.) and sends those requests to the caching servers and all other requests to the application servers.

Here's what will happen when a user submits a request for dynamic content:

  1. User requests dynamic content with http://example.com/(load balancer).
  2. The load balancer sends a request to the application server (app-backend).

If the user requests static content:

  1. The load balancer checks the cache-backend to see if the requested content is cached.
  2. If cached, then the requested content is returned to the load balancer, go to step 7. If not cached, then the caching server will forward the request to the application server through the load balancer.
  3. The load balancer will forward the request to the application server.
  4. The application server (app-backend) reads from the database and returns the requested content back to the load balancer.
  5. The load balancer forwards the response to the caching server (cache-backend).
  6. The caching server caches the received content and returns it to the load balancer.
  7. The load balancer returns the requested content to the user.

This environment has two possible points of failure (the load balancer and the database master), but provides the other reliability and performance benefits described in each point previously.

You should now have a good idea of ​​what exactly you will be using for your own application or applications. If you're working to improve your environment, remember that it's best to go iteratively to avoid unnecessary complexity.

Apache by ASF. Without exaggeration, we can say that this is the most widespread Web server in the world. Now there are versions for virtually all known platforms and operating systems, including Windows NT. Support for Windows NT appeared only in the latest version, and this further increased the popularity of Apache in the world. Its undoubted advantages are reliability, exceptional performance and a huge range of functions and additional modules. But still, the “highlight” of this server is its free, free distribution. This makes it possible, in addition to saving money, to quickly correct errors and make necessary additions to the program code. We must pay tribute to those who are creating the Apache Web server - these people free of charge and, most importantly, very quickly cope with the errors they notice. By the way, I note that anyone who wants to contribute to the development of this server can become such a person. Version 1.3.x is considered one of the most stable and fastest among the entire Apache family. The main properties of Apache are cross-platform support, HTTP/1.1 protocol, modular structure, security, and logging. In addition to the standard package, there are a large number of modules that extend the capabilities of Apache. Free distribution and open source allow you to create the most secure modules. It is difficult for any commercial server to compete with Apache in this regard. But, despite all these advantages, there is also a serious gap, which I still would not call a disadvantage: Apache does not have a beautiful installation and management program. During installation you have to deal with the command line. Moreover, when installing under UNIX, sometimes you even have to make adjustments to the include files. Of course, there is a detailed description of what needs to be changed and how, however, at first glance this does not seem very convenient. When working, you have to deal not with a window program, but with text configuration files. Technical support does not appear in the form of beautiful help files or companies providing specialists, but mainly through teleconferences and the exchange of opinions of system administrators. In fact, there are still companies that provide technical support services, but it costs money. But this style, atypical for a serious product, does not make Apache less popular, and on the market it is the most serious competitor for all WWW servers.

iPlanet server ( former Netscape Enterprise server) from Netscape and Sun. Not so long ago, Netscape and Sun merged in the field of creating a Web server, namely: the former Netscape Enterprise server has now moved into a new quality - iPlanet server. This is not just a name change. Now, close integration with Java technologies has been added to many of the qualities of the previous server. The latest version is 4.1. iPlanet Server, which comes on a CD or can be downloaded from the Internet. However, it is not free. There are versions for both Windows NT and some UNIX systems. The ease of installation, configuration and management is attractive. Basic installation takes no more than 15 minutes. All further configuration is done using a Java program launched in a browser from anywhere. As for Java, as you would expect, the server supports the latest Java technologies, such as Java Servlets 2.1, Java Server Pages .92, JVM, JavaScript 1.4. Today this is the only server of this type. In addition to this, iPlanet server includes database access control capabilities. It comes with drivers for working with Oracle, Informix, DB2, and Sybase. In terms of programming for iPlanet server, there is now a trend towards integration with iPlanet Application Server. This will significantly expand the possibilities for creating programs for the iPlanet Web server. All of these properties make the iPlanet Web server attractive for use in various areas. Work is also underway on the FastTrack server, which will be a limited-capacity analogue of a full server, but at the same time free (in full analogy with Netscape FastTrack). As for technical support, all descriptions, reference books and other materials regarding iPlanet server are made at a high level (as is any documentation located on the Netscape server).

Internet Information Server (IIS) from Microsoft. IIS Server is best for Windows NT . This is understandable, because it is unlikely that anyone other than the developers of the operating system can create a program that fully uses the capabilities of this system. Version 4.0 came free with the Service Pack, and version 5.0 comes exclusively as part of Windows 2000. Version 5.0, according to experts, has higher reliability, tighter integration with Windows and a whole range of new features. Installation and configuration takes no more than 10 minutes. It’s especially nice that now there is no need to install any Service Packs and there is no need to reboot the system after installation. With all this, the server itself takes up about 30 MB of disk space and works quite well on a Pentium 200 MHz machine with 128 MB of memory. However, you can install and run the server only on Windows 2000 Server. In addition to convenient installation, the server management system is also conveniently implemented. There are several useful template programs (Wizards) for performing frequent and routine operations. In general, in fairness, the following should be noted: in terms of convenience, few can compete with Microsoft programs. In addition, IIS supports well-known and includes new security standards. Thus, there is support for the well-known methods SSL 3.0, Kerberos 5.0, and the new Fortezza method (a new security standard). The most interesting and distinctive feature of IIS is its support for WebDAV (Web-based Distributed Authoring and Versioning). This is a recently emerged standard that allows you to turn internal networks into a single space, using the resources of neighboring computers as your own. For IIS users, this means they can more easily share their work files and still have the ability to lock files. However, there are some problems and incompatibility. It is not entirely correct to work simultaneously with Front Page Server; sometimes when changing the configuration you have to restart the system, and errors occur when using the remote administration system. But overall, version 5.0 is a significant improvement over 4.0 in terms of reliability and usability.

An important indicator is server performance. Performance refers to the speed of the server depending on the number of connected clients and the intensity of transmission of the requested data. Performance depends on many factors: the type and speed of the processor, the amount of RAM, the operating system, the presence of other programs, and the settings of the server itself. In the case of Apache, there is a more exotic moment. Usually it is taken in the form of source texts. Therefore, the performance of the compiled program depends on the type and parameters of the compiler and linker. Measuring performance is a very difficult task because not everything depends on the Web server. To compare the performance of Web servers, it is necessary to put them under the same conditions. In fact, it is not entirely clear what it means to put, say, an IIS server running Windows 2000 on Intel and an Apache server running AIX 4.3 on an RS6000 on equal terms. These are completely different operating systems in type and structure and different processors. The most subtle point here, in my opinion, is to distinguish what has to do with the Web server and what has to do with everything else. Nevertheless, such studies are being carried out. The results of some of them can be found on the same Webcompare server. Let us briefly note that in these tests Apache’s performance is slightly lower compared to its two competitors, but, as we have already said, the methodology for conducting these tests and, most importantly, the principle of information processing are not very clear.

In addition to the properties that are inherent directly to WWW servers, there are also issues regarding the operation of the operating system and the Web server as a single whole. This primarily concerns the IIS server as the best for Windows 2000. And the point is not in this server, but in Windows, and also in the fact that the need to restart the entire system arises much more often than in other operating systems. This can cause your Web server to become unstable. Sometimes stability of operation is a more important criterion than ease of control, for example in real-time systems such as Internet radio.

Before you put a website or blog on the Internet, you should test it to see how well the website design will look, how the scripts, feedback form, plugins, and so on will work.
This is the reason why many web developers ( bloggers, web designers or web programmers) use test sites where they conduct checks, tests, experiments, in general, any test work on a future project.
There are two ways to create test sites.
1. Test site on hosting
Some beginners use paid hosting to test projects, hosting two sites - one main (working) and the second additional, test.
Disadvantages of this method:
- lack of space on hosting;
- low Internet speed;
- you don’t always have money to buy paid hosting for testing projects.
2. Test site on your computer
This method, in my opinion, is the best. I want to look at it with you in more detail. First I'll talk about the advantages:
- does not require an Internet connection;
- no financial costs required
What kind of test site is this on a computer? This is about local server, which is installed on your computer. Using a local server, you can quickly and easily test your project.

Someone might say: why even test your project through a local server? After all, just open the file “index.html” and we will see what the site will look like on the Internet. Yes, it’s true, this is enough, but if you use chats, forums, etc. on the site (WordPress, Joomla, drupal), then there is no way without a local server. Moreover, if you use a CMS engine (WordPress, Joomla, drupal) for your project, then you need not only PHP support, but also a MySQL database.

So, local server is a special set of programs that ensures the correct operation of scripts right on your computer. The assembly includes: the server itself, the PHP compiler ( with its help the browser can readphp code and process the page correctly), components for working with databases (Database) and many other programs.

I have prepared for you a list of popular local servers for the site. Read, rate, download and use.

List of popular local servers for the site.

Denwer is a free local server for testing websites, web applications or Internet pages. Denwer includes: Apache web server, phpMyAdmin and MySQL panel for working with databases (databases) and other programs.
The local Denwer server runs only on the Windows operating system.

You can download from the official website denwer.ru

XAMPP is a free local server for testing websites, web applications or Internet pages with a simple user interface. Supports work on Windows, Solaris, Mac OS X and Linux.

You can download from the official website www.apachefriends.org/en/xampp.html

AppServ- another free local server. Fast and easy installation.

You can download from the official website www.appservnetwork.com

VertigoServ- easy to install local server.
Works only on Windows operating system.

You can download from the official website vertrigo.sourceforge.net

Zend Server Community Edition- free local server.

You can download from the official website www.zend.com

Open Server is a free local server with high functionality for developing and creating websites. Runs on the Windows operating system.

You can download from the official website open-server.ru

Personally, I use a free local server. Why Denwer and not some other? Most likely a habit. I started with the local Denwer server, that’s why I use it only. And you need to choose which local server you will work with.

Download the local server, install it on your computer, read or watch a video lesson or instructions for use. Test your web projects and let them bring you a lot of income!

Over time, any web developer ( blogger, web designer or web programmer) will need a special test site where you can practice without any problems website development or testing another web project. Some beginners use the resources of their paid hosting and place at least two websites there. One worker ( basic), and the other ( additional) for testing. The test site undergoes various tests ( installation and testing of many plugins, themes, scripts and so on).

As a result, with this layout, the main production site suffers greatly, since most of the hosting resources are consumed by the test project. However, there is another way that will allow without loss ( both in terms of money and resources) carry out testing of your sites, and we will now consider this method.

Why not?

You probably already know that in order to put your website on the Internet, you need to register a domain name, buy hosting, that is, disk space on some computer with a high-speed connection on which PHP scripts can run. For sites to function fully, PHP and MySQL must be installed. All this is not available on a regular computer. How can HTML and PHP files run on your computer?

A regular file can be opened with Notepad++ or even with Notepad. Write something inside, save it, and then, without any problems, open this file in your browser and see how this file would look on a hosting site on the Internet. That is, we already see a working HTML page. In it we can create certain designs, content and monitor the project without an Internet connection. Essentially, we already have everything. If we want to run a PHP file using a browser, then we will not succeed, since PHP scripts in the Windows operating system will not work without additional software.

All this is not available on a regular computer, and thus there is no possibility of working with your web projects. Therefore, some beginners start spending money on additional resources of their paid hosting. But what to do in this case? The answer is simple - there are special programs with which you can install your own dedicated server directly on your computer.

What is a server?

What's happened server and how a local server differs from one located on the network. In our case, a server does not mean a computer, but a special set of programs that ensure optimal operation of the site. In order for the site to work, we will need to install it in a special designated location on the server (). That is, we download site files to a remote computer. However, without special server programs, our uploaded files will not be visible on the network. Now, for such purposes, we will create our own server on our home computer.

For this we need special programs. But which ones are better suited and what difficulties can they cause during further work? For your information, below I list the best web servers by popularity around the world. However, this does not mean that they need to be installed immediately. I'll explain why later!

List of the best web servers

There are currently several solutions on the market from a variety of manufacturers:

  • (website - apache.org) is the most widespread and popular free server on the network. It is more reliable and flexible. The server is not demanding on processor resources and is capable of serving many sites. The application is available for a wide range of operating systems, including Unix, Linux, Solaris, Mac OS X, Microsoft Windows and others. Apache usage currently stands at 71%. However, this is a complex program that not every beginner can handle.

  • (website - www.iis.net) is another reliable server from Microsoft. It firmly settled into second place with 14% of online usage. After installing the program, only two programming languages ​​will be supported ( VBScript and JScript). However, you can open up additional features by installing the necessary extensions. With the installation of such modules, the functionality of this server is significantly increased.

  • NGINX (website - nginx.org/ru/) is the most popular web server on the Russian Internet. Compared to the first two, it is the simplest and does not have unnecessary functions. It is also praised for its reliability and high speed. The developer of this product is our compatriot Igor Sysoev. In 2004, he released the first version of nginx. Now this software product is one of the three most popular web servers in the world. Its usage is about 6.5%.

  • (website - litespeedtech.com) - this web server does not have many capabilities, but it has a very high speed. It is 9 times faster than the popular Apache. Much attention is paid to safety ( its own protection against system overload, strict checking of http requests, anti-ddos and much more). LiteSpeed ​​is available for Solaris, Linux, FreeBSD and Mac OS X. The program has a usage rate of 1.5%.

Of course, there are many other similar programs, but the share of their use and trust among users is not as high as these. Unfortunately, you won’t be able to do this with just one program. Not only are they useful for large projects, but they can also be difficult to install and configure. In addition, in addition to such servers, separate installation and configuration of some programs is also required ( for example, to work with a database). All this causes significant difficulties for many users. What to do in this case?

Local Server Features

At the moment, there are many different distributions that can make life easier for any novice webmaster. They are very easy to install, easy to operate, less demanding on resources and contain the necessary software elements for the best performance.

That is local server- this is not one program ( not one specific web server), but a special collection that includes lightweight versions of complex server programs. Typically the assembly includes: the server itself ( mostly Apache, but there may be others), PHP compiler ( with its help the browser can read the codes and assemble the page), components for working with databases, various installers and many other programs. All this makes things much easier than if we installed and configured each program separately.

In addition, separate modules can be connected to the basic packages of local servers to expand functionality. Another important feature is that on some servers it is possible to work from a removable flash drive. In general, such assemblies are very well suited for rapid website development, testing small projects, and sometimes even large ones.

Review of popular local servers

Here are some builds that may be useful to you:

  • (website - denwer.ru) is a free domestic server that is designed to work with websites, web applications or Internet pages. Its developers are Dmitry Koterov and Anton Sushchev. This product contains the necessary distributions for simplified work. For example, this includes the Apache web server with various support, the phpMyAdmin panel and MySQL for working with databases and other programs. You can also work from a removable flash drive. Unfortunately Denwer only supports the Windows operating system.

  • XAMPP (website - www.apachefriends.org/en/xampp.html) is a special server build from Apache friends. The necessary distributions allow you to run a full-fledged web server on it. This program is distributed free of charge and supports work on Windows, Solaris, Mac OS X and Linux. There are also the following advantages: the server is popular for its very simple user interface, which makes it a favorite for many beginners; there are multiple appearances of updated versions; the update process is very simple and user-friendly; There are additional modules. You can also download the required version from another official website - sourceforge.net/projects/xampp/files.

  • (website - www.appservnetwork.com) is an excellent server from a Thai manufacturer, the concept of which is easy installation and configuration of all distributions in 1 minute. The first release of the assembly took place in 2001 and since then the number of users has been growing all the time. AppServ is very easy to install, it works stably and is no worse than official and individual releases, and its reliable performance makes it possible to create a full-fledged web server on your computer.
  • (website - vertrigo.sourceforge.net) is another good and easy to install local server. The assembly is very flexible, has good performance and takes up little disk space. Unfortunately, it only works on Windows OS for now.
  • Zend Server Community Edition (website - www.zend.com) is a free server from Zend, designed to work with web applications. Contains all the necessary components for quickly deploying a local server on your computer.

  • (website - open-server.ru) is a domestic portable local server that has high functionality for the development and creation of websites and other web projects. Has a multilingual interface ( including Russian) and is designed to run on Windows OS. Work from removable media is supported. This server is very good and serves as a good alternative to Denver.

  • (website - wampserver.com) - another good build with a Russian interface ( there are also other languages). There is a simple and clear menu, and convenient installation and configuration of the assembly does not cause any particular difficulties. Configuration can be done without affecting configuration files, which is very useful for novice webmasters. The server is distributed free of charge and runs only on the Windows platform. Unfortunately, there is no portable version yet.
  • (website - easyphp.org) - a very simple assembly with Russian language support. The assembly is unremarkable, does not have huge functionality and is mainly intended for testing small projects. There is support for working from portable media. This server will serve as a good replacement for Denver.