How to set up smartphones and PCs. Informational portal
  • home
  • Operating Systems
  • OpenServer is a modern local server and an example of using it to install WordPress on a computer. How to install and configure a local Open Server

OpenServer is a modern local server and an example of using it to install WordPress on a computer. How to install and configure a local Open Server

Creating your own local server based on a regular personal computer is a rather complicated and painstaking task. Here you need to understand the following points:

  1. 1. , and whether you need your own server at all. This is one of the key questions that requires a clear and unambiguous answer from the future administrator.
  2. 2. What technical resources are at your disposal, and what will be necessary for the operation of a full-fledged server. The minimum technical requirements for creating a "good" server are quite high: the equipment alone will cost 70 - 80 thousand rubles.

Also keep in mind that for the normal operation of the resource (for which you plan to make your own server), you need the server computer to be constantly turned on and work without interruption. Therefore, it is necessary to provide an appropriate power supply.

3. What money are you willing to spend on creating and maintaining the server. In addition to the “hardware” costs indicated above, creating a full-fledged server on a computer requires a dedicated (statistical) ip address and a high speed of receiving and transmitting data (the minimum is 10 Mbps). Accordingly, the provider will have to pay extra for this and conclude an additional contract for the provision of such services.

And before trying to make a server out of a computer, you need to clearly define all these nuances.

How to make a server from a home computer?

To create your own server, you first need to install a multi-user network operating system.

The choice is huge: "Debian", "FreeBSD", "CentOS", "OpenSUSE", "Ubuntu", "Windows" and many others.

On the net, you can find many examples of testing the above operating systems and their rating in accordance with the test results. For example, the SOS rating for 2016:

1st place: "Debian" and "Ubuntu Server";

3rd place: "FreeBSD" and " Windows server»;

4th place: "Red Hat Enterprise";

5th place: "Fedora".

Of course, the lion's share of the network software market is made up of operating systems that occupy the first place in the ranking. Therefore, in order to create a server on a computer for the first time, we recommend choosing one of them.

As part of the example, we will focus on installing the Ubuntu Server operating system.

How to set up a local server from scratch on ubuntu?

1. Download and bring the image of the operating system to a bootable USB flash drive. Boot the computer from the flash drive: at the first stage, you will be asked to select a language.

3. In the following steps, select "Region" and "Keyboard Layout Settings";

4. Specify the username, computer account and password,

then click "Continue";

configure "Disk Partition"

and select on which disk the system is installed;

6. Wait for the installation and system update to complete.

7. Select the software that you need to work.

8. Confirm the completion of the installation by clicking on the "Continue" button;

9. After restarting the computer, to enter the account, you will need to enter the login and password created in step "4";

10. This completes the installation of the server operating system and the initial creation of the server.

How to make yourself an admin on your server?

  1. 1. To obtain administrator rights, enter the command "sudo su";
  2. 2. By default, the server's network settings come from DHCP, but for the server to work, you will need to change the value of "iface eth0 inet static" in the "/etc/network/interfaces" file to "static ip address". The text should look something like this:

iface eth0 inet static
address 192.168.0.100
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1

After saving, restart the network with the "/etc/init.d/networking restart" command.

local server is a web developer tool for creating, debugging and testing various scripts and web applications. In other words, a local web server is an emulator of a real hosting provider server located on your computer. The operation of a local server is no different from a real one, and we can create and test our sites on it.

I won't go too deep into how a local server works and what it consists of. We'll talk about this anyway in another article. In this article, we will analyze installing and configuring a local server to your computer, but first we will analyze which local server to choose in general.

Today, there are many local servers, but which one to choose?

For a long time I used the Denver gentleman's suite, which includes php, MySql and PhpMyAdmin databases. You can learn more about this package on the official website of the developer. Denver is one of the popular local server packages for web developers.

But I had to give up Denver when I discovered Open Server. In my opinion, this application is much more convenient to work with, especially since in the latest versions the developer has included in its distribution kit a large number of necessary programs needed by the webmaster: browsers, a code editor, a file manager, and others.

Distributed by Open Server is absolutely free. The only way you can thank the author for such a super useful product for a webmaster is by transferring an arbitrary amount to an electronic wallet. As the author says, donations are very important, because the project is not commercial. Well, it’s understandable, without money today you can’t go anywhere ... In general, I personally transferred how much it was not a pity.

Benefits of OpenServer

