Hardware and software setup

How to install and configure a local server on your PC. Setting up Nginx launch along with Denwer launch

12/25/13 39.4K

A web server is a program that runs on a local or remote machine, and its main purpose is to allow the user to view web documents. When a website address is entered in the address bar, when the Enter key is pressed, the browser generates a request directed to remote computer- web server.

Apache HTTP server (short for English a patchy server) is one of the most popular and widespread programs created for web developers and administrators of Internet resources. According to independent researchers, Apache is installed on 50% of the computers of all users of HTTP servers.

The main advantages of Apache are stability, speed and flexibility, and they are due to the modular organization, as well as the fact that the development is carried out by an open group of programmers, albeit under the official name Apache Software Foundation.

Apache supports a huge number of operating systems and hardware platforms, and is quite often used under an operating system. Windows systems. It is also important that this web-server is distributed completely free of charge.

How to install the Apache server for the Windows 7 operating system will be discussed in this article.

Installing Apache

First of all, you need to download the latest version of the Apache distribution without SSL support and run the installation. In the welcome window, you need to click on " Next", read the developer's license agreement and confirm your agreement with it.


Then, in the installation window, you need to fill in the fields as shown in the picture below, and in the field " Administrator's Email Address» indicate the address of your Email, click " Next"And set the switch to the" Custom».

Next, move on to the next step of the Apache installation process. By default, the web server installs to the folder C:Program FilesApache Software FoundationApache 2.2.
Next, you need to create a www directory on drive C and specify it as the installation folder for Apache, click " Next" in this and " Install" in the next window. When the installation is complete, click on " Finish".

If everything went well, the Apache web server control icon should appear in the tray. You can stop and restart it by clicking on the icon with the left mouse button.


Clicking on the same icon right click mouse, you can navigate to various operating system system services or open the Apache monitor.
In order to check if the installed Apache server is running, type in the address bar of your browser http://localhost
If a page appeared with the inspiring inscription “It works! ”, then Apache was installed successfully and is functioning correctly.

Basic web server setup

Although Apache is very convenient and extremely reliable, not everyone is ready to use it as local server for a number of reasons, and the main one is the absence even in the environment Microsoft Windows some graphical configurator, which is quite unusual for most users.

The server is configured using manual editing configuration file httpd.conf . However, contrary to notions of incomprehensibility and complexity this process, there is nothing complicated in this operation for two reasons: firstly, in order to make a server that is configured for acceptable and comfortable operation from a newly installed Apache server, you need to change quite a bit of data in the configuration file, and secondly, comments httpd.conf contains quite a few useful information needed to get to grips with the setup.

What is necessary?

  • Run Apache under Windows 7 platform;
  • Store files of the future site in a user-friendly directory (for example, C: www);
  • Do not experience problems with encoding, and in particular - with the display of Cyrillic;
  • Ability to work with several sites at the same time.

To successfully solve these problems, go to the Apache installation folder, find and open the httpd.conf file in the conf subfolder. Please note that the lines that begin with a hash sign are text comments, and the web server settings are lines that do not start with a hash symbol.

First you need to configure the directory that will be used by the server as a website folder. Find the line in the text that starts with DocumentRoot . This directive determines which folder will be the root.

Change it to DocumentRoot "C:/www". It should be clarified that the slashes in this file should be slashed to the right, and not to the left, as you are probably already used to Windows users. After the above manipulations, the problem with the location of your site is solved.

Options (determines which server functions will be available) AllowOverride (determines which directives from .htaccess can override those in httpd.conf) Order (sets certain rules for accessing the server)

List of used parameters:

