Home Office equipment Best local server for windows 10. Which local server is better: OpenServer or Denwer

Best local server for windows 10. Which local server is better: OpenServer or Denwer

A few days ago I was once again visited by a thought. The idea was not new and quite intrusive: “let's switch to Windows8. Well please." And since there was no way to drive her away, I stocked up on tea and cookies and got started.

It took no more than two hours to install the system and all the necessary programs, but then the most interesting moment came: I needed to deploy a working environment, namely GIT + local server (Apache, MySQL, PHP, nginx, memcached, mongodb). Remembering the experience of previous installations, this time I decided to document the entire process and save it for posterity.

Disclaimer number one:“I’m not a programmer” (c), but an interface designer and front-end technologist (but in some cases I can help my colleagues and code something like that, and even then they won’t beat me for it)

Disclaimer number two: Yes, I perfectly imagine that in Ubuntu all this is done much faster. But I work on Windows, this is how it historically happened.

So let's get started.

Our work plan includes installation of the following products:

  1. PuTTY
  2. Denwer (Apache, MySQL, PHP)
  3. Nginx
  4. Memcached
  5. MongoDB

1. PuTTY

PuTTY- a freely distributed client for various remote access protocols, including SSH, Telnet, rlogin.

PuTTY includes several utilities, but in my work I only need it and Pegeant (an SSH authentication agent that stores keys to git repositories).
Offsite:
If you don't need any SSH, forget about this point and move on.

2.GIT

To work with git I've been using it for years now TortoiseGit, which is stable, flexible and covers all my needs by 146%. In general, I recommend it.


Offsite:

2.1 TortoiseGit requires git for Windows, which can be picked up on Googlecode;
2.2 myself TortoiseGit install from here

3. Denwer

Denver- A gentleman's kit for a Web developer (“Dn.w.r”, read “Denver”) - a project by Dmitry Koterov, a set of distributions (Apache, PHP, MySQL, Perl, etc.) and a software shell used by Web- developers to develop websites on a “home” (local) Windows machine.
Offsite:

3.1 Installation

We will need to download basic kit and additional PHP5 modules.

Lyrical digression:

no, not just download, but receive download links by email! That is, you will have to enter your email, as well as your first and last name, twice in the form under the large “Registration” heading. “Registration is required due to the future release of Denver 4.” For many years now the form has been apologizing, but I don’t believe it anymore(.

Usually, installing Denver is quick and painless, but on Windows8 I was attacked by an error that complained about a missing library msvcr71.dll. You can put the library in a folder "\Windows\System32\"(x32) or "\Windows\SysWOW64\"(x64). After the file is in the folder, open its properties and click the “Unlock” button.

3.2 Functional check

After installing Denver, we will create a test script, which will be used to check the functionality of everything that we will install later.
Let's go to Z:\home and add a new site: create a folder test.local, there is a folder in it "www", to which we add the file index.php with incredibly creative text:

";

Restart Denver, open in browser www.test.local, get impressed and move on

4. Memcached

Memcached- middleware that implements a data caching service in RAM based on the hash table paradigm.

Memcache- PHP extension, provides a convenient procedural and object-oriented interface to memcached, a highly efficient caching daemon that was specifically designed to reduce database load in dynamic web applications.

4.1 Installing memcached

A. download the archive with the binary: Memcached 1.4.5 for Windows from here
IN. \usr\local\memcached

4.2 Installing memcache

A. download the archive with the library from here
IN. unpack the contents of the archive into \usr\local\php5\ext\
WITH. open the file php.ini (\usr\local\php5\php.ini) and connect the extension:
extension=php_memcache.dll

4.3 Configuring the launch of Memcached along with the launch of Denwer

To run the script with Denver we need:
  1. write a script containing commands to start and stop the application/service and put it in a folder \denwer\scripts\init.d
  2. create a link to this script in the startup/stop configuration folder \denwer\scripts\main\

A. create a file named “memcached.pl” in the directory \denwer\scripts\init.d\
#!perl -w package Starters::Memcached; BEGIN ( unshift @INC, "../lib"; ) use StartManager; my $basedir = "/usr/local/memcached/"; chdir($basedir); StartManager::action $ARGV, start => sub ( ### ### START. ### print "Starting memcached\n"; system("memcached.exe -d"); print " Started!\n"; ), stop => sub ( ### ### STOP. ### print "Stopping memcached\n"; system("TASKKILL /F /IM memcached.exe"); print " Stopped!\n"; ); return 1 if caller;

B. Now let's create a link to the script - a regular text file containing instructions that when starting, restarting and stopping Denver, you must execute init.d/memcached.pl
We write in a text editor
init.d/memcached
and save the file under the name "40_memcached" to the following folders:

  • \denwer\scripts\main\start
  • \denwer\scripts\main\stop
  • \denwer\scripts\main\restart

4.4 Checking the result

We add to our test script (index.php):
$memcache = new Memcache; $memcache->connect("127.0.0.1", 11211); echo 'Memcache ver: ' . $memcache->getVersion();

Let's restart Denver and see what happens

5. Nginx

Nginx- a simple, fast and reliable server, not overloaded with functions.

Offsite:

5.1 Setting up Nginx

A. download the Windows version from the offsite and unpack it into \usr\local\nginx
B. setting up a virtual host for our test site. To do this we open \usr\local\nginx\conf\nginx.conf and add it there

Server ( listen 127.0.0.1:80; server_name www.test.local test.local; if ($host = "test.local")( rewrite ^/(.*)$ http://www.test.local$1 permanent ; ) location ~* \.(jpeg|jpg|gif|png|css|js|pdf|txt|tar)$ ( root Z:\home\/test.local\www; ) location / ( ssi on; proxy_pass http ://127.0.0.1:8080/; proxy_set_header X-REQUEST_URI $request_uri; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-for $remote_addr; proxy_set_header Host $host; proxy_connect_timeout 60; proxy_send_timeout 90; proxy_read_timeout 90; proxy_redirect off; proxy_set_header Connection close; proxy_pass_header Content-Type; proxy_pass_header Content-Disposition; proxy_pass_header Content-Length; root Z:\home\/test.local\www; ) )
This is an example of settings from a real project, your settings may obviously vary.

5.2 Setting up Apache

By default, Apache runs on port 80, but we just gave this port to Nginx, so now we need to change the template for the virtual host in the Apache settings and assign it a port other than 80 (for example, 8080).
Opening \usr\local\apache\conf\httpd.conf and change the port number

## ## START OF VIRTUAL HOST TEMPLATE. ## ## If you want Apache to run on a port other than 80 by default, ## change the port number in the next directive. ## #Listen $&(ip:-127.0.0.1):$&(port:-8080) #NameVirtualHost $&(ip:-127.0.0.1):$&(port:-8080) # # DocumentRootMatch "/home/(?!cgi-)(.*)^1/(?!cgi$|cgi-)(.*)" # DocumentRootMatch "/home/(?!cgi-)(.*)/ public_html^1" # DocumentRootMatch "/home/(?!cgi-)(.*)/public^1" # DocumentRootMatch "/home/(?!cgi-)(.*)^1/html/(.*) " # DocumentRootMatch "/home/(?!cgi-)(.*)^1/domains/(?!cgi$|cgi-)(.*)" # DocumentRootMatch "/var/www/html/(?!cgi -)~(.*)^1/(?!cgi$|cgi-)(.*)" # DocumentRoot "$&" # ServerName "%&/-www" # ServerAlias ​​"%&/-www" "% &/-www/www" $&(host:-) # # $&(directives:-) # # ScriptAlias ​​/cgi/ "$^1/cgi/" # ScriptAlias ​​/cgi-bin/ "$^1/cgi -bin/" # AllowEncodedSlashes on #

5.3 Configuring Nginx launch along with Denwer launch

A. create a file named “nginx.pl” in the directory \denwer\scripts\init.d\
#!perl -w package Starters::Nginx; BEGIN ( unshift @INC, "../lib"; ) use StartManager; my $basedir = "/usr/local/nginx/"; chdir($basedir); StartManager::action $ARGV, start => sub ( ### ### START. ### print "Starting Nginx\n"; system("start nginx.exe"); print " Started!\n"; ) , stop => sub ( ### ### STOP. ### print "Stopping Nginx\n"; system("nginx.exe -s stop"); print " Stopped!\n"; ); return 1 if caller;

B. write in a text editor
init.d/nginx
and save the file under the name "50_memcached" to the following folders:

  • \denwer\scripts\main\start
  • \denwer\scripts\main\stop
  • \denwer\scripts\main\restart

5.4 Checking the result

Place the file next to the script style.css with content
h1( color: red; ) h2( color: green; )

And we will ennoble our index.php:
Test me

Test me

Memcached

connect("127.0.0.1", 11211); echo "Memcached ver: " . $memcache->getVersion(); ?>
Now we restart Denver and admire the result. If the CSS file is connected, Nginx works fine.

6. MongoDB

MongoDB- a document-oriented database management system (DBMS) with open source code that does not require a description of the table schema.

Offsite:

6.1 PHP driver

A. Download the library php_mongo.dll from this site: and put it in the folder \usr\local\php5\ext\
Through trial and error, it was found that a suitable driver is contained in the archive mongo-1.2.5.zip/mongo-1.2.5-php5.3vc9ts.zip. If for some reason it doesn't start, try other versions.

B. connect the extension to php.ini
extension=php_mongo.dll

6.2 Installing Mongo

A. download the archive from Mongo and unpack it into a folder \usr\local\mongodb . In the same folder we create two more folders:

B. install the service
> cd C:\WebServers\usr\local\mongodb\bin\
> mongod.exe --install --dbpath=C:\WebServers\usr\local\mongodb\db\ --logpath=C:\WebServers\usr\local\mongodb\logs\

6.3 Setting up MongoDB to launch in conjunction with Denver

A. create a file with the name "mongod.pl" in the directory \denwer\scripts\init.d\
#!perl -w package Starters::mongoDB; BEGIN ( unshift @INC, "../lib"; ) use StartManager; StartManager::action $ARGV, start => sub ( ### ### START. ### print "Starting mongoDB\n"; system("net start mongoDB"); print " Started!\n"; ), stop => sub ( ### ### STOP. ### print "Stopping mongoDB\n"; system("net stop mongoDB"); print " Stopped!\n"; ); return 1 if caller;

B. write in a text editor
init.d/mongod
and save the file under the name "60_mongod" to folders already familiar to us:

  • \denwer\scripts\main\start
  • \denwer\scripts\main\stop
  • \denwer\scripts\main\restart

6.4 Checking the result

Let's launch the mongo console interface
> Z:\usr\local\mongodb\bin\mongo.exe

And we will insert and output the test value into the “test” database
> db.test.save(( name: “Habr!” ))
> db.test.find()

The result should look like this:

6.5. Installing the Mongo database management interface

There is a list and short reviews of admin panels on the MongoDB website, so you can choose according to your taste.
I chose RockMongo for myself, so with its help we will finally make sure that everything works for us and does not crash anywhere.

A. download the archive with the admin panel from this page. Naturally, we choose Windows version. At the time of writing this article RockMongo-on-Windows v0.0.4

B. take a folder from the archive \rockmongo-on-windows\web\rockmongo and copy it to the directory of our test site
Opening config.php and change the value of the parameter
$MONGO["servers"][$i]["control_auth"] = true;
on
$MONGO["servers"][$i]["control_auth"] = false;

C. Check the result using the link www.test.local/rockmongo/index.php

Congratulations! Now we are completely and irrevocably well done.

Bonus #1. Working with php from the Windows console

Perhaps it will be useful to someone. It came in handy for me when our evil tech lead decided that “SQL files are a thing of the past, let’s use migrations.” Of course, for the sake of decency, I tried to feign complete misunderstanding and even shed a tear, but I was exposed and sent to figure out how it works on Windows.
It turned out that all you need for happiness is add PHP directory to PATH.


Click on “Edit” and add to the end of the line
;Z:\usr\local\php5

Now let's check that everything worked.
Let's create a file in the directory of the test site console.php

Open the console(you can directly from the same folder - right-click with SHIFT pressed on an empty space and select “Open command window”).
Enter:
> php console.php “UserName”

The console responds:
> “Hello, UserName!”

PHP is defeated, general rejoicing, applause, curtain.

Bonus #2.

All files and examples mentioned in the article in one archive for free without SMS: on Github

I hope that this material will be useful.
I would be grateful for comments and suggestions.

Tags:

  • denwer
  • local server
Add tags

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 monetary and resource terms) 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.

Apparently, many users of computer systems of any type know that you can create a local server on your computer yourself in a matter of minutes. True, not everyone has a clear understanding of the basic methodology for carrying out all the steps. So let's try to give at least partial information on how to create a local server and adapt it to your own needs.

The concept of a local server

In general, initially you need to clearly differentiate the local servers being created by type. In addition to the most commonly used web servers, you can create and configure game servers, proxies, and even DNS servers yourself. Everything depends only on what specific function will be assigned to one or another component.

However, in most cases, all these components have one thing in common: they are created initially on local machines in the first stages without being placed on a remote hosting, which allows them to be configured and edited directly on their own computer terminals.

Now we will try to consider questions regarding how to create and configure a local server on a computer, depending on its type and purpose

Software selection

In principle, the choice of software is a personal matter for each user. It is worth noting here that if, for example, when creating a local web server, only hypertext markup languages ​​like HTML or CSS are used, there is no point in installing additional software packages, since any Internet browser “understands” them perfectly.

It’s another matter when scripts written, say, in PHP act as additional components. Once you use them, the browser can no longer cope. This is where specialized software comes in handy. As for proxies, DNS and game servers, the situation here is also ambiguous. Somewhat later we will look at the simplest applications for creating and configuring them, but for now let’s focus on the main issue concerning standard local web servers.

How to create a local server: installing and configuring the Denwer package

If you decide to start creating a local server for subsequent hosting on a remote hosting, naturally, you will need some kind of tool. Most often, when searching for appropriate software on the Internet, users are redirected to download the Denwer software package, which is a domestic product and is also quite simple to understand and work with.

It contains all the necessary tools like Apache, PHP, MySQL, phpMyAdmin, sendmail, etc. The only drawback is that you will additionally have to install special engines, like in the simplest version.

So, creating a local server begins with launching the installation EXE file (naturally, as Administrator). A window similar to DOS mode appears. Follow the installer's instructions. First, we select the storage location for the server data, then we assign the letter and operating mode of the virtual disk (in principle, the proposed parameters do not need to be changed). This completes the installation. Now the local server needs to be checked for correct functioning.

Performance Testing

At this stage, we launch the created server, and enter http://localhost in the window of any Internet browser. If the program is installed without errors, the browser will display a message stating that everything is working.

If you scroll down the page, you will see the main links where you can conduct a full test of the local server.

Encoding issues

Sometimes you can encounter an unpleasant situation when the sent email message looks like a set of incomprehensible characters. This only happens because the program is initially designed for UTF-8 encoding. It can be changed quite simply, for example, to KOI-8R or something else.

Installing a local server: additional engines

Now another important point. A local Windows server cannot do without special add-ons called engines (WordPress, Joomla, etc.).

First, in the www folder, located along the path \home\local host, in the main directory, create an arbitrary directory. After that, enter the path http://localhost/ in the address bar of the browser and check what exactly opens. If it opened everything is fine. Copy the engine files to this directory using any file manager (at least Explorer) and enter the address again. The Installation Wizard window appears, where you just need to follow the instructions.

Database addition

Now the local server must attach the special databases. For this purpose, the phpMyAdmin service is used, which is entered by entering http://localhost/tools in the browser address bar. First, the section for creating a new database is selected, and a name is given to it (any name is possible, but it is better to indicate the same one that was used for the folder in the previous section).

Then we return to the main page and configure the privilege settings (create a new user, specify the login and password, use localhost as the host and tick everything that is in the window). All you have to do is press the “Go!” button. and wait for the process to complete.

Transferring a local server to hosting

The next step is to connect the server to the local network and transfer it to hosting so that it becomes available to users on the Internet. The “native” method of transferring data to a remote resource does not look very convenient due to many additional steps.

Setting up a local server in terms of transferring data to remote hosting is best done with the FileZilla application, with which you need to copy the files located in the above directory to the root directory of the host. This is either the PUBLIC_HTML folder or the HTTPCS section. Now it’s a small matter: we change the so-called absolute paths to folders and files and directories in the engine settings, indicate the name of the database that is supposed to be created and used on the remote host, and specify a new login and password for the host. All. This completes the work. Connection to the local server of user machines can be made through any Internet browser.

Local proxy servers

Now let's see how to create and configure a local proxy server. What is it for? Firstly, it can be used to track absolutely everything that is downloaded to a computer terminal or laptop while surfing the Internet. And secondly, this way you can save traffic if it is paid.

A local proxy server works on the principle of caching calls to DNS servers and stores, say, pictures or any other objects, and when you visit a resource again, it loads them from its memory, so to speak, speeding up access to the resource.

To create a server of this type, you will need a simple HandyCache application, which should be placed in a convenient place for quick access, since each time you connect to the Internet you will have to access it.

Before you begin, you should configure your proxy settings. For example, if you are using the Opera browser, in the server settings for HTTP you need to specify the value 127.0.0.1, 8080 for the port. Now we launch the application, go to the settings and look at the “Dialing” tab. As a rule, the program itself determines what type of connection is currently being used. Next, click the button of the same name and use the created server.

Yes, please note: in the cache settings you can specify a size of about 300 MB. In theory, this should be enough for all occasions. You can view the contents in the Cache folder of the main directory where the program was installed. And one more thing: remember, this is a regular proxy server, not an anonymous one, so you shouldn’t expect it to change or hide the IP address.

Local DNS servers

A local DNS server can be used in cases where the connection is unstable, the local network has too many branches based on TCP/IP, or you are engaged in web development and testing. In principle, the BIND program is perfect for such purposes. Although it is designed mainly for UNIX-like systems, it nevertheless works perfectly with Windows (we assume that the terminal does not have a server version of Windows installed, which can be configured in the Control Panel).

Launch and follow the instructions. For convenience, it is recommended to install the program directly on drive C, in the created BIND directory. Next, enter your username and password, after which we activate the installation process and wait for it to complete.

Now in the C:\BINDetc folder you need to create a file “name”.conf, which contains the settings that the local DNS server will use (the name is arbitrary and is specified without quotes). In order not to waste time, you can easily find the file you are looking for on the Internet and download it, placing it in the specified location.

Now we reboot the system, then call the command line (cmd through the Run menu or the Win + R combination), where we enter the nslookup request. If confirmation occurs, it means that the server is installed correctly and is working without errors.

Local game servers

Finally, let's look at another type of server. server for games that use online mode within a local network. Let us explain what this is using the example of the game Minecraft. To do this, you need to download the server itself from the official website of the game and use the Hamachi application. A prerequisite for correct operation is the presence of the JAVA package installed on the system with the latest updates.

To configure, we use the server.properties file, where we enter the data provided by the Hamachi application. We register the server IP address, the number of players, the use of possible game modes, etc. In the online-mode field, you must specify the value true. After that, save the changes and close the file.

Now we define the internal IP of the server, which will be used by players when connecting to the terminal on which it was created. Computers, of course, must be connected to the server itself either through a local network or via a VPN. The IP address of the server terminal must be static and must be bound to the MAC address.

Login is carried out using the Minl2 application, where you specify your login and password during registration. After these steps, we leave the server and log in again, but in offline mode using the created login and password. In the settings section, select Multiplayer and enter the required server IP. All. You can enjoy the game with a real opponent.

Conclusion

Of course, these are not all the nuances that may arise when creating local servers of various types, and, of course, not all the programs that help in this process. Let's put it this way: these are the general and basic principles embedded in such technologies. And if you look at it, there is nothing particularly complicated here. A little time and patience - and a local server of any type will be created within 10-15 minutes.

A modern website is not just a set of HTML documents, but also includes many technologies, including server ones, such as: SSI (Server-Side Includes), PHP (PHP: Hypertext Preprocessor, PHP: preprocessor hypertext), databases and much more. To familiarize yourself with and study these technologies, it would be a mistake to use a visited work site on the Internet, so it makes sense to install the necessary set of programs on your local computer and test everything on it.

The most popular combination of such programs is the Apache web server, the PHP programming language, the MySQL database management system, the PhpMyAdmin database administration shell, and the Smarty template engine.

These programs work primarily under Linux-like systems, but there are also versions for Windows. The main advantage of this bundle of programs is its versatility. A site created and tested on a local Windows computer can easily be transferred to a server running FreeBSD. In addition, this set is supported by the vast majority of hosters.

In the future, we will consider programs for a home computer with the Windows operating system.

Let us briefly describe what the technologies that will be used to create the site are.

Web server

A web server is a program that analyzes incoming requests and generates ready-made documents sent to the user. Apache is often used as a web server, as it is the most established and popular on the Internet. According to various estimates, its share is almost 50% of the total number of web servers in use.

PHP

A popular programming language used in website development.

MySQL

Database management system.

PhpMyAdmin

Web interface for creating and managing MySQL databases. Allows you to view tables, change their contents, modify the structure, select data, and sort information. All actions are carried out directly in the browser, in a user-friendly interface specially designed for it.

Smarty

Powerful template system for PHP. Uses its own language that combines HTML and special Smarty tags. Templates are needed to separate program code and document presentation or, in other words, to separate logic from content.

All of these programs and technologies are open source, can be downloaded and used freely.

You can install the necessary programs by downloading them from the manufacturer’s website and customizing them to suit your needs. However, this sometimes requires familiarity with the program and possession of the necessary qualifications, which beginners do not have. Since we are not talking about a full-fledged working server, but about a computer for testing and debugging, it makes sense to use ready-made kits. This kit contains all the programs necessary for a web developer and is easy to configure and manage. Next we will talk about some popular web development kits.

To develop and test websites or web applications, they usually use a local Web server, and after development they transfer it to a production server. Therefore, today I propose to consider the possibility of installing a local web server on the Windows 7 operating system, and since we have a site for beginner developers, we will use a ready-made web server assembly using an example XAMPP.

And we will start with the basics, i.e. We will find out what a web server assembly is, what it consists of, why it is needed, in particular, we will analyze the XAMPP assembly, install it and, of course, check its operation.

What is a Web server build?

Building a Web Server– this is a certain set of applications necessary for the functioning of sites, after deployment of which you can immediately proceed to their development, without being distracted and without delving into the settings of each component of the web server.

A web server assembly usually includes at least 3 components: the HTTP server itself, a website development tool, i.e. programming language libraries, interpreter, etc., and a database management system. For such assemblies, free software is used, so the most common components are the Apache web server, MySQL DBMS, PHP and Perl programming languages.

If we talk about why such an assembly is needed at all, since you yourself understand that all this is installed and configured separately, then it is needed mainly to make life easier for novice developers, so that they can simply install one program and immediately start, say, learning to program (create websites). For example, we will use Windows 7 as the operating system of our local web server, since it is the Windows OS from Microsoft that is widely used in Russia.

Of course, after the development of a site or web application is completed, it is necessary to transfer everything to a production server, which will most likely use a Linux-based operating system. For example, you and I have already considered the possibility of installing and configuring a full-fledged, working web server on CentOS 7.1, where we separately installed and configured each of the web server components; there we used Apache, PHP and MySQL. Also, if anyone is interested in installing the MySQL DBMS on Windows, we have discussed this in detail here.

Note! It is not recommended to use a web server assembly on production hosting for websites, especially since the developers themselves warn that these assemblies are not intended for implementation in production.

The most popular web server builds include: Denwer, Open Server, XAMPP, WampServer. As the title of the article suggests, today we will be looking at XAMPP.

What is XAMPP?

XAMPP is a free, cross-platform web server build that includes Apache, MySQL PHP and Perl.

As you might guess, XAMPP is an abbreviation:

  • X – means the assembly is available for all operating systems (Windows, Linux, OS X);
  • A - Apache;
  • M – MySQL;
  • P – PHP;
  • P - Perl.

Lastly, for today ( June 2015), the XAMPP build for Windows includes the following software: Apache 2.4.12, MySQL 5.6.24, PHP 5.6.8, phpMyAdmin 4.3.11, OpenSSL 1.0.1, XAMPP Control Panel 3.2.1, Webalizer 2.23-04, Mercury Mail Transport System 4.63, FileZilla FTP Server 0.9.41, Tomcat 7.0.56 (with mod_proxy_ajp as connector), Strawberry Perl 7.0.56 Portable.

Where to download XAMPP?

You can download this assembly from the download page of the official website - https://www.apachefriends.org/ru/download.html

And since we will install XAMPP on Windows, we will accordingly download the distribution kit for this operating system, for example, I want to download the XAMPP version with PHP 5.6.8 for this, and click the corresponding link.


After which we will download a distribution kit of 107 megabytes in size.

This assembly supports Windows operating systems starting with Vista.

Installing XAMPP

Let's start installing the XAMPP Web server assembly, it is simple, so there should be no problems.

Step 1

Run the downloaded file xampp-win32-5.6.8-0-VC11-installer.exe. The first window of the installation program is the welcome window, click “ Next».


Step 2

Next, select the components that need to be installed, by default everything is selected, but if you do not want to install something, i.e. You don’t need this, then you can uncheck the corresponding item, for example, I don’t need Perl, click "Next".


Step 3

Then select the directory in which we will install XAMPP, I will leave it as default, click “ Next».


Step 4

At this step we can leave or uncheck the " Learn more about Bitnami for XAMPP", I unchecked the box, click " Next».


Step 5

Everything is ready for installation, click “ Next».


The installation has started.


After the installation is complete, we will be prompted to immediately run “ Control Panel", click " Finish».


That's all, we have launched the XAMPP control panel.


Launch and check the operation of Apache, PHP and MySQL

As we can see, immediately after installation all services are not running, so we start them with the “ Start».


Those services that are currently running are highlighted in green.

First, let's check the operation of Apache, to do this we simply type localhost in the browser, and if we see the following picture, then everything is in order.


To test MySQL and PHP, let's write a simple PHP script that will test the connection to the MySQL database. To do this, create a test folder in the C:\xampp\htdocs\ directory; by the way, everything that is in the htdocs folder can be deleted. In the test folder, create a file index.php with the following code;

Database server unavailable

"; exit(); ) //Checking database availability if (!@mysql_select_db($dbname,$dbconn))( echo "

Database unavailable

"; exit(); ) //Simple query, find out the MySQL version $VERSION = mysql_query("SELECT VERSION()"); if(!$VERSION)( echo "

Error in request

"; exit(); ) echo mysql_result($VERSION, 0); ?>

We save and in the browser access the address http://localhost/test/ in response we should receive the MySQL version.


If you were surprised by this, it means that Apache and PHP and MySQL are up and running.

Now I’ll tell you a little about the XAMPP control panel. You can launch it through the menu “Start->All Programs->XAMPP”.


After launch, an icon for quick control will appear in the system tray, i.e. starting and stopping services.

I propose to end here, since everything is ready for developing websites based on Apache, MySQL and PHP. I would like to note once again that this assembly is suitable exclusively for developing and testing web applications; it is not recommended to use it as a working platform for websites. Good luck!

New on the site

>

Most popular