What can I highlight in favor of this server? In general, I can say a lot of good things about Open Server, but I'm afraid the article will turn out to be too long. Therefore, I will highlight the important points.

The product comes in 3 versions: Ultimate, Premium, Basic. In general, you can look at the difference on the developer's website, but I took a screenshot and attached it to the article.

It is the presence of several versions that I consider a plus, because. You can download exactly what you need. Pay attention to the version of Ultimate in unpacked form - more than 5 GB. I personally constantly have problems with free space on my hard drive. Who has no problems with this + you need additional modules and programs, you can safely download Ultimate.

Availability of free software, as already noted. What kind of programs? I took a screenshot again.

The list, as you can see, is impressive.

Private software update. In fact, this is also very important. With each new version, bugs are fixed and new features appear.

Portable version of the program. The program essentially works without installation. You can carry it on a USB flash drive and, if necessary, work on another computer.

Rich features of the program. Below I have inserted a screenshot of the Open Server settings window. Looking at this screen, you will understand that this server contains everything that a webmaster may need when developing a site. FTP server, mail handling (php mail, smtp mail), aliases (for ), domains (creation of an additional domain alias), task scheduler (although I haven't used it yet).

Excellent documentation + support forum. The manual was written by the developer quite capaciously. Moreover, you can ask any questions you have on the support forum. In general, there is everything to start. You just need to pay a little attention to understand all this.

For now, I will complete the benefits, but this is not the whole list. You can find more information about Open Server on the official website of the developer - http://open-server.ru.

Installing a local Open Server

First, we need to download the distribution kit from the developer's site. Which version to download is up to you. It does not affect the operation of the local server in any way. The distribution kit is a self-extracting archive. Double-click to unpack the archive somewhere on the computer's hard drive, but in general it is desirable to the root of the hard drive. Everything, you can run the program. Now go to the folder where you unpacked open-server and immediately create a desktop shortcut for the main boot file. You will find two versions of the boot file - one is designed for a 32-bit operating system (Open Server x86.exe), the second for 64-bit (Open Server x64.exe). We create a shortcut in accordance with your system. For example, I chose "Open Server x64.exe" because I have a 64 bit OS. To create a shortcut, right-click on the file, then Send to -> Desktop (create shortcut).

When you first start the program, you will be asked to select a language and then a dialog box will pop up asking you to install Microsoft Visual C ++ Runtime & Patches if you are running Open Server on this computer for the first time.

To be honest, I don’t even know why it needs to be installed, this was not the case in previous versions of Open Server. But I installed and advise you.

You can start Open Server by double-clicking on the shortcut we sent to the desktop. After launch, a red flag will appear in your tray (next to the clock), this will mean that the local server program is running, but the server itself is not activated. Before activating, let's first look at the settings.

The first thing we need to do is to start the local server when the application starts (in principle, this is already up to you). To do this, in the settings in the "Basic" tab, check the box "Autostart server".

In the tab " Modules» you can see the installed modules for the local server and you can change them if you wish. For example, the default php version is 5.5. If you need 5.6.xx or php-7, then you can easily change it by selecting the desired version from the drop-down list.

Also in the tab Server» I advise you to choose the option « Always use Wirth. disk". This is necessary so that a virtual disk is created when the server starts. You can choose any drive letter.

I recommend leaving the rest of the settings as they are. If you have done something with the settings, then you can always roll them back to the factory settings by clicking on the " Reset settings«.

Now you can start the server - click on the red flag icon in the tray (one click with the left mouse button is enough) and select the green flag in the program menu. What do the colors of these flags mean?

  • Green - the server is running;
  • Orange - the server is starting/stopping;
  • Red - The server is stopped.

After starting, you should have a virtual disk - W (unless, of course, you specified a different label in the settings). I want to note that at the first start you may be asked to approve the Windows firewall if you have it enabled. The approval window may pop up several times, and all the time we give the go-ahead to the firewall to perform actions by the Open Server. Otherwise, your server will not start.

Go to virtual disk W and in the folder " domains»Create a folder for your future project and upload all the files of your site there. You do not need to create a "WWW" folder in the site folder, as is done in Denver. Once the files are uploaded, restart the server by clicking on the orange checkbox in order for the server to determine the new site folder.

To launch the site after installation, in the Open Server menu, go to " My sites” and in the drop-down list of sites, click on the one you need. After that, the browser that is installed by default in Windows will open - if you are using the simplified version, and if you are using the full version, then the browser that is set in the local server settings will open.

In this article, I described how to install a local server "Open Server". The list of settings that I ran through is far from complete ... We’ll talk about other features and settings sometime in another article, but for now, I’ll probably end on this note.

Good luck and happy website building!

In this article, I write an overview of the web server Open Server, then installation and configuration. First, what is Open Server? open server- This WAMP platform, designed specifically for web developers, taking into account their wishes and recommendations. WAMP is an abbreviation that is named after the first letters of the programs included in it. Namely: Windows - operating system; Apache - web server; MySQL - Database Management System; PHP is a programming language that is used to create web applications. The listed components are basic, and in addition, the complex has Nginx, Perl, FTP server, Sendmail and much more.

Features of the web server Open Server.
The web server does not require installation, it can work from usb media, the server can be with you, always at hand. Supports Windows versions (32-bit and 64-bit): Windows 8 / Windows 7 / Windows Server 2008(2003) / Windows Vista / Windows XP SP3. Multilingual interface, including Russian. Convenient control panel, all actions can be done through the tray.

disadvantages open server.
When working with a web server, I have replaced one shortcoming. There is no auto-update function for the program, if a new version has been released on the official website, then you will have to delete the web server and transfer all your projects to the new version of the program.

Installation open server
This review is over, now let's move on to downloading and installing the program. I recommend that all users download programs from official sites, as there is no risk that this program does not have built-in spyware, etc. So, go to the official website open-server.ru, go to the "Download" section, enter the captcha and click download. Next, unpack the archive to a local disk (for example, C:\open_server). We go into the directory where we extracted the program. Run OpenServer.exe.

After starting the program, we see that a stash has appeared in the tray, and all manipulations with the server are performed from the court. Right click on the icon and start the web server. It is possible that the program will not start the first time. What then do we do if the program issued "Startup Failed", open the program in the tray and select to view the logs. The most common log errors can be:

1. It is impossible to take port 80 because it is already used by "C:\Program Files (x86)\Skype\Phone\Skype.exe" (if the program is different, then we already configure it for ourselves), in this case you need to remove the use of port 80. This is done as follows, open the Skype program, then Tools -> Settings -> Advanced -> Connection, then uncheck Use ports 80 and 433.

2. "The file C:\Windows\system32\drivers\etc\hosts is not writable." In this case, there are 2 options:
1) The antivirus program is blocking the modification of the Host file, then try disabling the antivirus and restarting it.
2) Go to the directory "C:\Windows\System32\drivers\etc" and in the properties of the host file, uncheck "Read Only"