options. The following options are possible:

  • Includes - use of SSI is allowed;
  • IncludesNOEXEC – SSI usage is allowed with restrictions (#include and #exec are not allowed);
  • Indexes – the use of index files is allowed, and if the URL points to a site directory (for example, www.domain.ru/dir/ ) in which there is no index file, the contents of this directory will be displayed, and if this option is not present, a notification will be issued that access is denied;
  • ExecCGI - execution of CGI scripts is allowed;
  • FollowSymLinks - the server follows the available symbolic links directories (used on Unix systems);
  • SymLinksIfOwnerMatch - the server follows the existing symbolic links of the directory only if the target file has the same owner with the link;
  • All - all of the above together are allowed;
  • None - all of the above together is prohibited;
  • MultiViews - the ability to select specific content and display it depending on the preferences of the browser (even if everything is enabled (Options All. Specified separately).

AllowOverride. Options:

  • AuthConfig - allows you to use directives for authorization;
  • FileInfo - allows the use of directives to work with various types documents;
  • Indexes - allows the use of directives for working with indexing files;
  • Limit - allows the use of directives to determine access to the host;
  • Options - allows the use of directives to work with certain specific directory functions;
  • All - all of the above together;
  • None - none of the above together.

order. Options:

  • Deny, Allow - Deny is defined before the Allow directive, access is allowed by default, except for the hosts that are specified in the line following Deny from;
  • Allow,Deny - Allow is defined before the Deny directive, access is denied by default, except for hosts that are specified in the line following Allow from;
  • Mutual-failure - only hosts that are not in Deny and are in Allow are allowed access.

Based on the above, try setting up your server. In the httpd.conf file, the Directory directive by default exists in two instances at once - and . The first option should not be touched, so in the second, set the parameters as follows:

Options Indexes FollowSymLinks AllowOverride None Order allow, deny Allow from all

In other words, the following options are selected for the C:/www folder and all its subfolders:

  • Of the possible functionality of the existing server, indexes in directories and symbolic links are allowed;
  • The possibility of parametric overriding using .htaccess files is completely absent, however, given that you have full access to the server, it is not up-to-date - everything can be configured via httpd.conf;
  • Access to the web server is allowed from all hosts.

Now, save the httpd.conf file and restart Apache using the Apache Monitor or the apache –k restart command on the command line. Setting up the site root folder is now complete.

You should check if you did everything right. Create a simple web page in the C:www folder, open your browser and type http://127.0.0.1/your_created_page. Pages should open. Otherwise, you must carefully check all changes in the httpd.conf file for correctness.

If the page opened successfully, there is a chance that instead of Cyrillic characters you will see unreadable characters. They appear for two reasons. First, the web server provides your browser that requested the page with a default encoding. Secondly, oddly enough, this encoding is not Cyrillic.

If notorious Internet Explorer in such cases determines the encoding from the page itself, then, for example, Mozilla Firefox and Opera have absolutely no inclination for such actions, and the way of setting the encoding in the browser manually can hardly be called convenient. Therefore, you need to configure Apache to provide the required encoding by default.

Look in the httpd.conf file for the line that starts with AddDefaultCharset . Most likely, the ISO-8859-1 encoding is indicated there, in which there are no Cyrillic characters. Change ISO-8859-1 to windows-1251 , save the file and restart Apache. Now the correct display of the Russian language on your site will work in any browser.

In the Apache server, it is quite simple to set up work with several sites. The addresses that can be used for them are 127.0.0.2, 127.0.0.3, etc. In this case, only the one that is the default site (127.0.0.1) will be visible over the network, however, for local work it is not critical. The section of the httpd.conf file that configures everything you need to do this is at the very end and is called VirtualHosts .

To add an additional site, create a directory that is used as its root, for example C:www2 . Assuming the site will respond to 127.0.0.2 , name it site911 and add the following lines at the very end of the VirtualHosts section:

ServerAdmin [email protected] ServerName site911 DocumentRoot "C:/www2" ScriptAlias ​​/cgi/ "C:/www2/cgi/" ErrorLog "C:/www2/error.log" CustomLog "C:/www2/custom.log" common

Restart the Apache server. Typing 127.0.0.1 in your browser's address bar will take you to your first local site, and typing 127.0.0.2 will take you to your second local site. It should be borne in mind that absolutely any directives of the web host can be used inside each VirtualHosts container. Apache server, thanks to which you can customize each site in the most detailed way.

Outcome

Installation and configuration is complete, and now you can fully begin to study the operation of the Apache server in practice.

If you decide to come to grips with the administration of websites, your next step should be to study the Apache bundle PHP MySQL, because without a database management system, as well as without support for one of the most common web programming languages ​​and a web tool for administering the MySQL system, not a single server in the vast world wide web. As they say, " hard to learn but easy to fight».

We wish you good luck in studying this difficult, but interesting business!

Good bad

Due to the fact that my blog is absolutely devoid of any chronology, I decided to fix it. The next series of articles will be devoted to creating your site.
In this article, we'll look at: what is a local server, where to download it, how to install, how to setup, how to make a local server available on the internet.

What is a local server?

local serversoftware, which allows you to debug the site on a local (home) computer, without access to the Internet. The local server completely imitates the work of hosting and has a similar functionality.

Those who have been building sites using only html and css know that there is no need for a local server, since the browser perfectly processes and understands the language hypertext markup and cascading style sheets. But, it is worth adding some PHP script and you will immediately get embarrassed - the browser will not display the result of PHP work. And this happens because browsers do not understand PHP. And in order for the user to see the site page in the form in which this page should be, it is necessary that the server processes and converts the PHP code into html.

All CMS a la WordPress and Joomla contain PHP scripts. Accordingly, in order for sites created using content management systems to be able to work on home computer, a local server is required.

My site was created using WordPress, I constantly have to test some plugins, extensions, dig into the PHP code. It is quite logical that sooner or later, such actions can lead to the loss of site performance due to a mistake. Of course, most hosting supports restoration (backup) of the site and database. Yes, and competent webmasters keep, just in case, a spare on their computer. I'm generally paranoid, in addition to hosting and my computer, I also wrote it down on a USB flash drive. Will have to go somewhere else cloud service throw =).

And don't forget that not all plugin developers take care of the correct deletion of their products, and often, even after deleting a product, you can see traces of a plugin that has not been completely deleted in the database. And the longer the site lives, the more such rubbish will hang in the database.

As a matter of fact, with the listed tasks and problems (and not only) the local server will help to cope.

How to create a local server?

In fact, you don’t need to create a server, everything has already been created, just download and install a ready-made set necessary components. We will consider installation and configuration of one of the popular local servers below.

How to install a local server?

One of the most popular and stable local servers - Denver. The name stands for: gentleman's set web developer - D. n. v. R. We will consider its installation.

Basic package contains:

  • Installer.
  • Apache server.
  • PHP5.
  • MySQL5 supporting transaction.
  • phpMyAdmin - system MySQL management, which allows you to work with databases through a browser.
  • Sendmail and SMTP server emulator - emulates the function of sending mail. All sent emails will be located in the Z:\tmp\!sendmail directory in .eml format, and will not be sent to the specified email.

One of the advantages is that the server can be installed on a flash drive. And wherever you are, you can work on your projects.

And, of course, the most important plus - Denwer is absolutely free.

Denver installation

    1. Run the downloaded file and agree to install the base package.

    2. Then, a browser window will open, which must be closed to continue or cancel the installation.
    3. To continue the installation, press Enter.

    4. Then, you need to specify the directory in which the files will be located. Default: C:\WebServers. Feel free to press Enter and continue.

    5. Following the instructions, press Enter.
    6. Next, the installer will prompt you to select a virtual drive letter. By default, the letter Z is offered. If there is no disk with that name on the computer, then you can safely continue the installation by pressing Enter, if there is, then select another one.

    7. After all the distribution files have been copied, you will be offered a choice of 2 options for creating a virtual disk:
    1. Create a virtual disk when you turn on the computer.
    2. Create a virtual disk only when explicitly called, that is, when clicking the start shortcut on the desktop (I chose this option).

That's actually all, this Denver installation is over.

Now you can test the local server. If everything is done correctly, then 3 shortcuts will appear on the desktop: Start Denwer, Stop Denwer, Restart Denwer.

Click Start Denwer to launch. If you go to my computer, you can see that the selected local disk. And in the tray (near the clock) there will be 2 icons in the form of a hat and a feather.

Open a browser window and address bar enter the following: http://localhost/

A window will open with the message: "Hurrah, it worked!", symbolizing that everything is done correctly and you can safely start working with the local server.

The page that opens contains a lot of useful information:

  1. You can find the necessary documentation for PHP, MySQL, Apache, Perl, PostgreSQL using the appropriate search.
  2. Since Denver is free software, the creators accept donations from grateful users to support the project. Well, I noticed affiliate link to Gino hosting.
  3. You can check the operation of the components by clicking on the following links:

subdomain.localhost/ssl.php - check if SSL is active.

subdomain.localhost/ - check "non-Internet" second-level domains, as well as SSI

test1.ru/ - checking second-level domains.

subdomain.test1.ru/ - checking subdomains (subdomains)

localhost/Tests/phpnotice/index.php - You can test the PHP Notice hook.

localhost/Tests/PHP5/index.php5 - PHP 5 information.

localhost/Tools/phpMyAdmin - Access to phpMyAdmin and MySQL.

custom-host:8648 - check a host with a different IP address and port (127.0.0.2:8648)

localhost/Tests/sendmail/index.php - check the work of sendmail (sending mail).

Site in Denver displayed in hieroglyphs

The problem with hieroglyphs sometimes happens if utf-8 encoding is used. In Opera and Chrome, instead of my text, terrible rock inscriptions were displayed. And Internet Explorer, oddly enough, showed everything as it should. But be that as it may, the problem must be solved. And you can do it in the following way:

Create an .htaccess file in the root directory of the site (in the www folder) and write the following there: AddDefaultCharset UTF-8

If the file already exists, then just add this line there.

How to uninstall Denver?

Uninstall through the control panel - Denver programs cannot be uninstalled, since it does not write files to the Windows directory and does not leave entries in the registry, so an uninstaller is not needed. Therefore, we simply delete the folder with the local server files (having previously stopped Denver using a shortcut on the desktop): C:\WebServers, delete the shortcuts from the desktop and from Startup.

How to make a local Denwer server available on the Internet.

First of all, it is worth understanding that Denver is intended for local use. And the developers warn that by making a local site visible on the Internet, you can expose the local machine to the danger of being hacked, since Denwer is not a reliable and full-fledged server.

Denver runs with administrator rights, so unfinished scripts can pose a potential danger, namely, open a "hole" through which a hacker can harm the computer.

If you are a competent administrator and fully understand what you are doing, then in order to open access to the local site, you should:

  1. First of all, you need to have a static ip address. Dynamic IPs will change when the machine (router) is rebooted.
  2. Windows has a built-in antivirus - a firewall that blocks access from external computers. In order to make the local site accessible, this blocking must be disabled in Start - Windows Firewall. It should be understood that this will also reduce the protection of the computer.
  3. Well, the last thing to do is to create on virtual disk Denver hierarchical structure from folders: /home/192.168.0.1/www

Instead of the ip address specified in the previous paragraph, you must specify your own, issued by your Internet provider.

If the provider provides, in addition to the IP address, also a domain attached to it, then the site will be accessible via it.

In the next article, we will look at installing WordPress on a local server.

HAPPY NEW YEAR 2014 ALL!!!

Last update: 10/20/2017

Download the Apache web server package from http://www.apachelounge.com/ . Let's choose the latest version of the server. On the downloads page, we can find two versions of the Apache package - for 64-bit systems and for 32-bit ones.

Before installing Apache, it should be noted that if our OS is Windows, then the package for C ++ must be installed on the system, which can be found at the address for 64-bit and for 32-bit .

After downloading the Apache package, unpack the downloaded archive. In it we will find the folder directly with the web server files - the Apache24 directory. Let's move this directory to drive C so that the full path to the directory is C:/Apache24 .

Now we need to install Apache as windows services. To do this, run the command Windows line as administrator and go to the web server directory with the command

httpd.exe -k install

If the installation completes successfully, then command line will display the message "The Apache2.4 service is successfully installed". The server will also be tested:

In my case, as shown in the picture above, Apache could not connect to port 80, which is the default in the configuration, since my port 80 is listening on another web server - IIS. This is one of the common problems when starting Apache. To solve it, we need to either disable the IIS service, or specify for Apache new port. I will choose the second way.

After installation, we will configure the server to connect it with the previously installed PHP interpreter. To do this, in the folder c:\apache24\conf find the httpd.conf file and open it in a text editor.

The httpd.conf file configures the behavior of the web server. We won't touch on its descriptions in the same way, but only make minor changes that we need to work with PHP.

First, find the line

Listen 80

This string indicates the port being listened on. The default is port 80. If there are no conflicts with ports, you can leave it as it is. I will change the port to 8080.

#ServerName www.example.com:80

and change to

ServerName localhost:8080

Now let's connect PHP. To do this, find the end of the module loading block in the httpd.conf file LoadModule

//...................... #LoadModule watchdog_module modules/mod_watchdog.so #LoadModule xml2enc_module modules/mod_xml2enc.so

And at the end of this block add the lines

LoadModule php7_module "C:/php/php7apache2_4.dll" PHPIniDir "C:/php"

DocumentRoot "c:/Apache24/htdocs"

By default, the directory "c:/Apache24/htdocs" is used as the document repository. Let's replace this line with the following:

DocumentRoot "c:/localhost"

Let's change the paths to files that will contain information about errors or site visits. To do this, find the line

ErrorLog "logs/error.log"

And replace it with

ErrorLog "c:/localhost/error.log"

CustomLog "logs/access.log" common

And replace it with

CustomLog "c:/localhost/access.log" common

And also find the block and add two lines to it:

AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps

And at the end we will find a block :

DirectoryIndex index.html

And replace it with the following:

DirectoryIndex index.html index.htm index.shtml index.php

This is the minimum required configuration required to work with PHP. To manage the server (start, stop, restart), we can use the utility that comes with the kit - . This utility can be found in the C:\Apache24\bin directory

Let's run the utility. The ApacheMonitor icon will appear in the tray. Click on it and in the appeared context menu select the Start item.

If we have everything configured correctly, then the web server should start.

Now our task is to make sure that php is connected and working correctly. To do this, let's go to the c:/localhost folder, which we created to store documents, and add the usual text file. Rename it to index.php and add the following content to it:

In this case, we have created a simple script that outputs general information about PHP. Now let's turn to this script by typing the address in the browser line http://localhost:8080/index.php

What happened here? When accessing the site on the local machine, http://localhost is specified as the address. Since we specified 8080 as port, the port is also indicated in the address through a colon. If we used the 80th port, which is used by default, then it should not have been specified.

Then the name of the resource being accessed is indicated. In this case, the index.php file is used as a resource. And since the httpd.conf file specifies the directory c:\localhost, then it is in this directory that the web server will search for the necessary files.

And since we indicated above when configuring that as home page file can be used index.php, then we can also refer to this resource simply http://localhost:8080/

This completes the installation and configuration of the Apache web server, and we can create our sites.

). Someone will immediately start screaming about the ease and freeness of Linux, and I will not argue, but I like this OS. It is reliable and easy to administer. In my subjective opinion, she has one drawback - the price. In addition, I do not claim that the server configuration for hosting presented below is the best and most convenient. I will simply describe the sequence of actions that I took to get my site up and running. So:

1. What will be required

  1. An Internet-connected, constantly running computer Windows control Server 2008 R2 (How to install Windows Server 2008 I wrote).
  2. Dedicated IP address on the current connection.
  3. Registered Domain name(You can read about how to do this).
  4. The domain name must be tied to the current dedicated IP (And I also wrote about this)

2. Starting the IIS Web Server

First, we need to add the Web server role to our server. In Windows Server 2008, this role is called Internet Information Services or IIS. To add, go to Start» — « Administration» — « Dispatcher server". Expand the tab " Roles» and press « Add roles» .

Will start " Add Role Wizard", press" Further” and select “ Web server (IIS)» .

Press 2 times " Further” and get to the page for selecting role services. In addition to the services already noted, we note " ASP.NET», « .NET extensibility», « CGL», « ISAPI Extensions», « ISAPI Filters", press" Further" and " Install» .

After the installation was completed, the Roles tab appeared " Web server (IIS)", which contains " IIS Manager” (It is also available through “ Start» — « Administration» — « IIS Manager»)

In the manager, we see our server, and the tab " sites', by default containing ' Default Web Site". This site consists of the IIS welcome page. We can view it by opening Internet Explorer and entering http://localhost in the address bar.

You can immediately delete this page by clicking on " IIS Manager» right-click on it and select « Delete» .

This completes the preparation of the operating system. Next, you need to install PHP and MySQL.

3. Install PHP

We need to implement PHP language support. To do this, you need to install and run the appropriate service. Download the php server installer from http://windows.php.net/download/. At the time of writing, the current version was 5.3.6 . After downloading, install the PHP server, following the instructions of the installer without changing the settings and selecting the mode " IISFastCGI» . More about PHP installations can be read in the article "".

Now you need a PHP plugin Manager for IIS to manage PHP from within IIS Manager. Download it here: http://phpmanager.codeplex.com/releases/view/69115 . After downloading, install it following the instructions of the installer. If everything is done correctly, the IIS Manager snap-in should appear. PHP Administrator»

Run it and click on " Register new version PHP”, specifying the path to executable file php and click " OK»

That's all, this completes the PHP registration.

4. Installing MySQL

We will use free MySQL to store the database. Download the installer on the official page http://www.mysql.com/downloads/installer/ . Latest version at the time of writing 5.5.13 . After downloading, run the installation, agree with license agreement, select the mode " Typical» and press « Install". After the installation is complete, leave a checkmark " Launch the MySQL Instance Configuration Wizard» and press « Finish».

The above wizard will start. Press " Next” and select the mode “ Standard Configuration».

Press " Next' without changing anything again ' Next"and enter the password for account root. I advise you to immediately write down the password on a piece of paper. As the saying goes, a dull pencil is better than a sharp memory. And it's best to use special ones. Press again " Next" and " Execute". If everything went well, then we should see the following:

Click " Finish". Installation completed.
To manage MySQL I use a simple free utility HeidiSQL, which can be downloaded from http://www.heidisql.com/download.php . At the time of writing, the latest version was 6.0 . After installing the program, following the instructions of the installer and running it, we will see the window " session manager”, where you need to add a connection to our MySQL server.

Press " New” and leave all the fields intact, entering only the same password that we wrote down in the previous step.

Click " open» and agree to save the settings. Now we need to create new base, for our site. To do this, in the window on the left with the name of the bases, right-click, select " Create new database».

Fill in the parameters as follows:

  • Name: Any name of our database (may be the same as the domain name)
  • character set: utf8
  • Collation: utf8_unicode_ci

and press " OK”, after which our base should appear in the list:

After that, the MySQL setup is also completed. You can read more about installing and configuring MySQL in the article "".

5. Install WordPress

Well, you can proceed to the site itself. My website is powered by WordPress. As of the date of the last article, version 3.1.3. Let's create a WEB folder on the C drive. From the official site http://ru.wordpress.org/ we download the archive that needs to be extracted from the created folder. The wordpress directory will appear in the WEB folder, which we will rename according to our domain name.

Now in the root of this directory we will find the file " wp-config-sample.ph p" and open it with any text editor, such as notepad. Find and change only the following parameters in it:
In line

  • define('DB_NAME', 'database_name_here');- instead of database_name_here write the name of the database we created. (In my case it should be define('DB_NAME', 'tavalik);
  • define('DB_USER', 'username_here'); — instead of username_here write username root.
  • define('DB_PASSWORD', 'password_here');- instead of password_here write the password we saved.

and save under the name wp-config.php
Now we go back to IIS Manager", find the tab" Sites", right-click on it and select " Add website»

Enter the name of our site, specify the physical path to the site (in my example, this is C:\WEB\tavalik) and press " OK».

After that, open Internet Explorer, enter http://localhost in the address bar and get to the WordPress installation page. Enter the site title, username and password to enter the site, email address and click " Install WordPress».

After a message about successful installation, click on " To come in”, enter the newly invented login and password and get to the site management console. Find it in the bottom left corner Parameters» .

Enter short description site, and in the field " WordPress Address (URL)"and " Website address (URL)» enter the name of our domain. Press " Save Changes" and….

Everything, our site is ready. You can use. To check, enter the name of the site in the browser line and, if everything is done correctly, we get to the home page.

Did this article help you?

By definition webserver- This program, simulating environment Big Internet inside your home computer. The name, consisting of two parts "web" and "server" is rather confusing, since the second name is more understandable - local server program. Then it becomes clear that this program is being used on the user's computer (locally) and it doesn't matter if it is connected to the Internet or not. An even more precise name is home server software.

The server program is operating system for the Internet environment, and the browser program is analogue Word programs who can read websites - like documents written in tongues HTML, PHP, PERL...

As you already know, server programs installed on physical servers (computers permanently connected to the Internet) on which the site folders are located. There are many different folders, and so, servers (like programs) show the browser that - this folder IS the site that is requested - and then the browser enters this folder, wakes up the program site engine(control system), which starts to issue texts and pictures to the browser so that it can drag and draw them on the visitor's monitor screen.

Unlike real server programs local server on computer- it auxiliary web site creation software.

People often ask if it can work web server on the internet? Of course it is meant website on a web server, which some craftsmen are trying to create on their old computer by connecting it permanently to the Internet.

Local web servers fully ensure the performance of sites on such server computers, if a domain name is registered for the sites and their address is known DNS-servers. In order for browsers to come to such a home-hosted site, the user's (site owner's) server computer must have a permanent (static) address, not a dynamic address ( IP) in the Internet.

Another thing is the practical necessity of hosting sites on a home computer. Yet local servers are programs for creating an Internet environment not for real sites, and for them preliminary layouts. On such a layout, the functionality and design of the future site are tested before it is published on the Internet.

Web servers do not have the necessary degree of protection against malicious programs (viruses, trojans, etc.) that have flooded the current Internet. The developers did not think that they would need it and did not include it in the delivery. On the real server, the work of server programs is seriously protected.

The next disadvantage of web servers is that they are not designed to be visited by a large number of visitors to sites. Local servers do not hold the load well in case of mass traffic.

From an economic point of view, a home site is also not very profitable. In fact, a physical server is the same computer (only without a monitor), but it has many sites on one hard drive. If the cost of maintaining a home site must include the cost of electricity, the cost of the provider providing Internet connection, and the residual value of the computer on which the site is installed, then on a physical server these costs are divided by the number of sites.

In addition, the real server is provided with reliable protection against hacker programs, makes regular autosave of site files, and the hoster (provider - the owner of the server) provides administration and support.

Below is a theory for the curious, and for practitioners, I advise you to immediately go to one of the articles: or Server DENWER.

So what are server programs for?

Beginners should understand how the Internet works. An Internet user has a browser program on his computer, which he forces to “go” to a site located on the hard disk of a physical server ( special computer thousands of miles from the visitor). There, the browser “wakes up” server programs that are already running on the side of the physical server. They begin to interact with the browser - slipping (indicating) the necessary elements for downloading to the visitor's computer. If the browser and server programs have the same settings, then the browser will draw the site page on the monitor screen at the user's home as the author intended it.

Server programs - do not create a site, but Wednesday, in which many sites can work. The site is created using another program called CMS- a content management system or simply - a site engine. For one site, the engine is its internal "mechanism".

Local servers are not a single program, but are an assembly into which developers have placed lightweight versions of server programs.

The main component is server program(most often Apache), which actually creates the Internet environment inside local computer. Technology Apache time-tested and distinguished by speed and conflict-free operation with any operating system.

Since recently many sites are written in the language PHP, then there is a component - language compiler PHP, which allows the browser to read the site codes and assemble the page. Such a language compiler allows browsers to understand scripts written in the language PHP and correctly display everything on the monitor screen of the site visitor. Some assemblies additionally contain interpreters for other languages, for example, PERL v XAMPP. Availability of compilers for languages ​​other than PHP, for beginners, it’s more of a problem, because such components will have to be disabled due to being unused.

The next component is DB- database where most often used mysql for reliability and speed. Databases are a set of tables, the cells of which indicate where this or that element of the site page (text or picture) is located and how to display it (rotate, reduce). Modern sites do not have as such ready-made pages at all (as we see them on the screen). The browser collects pages on the fly (dynamically) from elements (pictures and text) that it learns about from database tables. The elements themselves are simply scattered across the site folders, and the tables DB, like catalogs in a library, allow you to quickly find the element you need for the page.

Usually server components are sorted out by its developers in order to reduce the size of their tutorial. To connect separate programs together use a control utility (program) phpMyAdmin.

Beginners need to understand that the server program runs as a service in the shadow mode. There are many sites on the physical server and a separate folder is allocated for each file on the server's hard drive. To prevent the owner of one site from entering another site, login passwords are set on site folders.

The server owner has the highest administrative rights, which allows him to log into all sites for verification. This is how the hierarchy of users appears: the server administrator, followed by the site owner - the administrator of his site only ( root or admin), registered visitors - commentators (komuzer or user) who are allowed to write a comment, simple visitors who can only watch.

When you install a web server on your computer, you become its administrator, so when you log in you have to register by entering your username and password. Do not be surprised that you will have to repeat the procedure for creating an administrator when installing the site engine. This will be the administrator of your site only. At home server you alone act as different administrators.

You can create several sites on one local server program, but for each you will have to create your own administrator. Another thing is that on a home computer, which, as a rule, only one person uses, it makes no sense for each administrator to create different logins and passwords.

Here you can immediately explain for the suspicious initiators of the site. The web server is a shadow program, it works invisibly to the person sitting in front of the computer. Installed once and that's it. It is only turned on (by clicking on one shortcut) before starting work with the home site and turned off after (by clicking on the second one). You don't have to read anything. This program does not need localization at all - the presence of explanatory inscriptions in Russian. Therefore, when choosing a local server program, you should not pay attention to Russification.

This is a note for those who choose domestic Denver(more often Denver, how Denver). There is nothing special except Russification and small size in it. Although the level latest version№3 web servers Denver allows you to develop websites of any complexity. About installing a local server Denver, popular among Russian-speaking Internet users, you can read in a separate article DENWER installation.

Typically, assemblies of local servers, in addition to server programs, contain programs to facilitate the work of a site developer. Most often, developers include some kind of FTP-client for uploading files to the server. Programs like FileZilla, are easy to learn and are used to upload files to a real server. For a home site, uploading files to the site is somehow ridiculous when you can simply drag and drop. They are rarely used, so for the sake of activating one FTP-client to include the entire local server is not worth it. Easier to install FileZilla separately, but as a set of a web server ftp- the client does not even activate.

Sometimes local servers are supplemented with separate mail servers - programs that implement mail forwarding using special protocols. For beginners, there is no particular benefit from such programs, because the real server will have its own mail server, the parameters of which will become known to you only after the installation of the site.

In addition to web servers XAMPP and DENWER among Russian-speaking users, the following are common free servers: AppServ, TopServer, VertigoServ, Zend Server Community Edition. Almost all web servers can be installed on a flash drive without the need for any drivers, which allows you to carry prototype of your site with myself. Usually web servers are cross-platform programs- that is, they can work in any operating systems, but for operating systems from the family linux it's better to use specialized LAMP. Recently launched web server open server server-based Nginx.

There is no particular difference between local servers, so install any. I recommend not moody XAMPP, which of all home servers has the most serious support.

For example, when I install Denver constantly stumbled on all sorts of little things, probably because he was "Russian" by origin, but the installation XAMPP went smoothly the first time.

The page was created to explain the provisions in the headings , and . The article has a permalink: http://site/page/web-server-na-svoem-kompjutere

Liked the article? Share with friends!
Was this article helpful?
Yes
Not
Thanks for your feedback!
Something went wrong and your vote was not counted.
Thank you. Your message has been sent
Did you find an error in the text?
Select it, click Ctrl+Enter and we'll fix it!