I described the main errors in detail, if there are problems at startup, write in the comments and I will definitely help you.

Configuring OpenServer
I hope to install and run open server, you still succeeded. What swings full use. Let's start with the simplest, if we want to run a site locally, you need to click "Folder with sites" in the tray. In this directory, create a folder, for example . In order for the site to work, we need to restart the server, server restart is also available in the tray. In the folder itself, we drop web documents. If you need to create a mysql database, go to the tray, then Advanced -> phpmyadmin. Login "root", by default the password from mysql databases is not set. mysql local address "localhost"

Hi friends.

In this article, we will install a local server on our computer for further development and configuration of sites on it.

To do this, we will use a program called Denwer. Installation is simple and does not require any technical knowledge. Moreover, the installation process is accompanied by prompts.

How to install a local server and whether it is needed at all, read on. Let's start by considering the importance of a local server.

Do you need a local server

For beginners, I will start by defining the concept of "local server" - this is a server (hosting) that is located on your computer (not on the Internet) and allows you to create, configure sites on it.

I believe that it is necessary to create and further configure the site on a local server, so that in one fell swoop you can place a fully functional site with all the settings on the Internet. And then immediately fill it with content.

This is what really professionals in creating websites do. Even if we look at people who constantly work with creating sites on various engines, we will see that almost every one of them first installs the site on a local server, then configures it, and only then transfers it to a real hosting.

As an example, I will show the menu from the course of Sergey Patin "Joomla 3 - professional website in one day". Look at the sequence in which the site is being created.

As you can see, from the very beginning, the site is installed locally, configured, and in the end, a completely ready-made resource is transferred to the hosting.

Placing a site on the Internet, and then setting it up when you need to already promote it, is unreasonable.

What if you already have a website? Do you need a local server?

Let's imagine the situation that you already have a website and you are a very avid techie, that is, you always like to delve into all sorts of technical issues and constantly experiment with something.

So, you already have a website and it already has some visitors. Let not a large number, but they are. Put yourself in their place.

You go to the site and constantly see that the owner of the site or blog is constantly changing something. Changes the location of the blocks on the site, the structure, and it happens that the design is new every day. Would you like this? So visitors would not really like such a situation.

Engaging in the development, customization of sites, as well as the creation of designs on a site that is already posted on the Internet, is at least not professional. Not to mention that it has a very adverse effect on its development and approval in the eyes of search engines and your audience.

Therefore, you need to do all such things on your local computer.

Now we will start installing it, after which you can install your site on your local computer and do whatever you want with it. Visitors to these machinations will not see, because. it is your personal computer and no one has access to it. And after you bring everything to the final state, then without any problems you can transfer it in a completely finished form to a real site.

By the way, I also talk about the importance of a local server when creating a blog in my mind map "A plan for creating a quality blog from Konstantin Khmelev", which you can get by leaving your 1st comment.

Let's move on to the installation process.

Installing a local server on your computer

The local server is a program. Therefore, you need to download it. We will use the Denwer web server for this.

Go to the official site programs and click on the big button.


After clicking, you are prompted to select the version of the program. Choose a version old PHP 5.2 and click on the button Download.


In the next window, we need to enter the data where the Denwer download link will be sent. Enter your real data and click on the "Get download link" button.


After clicking on the button, you will immediately receive an email with a link to download the program. The sender and subject of the letter will be as follows (see screenshot below).


After downloading, in the place where the program is saved, you will have an installer that will look like this.

To start installing the local server, run the installer.


We are asked if we want to install the base package? We agree.


The unzipping of the data will begin, which will take place very quickly.

After the data is unpacked, the installation of the local server will begin, which will be carried out on the command line. Immediately upon launching it, we will be asked to close the browser.


Automatically, when a command prompt appears, a browser will open with a message that you must close the browser to continue or cancel the installation.


You also need to close other browsers if the command line installation does not continue.

After closing all Internet browsers, the installation will continue. You just need to follow the prompts given by the command line.

Press Enter to continue installation.


I'll install it somewhere else. In my case, this is the disk E folder host.



In the next step, press Enter again.


The next step is to select a virtual drive letter. By default, the program prompts you to select the Z drive, since this is the last letter in the English alphabet and it is unlikely that any drive is occupied by it.

I'll leave it like that. You can also enter a different letter, but make sure that no disk is occupied by it.

After selecting and entering the letter, press Enter to continue installing the local server.



After copying is complete, you must select the Denwer launch option.

There are 2 launch modes, but the program itself recommends choosing option 1. We do so. Type the number 1 into the command line and press Enter.


  • launch;
  • stops;
  • reboot.

We need these labels. Therefore, we drive the letter Y and press Enter.


This was the last step in installing the local server, after which a browser will automatically open with the inscription "Denver installed successfully", and it will also be written that Denwer works with the same ports as Skype.

Therefore, if you have skype installed, then do what will be written in the browser window.


It will also create shortcuts on the desktop that we so wanted.

  1. Start Denwer - start denver;
  2. Stop Denwer - stop;

All. Our local server is installed. Now it remains to check it out a bit. Run and see if our virtual disk, which will act as a local server, will really start.

Before starting, let's go to the directory where we installed denver and see what is there.

Since I installed on drive E in the host folder, now there should be such a folder on my drive.


The way it is. And inside the folder should be the Denver files themselves. We go inside the folder, where we should see the following picture.


The files are there. So everything was successfully copied during installation.

Now let's check if Denwer itself starts up. Let's use the launch shortcut.

After launching the shortcut, 2 command lines will quickly flash. When they disappear, 2 shortcuts will appear on the taskbar.

If such shortcuts appear, then Denwer is running. A virtual disk should also appear with the letter Z in my case. In your case, with the letter you assigned. Also, this disk should be named similarly to the disk in which you installed Denver itself.


As you can see, there is an "E" drive that I installed into, as well as a "Z" drive that appeared after starting denver. Their names are the same. Both disks are named "Local Disk". Only the letters are different.

If we go to the virtual disk (Z), we should see the same Denver files and folders that we looked at earlier.


All friends. This completes the installation of the local server. Now you can start creating a site on it and do any fraud with the site.

In the next article I will show . You will also find a detailed article with images and a video tutorial there.

By the way, about the video tutorial. If someone, something is not clear from the text version, then here I give a video lesson that I specially recorded for you.

On this I will say goodbye to you. I look forward to your comments and some ideas for new blog articles. If something doesn't work or you have any questions, write them in the comments.

All the best.

Sincerely, Konstantin Khmelev.

A few days ago a Thought came to me once again. The thought was not new and rather obsessive: “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 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 + a local server (Apache, MySQL, PHP, nginx, memcached, mongodb). Bearing in mind the experience of previous installations, this time I decided to document the whole 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 they won’t even beat me for it later)

Disclaimer number two: yes, I perfectly imagine that in Ubuntu all this is done many times faster. But I work on Windows, so historically.

So let's get started.

Our work plan includes the installation of the following products:

  1. PuTTY
  2. Denver (Apache, MySQL, PHP)
  3. Nginx
  4. memcached
  5. MongoDB

1. PuTTY

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

PuTTY comes with several utilities, but I only need PuTTY 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 over a year TortoiseGit, which is stable, goofy and covers all my needs by 146%. All in all, 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 Denver

Denver- Web developer's gentleman's kit ("D.n.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 sites on a "home" (local) Windows machine.
Offsite:

3.1 Installation

We need to download basic kit and additional PHP5 modules.

Lyrical digression:

no, not just download, but get download links by email! That is, you will have to drive in your mail, as well as your first and last name, twice in the form under the large heading "Registration". "Registration required due to future release of Denver 4." For many years now, the form has been as if apologizing, but I no longer believe it (.

Usually installing denver is quick and painless, but on Windows8 I was attacked by an error that cursed for a missing library msvcr71.dll. The library can be placed in a folder "\Windows\System32\"(x32) or "\Windows\SysWOW64\"(x64). After the file has settled into the folder, open its properties and click the "Unblock" button.

3.2 Functional check

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

";

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

4. Memcached

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

memcache is a php extension that provides a convenient procedural and object-oriented interface to memcached, a highly efficient caching daemon that has been specifically designed to reduce database load in dynamic web applications.

4.1 Installing memcached

BUT. download archive with binary: Memcached 1.4.5 for Windows from here
AT. \usr\local\memcached

4.2 Installing memcache

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

4.3 Setting up Memcached launch along with Denwer launch

To run the script with Denver we need:
  1. write a script containing the 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/shutdown config folder \denwer\scripts\main\

BUT. create a file called "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 we will create a link to the script - a plain text file containing an indication that when starting, restarting and stopping Denver, you must execute init.d/memcached.pl
In a text editor we write
init.d/memcached
and save the file with 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

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

Restart Denver and see what happens

5.nginx

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

Offsite:

5.1 Configuring 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. For this we open \usr\local\nginx\conf\nginx.conf and add 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 differ.

5.2 Configuring Apache

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

## ## BEGIN VIRTUAL HOST TEMPLATE. ## ## If you want Apache to run on a port other than 80 by default, ## change the port number in the following 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 called "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 with 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

Put 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 included, Nginx is working fine.

6 MongoDB

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

Offsite:

6.1 PHP drivers

BUT. Downloading the library php_mongo.dll from this site: and drop it into a folder \usr\local\php5\ext\
By trial and error, it was found that the appropriate driver is contained in the archive mongo-1.2.5.zip/mongo-1.2.5-php5.3vc9ts.zip. If for some reason it does not start for you, try other versions.

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

6.2 Install Mongo

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

b. install 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 launch with Denver

A. create a file named 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 with the name "60_mongod" into the folders already familiar to us:

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

6.4 Checking the result

Let's start 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 be the following:

6.5. Installing the Mongo database management interface

The MongoDB offsite has a list and brief overviews of admins, so you can choose according to your taste.
I chose RockMongo for myself, so it is with its help that we will finally make sure that everything works for us and does not fall anywhere.

BUT. download the archive with the admin panel from this page. We choose, of course, Windows version. At the time of writing, this RockMongo-on-Windows v0.0.4

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

C. We check the result at the link www.test.local/rockmongo/index.php

Congratulations! Now we are final and irrevocable fellows.

Bonus #1. Working with php from windows console

Perhaps someone will come in handy. It came in handy for me when our evil tech lead decided that "SQL files are the last century, let's use migrations." Of course, for decency, I tried to portray complete misunderstanding and even shed a tear, but I was exposed and sent to figure out how it works on Windows.
It turns out that all you need to be happy 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.
In the directory of the test site, create a file console.php

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

The console replies:
> “Hello, UserName!”

PHP defeated, general rejoicing, applause, curtain call.

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

Top Related Articles