Manually installing apache on windows 7. Installing Apache. MySQL setup. PHP customization. Abo locally the middle of do-it-yourself rozrobka

Golovna / Nalashtuvannya
12/25/13 39.4K

A web server is a program that is running on a local or remote machine, and it is recognized that it allows you to look through web documents. If in address row enter the address of the site, when pressing the Enter key, the browser forms a request, directions remote computer- Web server.

Apache HTTP server (short for English a patchy server) is one of the most popular and wide-ranging programs created for web browsers and administrators of Internet resources. For the sake of independent reports, Apache installations on 50% of the computers of the existing HTTP servers.

The main advantages of Apache are stability, swidcode and flexibility, and the stench of a modular organization, as well as the fact that we are expanding vodcrita group programmers, even if the official name is Apache Software Foundation.

Apache supports impersonal operating systems and hardware platforms, and often wins under the management of the Windows operating system. It is also important that the web server expands absolutely without cost.

About those, how to install the Apache server for the Windows 7 operating system, see this article.

Installing Apache

In the first turn, it is necessary to grab the remaining version of the Apache distribution kit without the SSL support and run the installation. At the vital window, please click on "Next", read license favor retailer and confirm your good with him.


Then at the beginning of the installation it is necessary to fill in the fields as shown in the little box below, and in the field " Administrator's Email Address» enter your address email, click "Next" and set the jumper to the "Custom" position.

Dali, let's move on to the step-by-step process of "installing Apache". For locking, the web server is installed in a folder C:Program FilesApache Software FoundationApache 2.2.
Next, you need to create the www directory on the C drive and specify how to install the folder for Apache, click "Next" in this one and "Install" in the coming week. If the installation is over, press "Finish".

As if everything went well, the third party may have a pictogram that is being cured by the Apache web server. Zupinity and re-vantaging yoga can be done by clicking on the icon with the left button of the mouse.


By clicking on the same icon with the right mouse button, you can go to other systems of the operating system or open the Apache monitor.
In order to revise what you practice server insertions Apache, type in the address bar of your browser http://localhost
As soon as a party appeared with the inscription “It works! ”, Again, the Apache installation was successful, and it functions correctly.

Basic web server setup

If you want Apache to be more efficient and exclusively superior, not everyone is ready to win as a local server for low reasons, and the main thing is to navigate in the middle Microsoft Windows be some kind of graphic configurator, who will invariably complete the greater number of koristuvachivs.

Setting up the server is behind the help of manual editing of the httpd.conf configuration file. However, despite the statements about the incomprehensibility and foldability of this process, there is nothing coherent in this operation for two reasons: first, in order to build from a well-installed Apache server, which is a good thing for a pleasant and comfortable work, in the configuration file, it is necessary to change a lot of data, and in another way - httpd.conf comments to revenge a lot brown information, necessary for that, schob rozіbratisya z nalashtuvannyam.

What is necessary?

  • Run Apache under Windows 7 platform;
  • Save the files of the possible site from the directory, which is easy for the correspondent (for example, C: www);
  • Do not look at problems from coding, but zokrema - from the interpretation of Cyrillic;
  • Possibility to work with kіlkom sites at once.

To successfully solve these problems, go to the folder with Apache installed, find and open the httpd.conf file in the conf subfolder. Give respect to the rows that start from the “lattices”, є text comments, and how to fix the web server to win the rows, on the cob of which the “lattice” icon is visible.

For the first time, it is necessary to fix the tієї directorії, so that the server will vikoristovuvatisya like a folder to the website. Find a row in the text that originates from the DocumentRoot . This directive determines that the folder will be the root folder.

Correct її to DocumentRoot “C:/www”. Next, specify that the slashes in the file you are guilty of are wound to the right, and not to the left, as, perhaps, already called. short Windows. After the guessing manipulations, the problem with the rotting of your site has been eliminated.

Options (determine how server functions will be available) AllowOverride (determine how directives in .htaccess can override those in httpd.conf) Order (set the rules for access to the server)

List of parameters that are selected:

options. Possible next options:

  • Includes - SSI variant is allowed;
  • IncludesNOEXEC – SSI aliasing is allowed with bridging (#include and #exec are not allowed);
  • Indexes – it is allowed to index files, and if the URL address is specified for the site directory (for example, www.domain.ru/dir/ ), in which there is no index file, it will be shown instead of the directory, and if there are no options, an alert will be displayed those with blocked access;
  • ExecCGI - executing CGI scripts is allowed;
  • FollowSymLinks - the server follows the actual symbolic messages of the directory (winning in Unix systems);
  • SymLinksIfOwnerMatch - the server follows the actual symbolic messages of the directory, except in the case that the whole file can be one master of the messages;
  • All - all visions are allowed at once;
  • None - all of the above descriptions are blocked at once;
  • MultiViews - the ability to select the same content and view it depending on the browser settings (check if everything is on (Options All). Please specify).

AllowOverride. Options:

  • AuthConfig - allow to write directives for authorization;
  • FileInfo - allows customization of directives for robots different types documents;
  • Indexes - allows the use of directives for working with indexing files;
  • Limit - allows changing directives for access to the host;
  • Options - allows you to change directives to work with the songs specific functions of directories;
  • All - mustache all at once;
  • None - nothing out of the blue at once.

order. Options:

  • Deny, Allow - Deny is assigned before the Allow directive, access is allowed for locking, hosting, as specified in the next Deny from row;
  • Allow,Deny - Allow is assigned before the Deny directive, access is blocked for locking, hosting, as specified in the next line Allow from row;
  • Mutual-failure – access is allowed only to such hosts, such as daily in Deny and present in Allow.

Based on all of the above, try tweaking your server. In the httpd.conf file, the Directory directive for locking is used in two examples - і . The first variant of chipati is not followed, to set the parameters in the other one in this order:

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

In other words, the following parameters have been selected for the C:/www folder and all subfolders:

  • With the possible functionality of a real server, indexes are allowed in directories and go for symbolic messages;
  • The possibility of parametric reassignment for the additional .htaccess file will be changed daily, looking at those that can access the server again, it’s not up to date - everything can be adjusted through httpd.conf;
  • Access to the web server is allowed from all hosts.

Now, save the httpd.conf file and restart Apache for more Apache Monitor help with apache –k restart command line. Setting up the root folder for the site is complete.

It’s necessary to reconsider, what is right, you robbed everything. Create a simple web page in the folder C:www, open your browser and enter http://127.0.0.1/your_created_page. The sides may be vindicated. Otherwise, it is necessary to carefully check all the changes in the httpd.conf file for correctness.

As if the side was successful, it was immovable, that instead of Cyrillic symbols, you better symbols that are not readable. The stench can be displayed for two reasons. First, the web server tells your browser to ask for a page, a promotional code. In a different way, it’s not surprising that the coding is not in Cyrillic.

Yakshcho woeful Internet Explorer if you choose coding from the same side, then, for example, Mozilla Firefox Opera can't seem to reach such a level of skill, and the way of setting the coding in the browser manually can hardly be called handy. So, it is necessary to fix Apache to see for the promotion of the necessary coding.

Look in the httpd.conf file for a row that looks like AddDefaultCharset . Above all, it says ISO-8859-1 encoding, which has daily Cyrillic characters. Change ISO-8859-1 to windows-1251, save the file and restart Apache. Now you can't correctly display Russian language on your site, it's perfect for any browser.

At the Apache server, just fix the robot with a lot of sites. Addresses that can be wicked for them - 127.0.0.2, 127.0.0.3 etc. At any time, you will see only one, which is the site for promotion (127.0.0.1), prote for local work not critical. I divided the file httpd.conf, in which the configuration of everything necessary for that is carried out, is known in the very world and is called VirtualHosts.

In order to add a supplementary site, create a directory, which will win like a root, for example, C: www2. Assuming that the site will be located at the address 127.0.0.2 , give it the name site911 and in the VirtualHosts branch, add the following rows:

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 the browser's address bar will take you to your first local site, and typing 127.0.0.2 will take you to another local site. Keep in mind that in the middle of the VirtualHosts skin container, you can tweak the Apache web server directives, why can you skin the site to find a better rank.

Podbag

The installation is complete, and now you can fully deploy the Apache server in practice.

Well, well, you have vrishily taken care of the administration of websites, we will come to your place by the end of the connection Apache PHP MySQL, even without a database management system, as well as without the support of one of the most advanced web programming methods, and a web tool for administrating the MySQL system can not do without a server in the open spaces all-worldly measure. How to say, " important in war, but easy in battle».

Good luck with the wedding day, it’s not easy, but do it well!

good bad

03/19/17 5.9K

The Apache project does not provide binary versions software, but rather a free code. Prote їх can be viewed on third-party sites:

  • ApacheHaus;
  • Apache Lounge.

Download the 32-bit version of Apache Windows ( httpd-2.4.20-win32-VC14.zip) or 64-bit version ( httpd-2.4.20-win64-VC14.zip). Flip what you have installed 64-bit OS version. For a reason, you can download msinfo32.exe . This tool helps to collect information about the computer, diagnose problems, or it can be tweaked to access other tools.

To run yogo, hit the command Vikonaty > msinfo32 > press Enter.

After you know the version you need, grab the Zip-archives, and then extract it from the C: Apache24 folder.

Before starting the Apache server, it is also necessary to change the listening port to 8181:

  • Open the file C:Apache24confhttpd.conf in a text editor;
  • Find next row: Listen 80;
  • І change її to: Listen 8181 .

Save change.

You can now start the Apache Windows 7 server:

Open the command line in the name of the administrator and go to the bin subdirectory:

Type httpd.exe and press Enter.

As if a dialogue window appeared on the screen, informing you about the presence of the MSVCR140.dll file, you need to install it Visual C++ Redistributable for Visual Studio 2015 (select vc_redist.x64.exe if you have installed 64-bit version of Windows).

Now open your browser and enter the address string http://localhost:8181 to launch the demo site.

Installing PHP 7 on Windows

PHP 7 is an important update for the PHP server-side movie. Download zip archives VC14 x64 Thread Safe (2016-Apr-29 00:38:19) . Yaxcho wi zavantazhili 32-bit version of Apache, you need to install PHP x86.

Create folder with names " php7”, replace the archive php-7.0.6-Win32-VC14-x64.zip , and then place the folder in the root of drive C:

Setting up Apache for the PHP wiki

Open installation configuration file Windows Apache C:Apache24confhttpd.conf.

Copy the next rows on the cob to the file:

  • AddHandler application/x-httpd-php.php;
  • AddType application/x-httpd-php .php .html;
  • LoadModule php7_module "c:/php7/php7apache2_4.dll";
  • PHPIniDir "c:/php7" .

In retail add a row of index.php and put yogo before index.html :

DirectoryIndex index.php index.html

Save file Apache PHP Windows. Now rename the file C:php7php.ini-development from C:php7php.ini.

Enable mod_rewrite to rewrite URL

Open configuration file Apache C:Apache24confhttpd.conf;
Find a new row #LoadModule rewrite_module modules/mod_rewrite.so and remove the hash symbol "#";
Find the input of the row " AllowOverride None» and change їх to « AllowOverride All".

Customizing PHP with MySQL

Edit the php.ini file and comment out the extension directory. Remove symbol "; »on the cob row:

; Directory in which loadable extensions (modules) reside. ; http://php.net/extension-dir; extension_dir = "./"; On windows: extension_dir="ext"

Activate the next rows to allow MySQL modules to run:

extension=php_mysqli.dll extension=php_pdo_mysql.dll

And also hover the rows below, so that you win the installation of Apache PHP MySQL Window s in the middle of the distribution:

extension=php_curl.dll extension=php_fileinfo.dll extension=php_gd2.dll extension=php_mbstring.dll extension=php_openssl.dll

Uncomment error_log to add log file log:

; Log errors to a special file. PHP"s default behavior is to leave this value ; empty. ; http://php.net/error-log ; Example: error_log = c:php7php_errors.log

Save change.

IMPORTANT! Set PATH for Windows to know PHP

  • Right-click the mouse on the shortcut My computer - Power - Dodatkovo - Change of environment;
  • In retail " System changes» find the item "Way", click on it and select "Change";
  • Add in the end ways to the php folder ( obov'yazkovo after flecks with a coma ";"). For example: "; C: php7";
  • Press "OK".

How to reverse, chi PHP installations

Create a file at the address C:Apache24htdocsphpinfo.php and add the next code to the new one.

The article describes the installation of Apache 2.4 + PHP 5.6 + MySQL 5.6 on the operating system Windows system 7 / 8 / 8.1 / 10

First, continue reading, pay attention to those who really need to install and update all Windows chains? Can you get some respect for you and don’t waste your time and get nervous about setting up the same without interruption in Windows? Have a vipadka, read the article about. It is possible to spare you not more than an hour, but good health.

This instruction will be relevant to the WEB-retailers who choose to install the Apache WEB-server with the PHP interpreter of the remaining versions on their Windows PC. Obviously, it’s much easier to install a fee, for example Denwer, or go to the best installer and not worry about the drive. Prote leather WEB retailer goiter understand the process of working the WEB server, the process of installing it and adjusting it.

If you want to install PHP 7, be sure to turn to the article.

If in the process of folding the server for the instructions You ran into problems and still consider yourself a WEB-retailer, then it would be the right way to deal with problems that are blamed, and not write in the comments that the instruction is shit. Operating instructions. Overwhelmed by an hour and hundreds of installations. Be respectful when vikonnі simple krokіv. Vikonanny krokiv manually that analysis of situations, as it did not work, to give you a skill like a retailer. If you are not a WEB retailer and do not plan to use it, then find out a simple way to install it on the Internet - given instruction not for you.

Respect that under Windows XP this version VC11 it will be impossible to start it (but it’s very important).

Preparatory work

Check if you have Windows 7 or the newest. If you have Windows XP, these instructions will not help you, because the version of Apache described here does not work under Windows XP.

View all WEB servers, which you have installed before, go to the service and change, there are no Apache or IIS services. As you already have a web server installed, the other one, in parallel, doesn’t charge for everything.

If you have Skype, it will be possible to use the language of the keyboard for 80 ports. Zreshtoy, You are guilty of reconciliation, that the service is not victorious on the 80th port.

For robots, it’s even a mother’s file manager, which allows you to create files with whatever extensions, or, in short, a code editor, for example Sublime Text or Notepad++ or an IDE.

The folder structure can be different, but the instruction is written according to the first structure, so it follows that everything is guaranteed to work.
First start, save to disk D folder USR, in the middle to create 5 subfolders: apache, php, tmp, www, log. Same way. No version numbers.

In catalosis www create index files (for help file manager or the code editor), which will be needed to re-verify that everything works:

  • index.htmlіz vmistom: It works!
  • index.phpіz vmistom:

If you don't have a file manager/code editor/IDE, download the archives of these two files. Ale, if you care for yourself with a WEB retailer, you are responsible for getting the tools.

To the system change PATH add:

;D:\USR\apache;D:\USR\apache\bin;D:\USR\php;

Respect!

Placed in the attachments of configuration files and row numbers can be different for other versions of apache and php.
All commands, including editing files, must be changed in the name of the Administrator.

Installed Apache 2.4

If you want for a simple development in PHP and there is no need for a real WEB server (PHP has a powerful WEB server, which may be sufficient for the development of one project), it is still recommended to install and configure the Apache WEB server, if you want that the programmer is to blame for the knowledge of subtleties. It's okay to work with the WEB-server and get to know the configuration. So let's get started.

  1. Zavantazhuemo Apache 2.4 binaries VC11 for your system http://www.apachelounge.com/download/VC11/ If you have a 64-bit OS, then you need a file with names, for httpd-2.4. xx-win64-VC11.zip
  2. If you need additional modules, you can get them in the same place (no need for a basic installation)
  3. Rozarchivuemo instead of folders Apache24 from the downloaded archive in D:USrapache. Please note that in D:USRapache it is necessary to put not the Apache24 folder for the archive, but її instead. You don't need to install anything.
  4. Change the value of the file ServerRoot to "d:/USR/apache" ( row 37) that value DocumentRootDirecroty) to "d:/USR/www" ( rows 242 and 243). Also, follow the comment on row 218 and change it to: ServerName localhost:80
  5. We change the parameters for saving logs from the same file (we know the parameters are changed): ErrorLog "D:/USR/log/apache-error.log"
  6. We install the Apache service (in the name of the Administrator). Enter the command line in the name of the Administrator and insert the following line there: D:\USR\apache\bin\httpd.exe -k install
  7. Follow for reminders about pardons at the hour of the installation of the service. Yakscho everything is broken up correctly, everyday pardons are not to blame buti. If you had a row after the second row, the command row didn’t show up again, then most of the time it was done incorrectly. Just hurry up with the functions of copying and pasting, so as not to allow pardons for an hour of altercation.
  8. We create on the work table a label for D:\USR\apache\bin\ApacheMonitor.exe this/or put yoga in auto-enablement (to open the auto-enablement window in WIN8, you need to press WIN + R, then enter shell:Startup and press OK)
  9. Start ApacheMonitor. A shortcut will appear in the system tray. Click on the new one with the left button, choose Apache24->Start.
  10. At the browser, go to http://localhost/ - maybe It works!
  11. As if they didn’t let such a writing, it’s understandable that it went wrong (we read the logs, google it, we try to solve the problem on our own, as we already wrote to sort out the intricacies of the web server’s work)

Installed PHP 5.6

  1. We want the rest of the version VC11x86Thread Safe or VC11x64Thread Safe for help http://windows.php.net/download/. Give respect to what you need yourself VC11 i same Thread Safe. Razryadnist can be like Apache. The file that you need will most likely be called xtalt for everything: php-5.6.11-Win32-VC11-x86.zip or php-5.6.11-Win32-VC11-x64.zip
  2. Viymaєmo instead of the archive in D:usr\php. Like in Apache, you don't need to install anything.
  3. U file D:\USR\apache\conf\httpd.conf add rows: LoadModule php5_module "d:/USR/php/php5apache2_4.dll" AddHandler application/x-httpd-php .php # Path to php.ini file PHPIniDir "D:/USR/php"
  4. I change the value DirectoryIndex on the index.html index.php (row 276)
  5. Restarting ApacheMonitor, restarting Apache (Apache24 -> Restart)
  6. We go to the browser http://localhost/index.php and reconsider what PHP is working on.
  7. We will make a copy of the file D:\USR\php\php.ini-development s im'yam D:\USR\php\php.ini
  8. It’s worth noticing, commenting on that change of parameters: extension_dir = "D:/USR/php/ext" sys_temp_dir = "D:/USR/tmp" extension=php_mysql.dll extension=php_mysqli.dll extension=php_openssl.dll Europe/Zaporozhye
  9. Vikonuemo at the command line php -m to look through the list of connected modules.
  10. Restart Apache with ApacheMonitor

Apache virtual hosts

  1. As there are many projects on the computer, virtual hosts (sites) may be needed. On the example, we will look at two virtual hosts: s1.localhostі s2.localhost. For clarity, we create folders with the same names, which are not necessarily the same in a real system.
  2. Next check, which of the selected virtual hosts, parameter DocumentRoot the Apache configuration file has no more sense. The main host of the server (which will be available at http://localhost/) is now first virtual host at the configuration file of virtual hosts!
  3. For starters, you need to add to the file c:\Windows\System32\drivers\etc\hosts the lines: 127.0.0.1 s1.localhost 127.0.0.1 s2.localhost

    It is necessary to work in the name of the Administrator. It is necessary to re-advandage if necessary, but in practice it is not necessary. If you don't want to change the file (access right), you can copy it to the working style, change it, and then copy it back.

  4. Create folders for virtual hosts D:\USR\www\s1.localhostі D:\USR\www\s2.localhost, in which files are located. We create a file with the skin dad index.htmlіz vmistom S1і S2 obviously (to control that everything works as required)
  5. Let's create folders for logs: D:USR\log\s1.localhostі D:USR\log\s2.localhost- here logs of the skin site are saved. Vzagali, logs can be saved in one folder, but I sound like this - I'm so handy.
  6. Next, you need to enable the support of virtual hosts. At the file D:\USR\apache\conf\httpd.conf comment on the row Include conf/extra/httpd-vhosts.conf
  7. Dali editable file d:\USR\apache\conf\extra\httpd-vhosts.conf- Vin is guilty of looking like this (to the skin virtual host its own VirtualHost block): ServerAdmin [email protected] DocumentRoot "D:/USR/www/s1.localhost" ServerName s1.localhost ServerAlias ​​www.s1.localhost ErrorLog "D:/USR/log/s1.localhost/error.log" CustomLog "D:/USR/log /s1.localhost/access.log" common ServerAdmin [email protected] DocumentRoot "D:/USR/www/s2.localhost" ServerName s2.localhost ServerAlias ​​www.s2.localhost ErrorLog "D:/USR/log/s2.localhost/error.log" CustomLog "D:/USR/log /s2.localhost/access.log" common
  8. First virtual host s1.localhost will now be the main host of the system, because this block is next to the first one in the configuration file, then. will be available at the entrance to

Please select a local server from your local machine. In this article, we know about the installation of the warehouse part of the local server Windows platforms 7, Apache web server.

I respect that for manual installation, the latest version of Apache 2.4.18 is used.


Apache version 2.4.18

Run the installer first, depending on the local server installation location. Yogo local server warehouse parts put on system disk computer. Moreover:

  • Apache is installed in directory: .
  • PHP is installed in the directory: [С:\php]
  • MySQL behind the lock:

How to install MySQL server Windows Service I rozpovidav at the article:. How to install the PHP interpreter I write in the article: Installing PHP.

1. Run the Apache MSI installer.
Installing Apache MSI first time 2. We know that we will wait with the Apache license

3. Gave knowledge of the documents

4. On this side, you need to save the data of our local server:
  • Server Domian: localhost;
  • Server Name: localhost;
  • Admin email: whatever.

Important: Port 80 must be specified for all corsists.

5. On the left side, switch to

6. On the offensive side, it is clear why they switched to. We now have the ability to specify a folder to install Apache. Cho mi i robimo, having shown the back of creations catalog: [C: www].

7. On the offensive side, the result is embossed.



Three systems require the Apache button.

How to convert the Apache robot on a computer

Rechecking the Apache server robot. For this, in the address row we write the address: http://localhost And Bachimo wrote “It work!”, which means “Practice”.

How to disable Apache on a computer

Apache necessary do not start and trim yoga, there is no way, no sense. To do this, remove the demo to the tray and right-click the Apache icon, there are three control buttons:

  • Apache monitoring;
  • open servers;
  • exit.

Rest, s yakikh i vіdlyaє.

Why is everything! Apache MSI installation is complete. Make a note of the Apache installation folder, you'll need it when setting up a local server.

Glossary of articles:

  • Distribution- Program extension form and software security.
  • Release- Software version.

Folder preparation

I really don’t like that everything was lying around for me, it’s good, so for the cob we create folders, where we will have programs and sites.
Let's create the "Server" folder on the "C:\" drive (otherwise it's better for you):
C:\Server\
We create 2 folders for it:
C:\Server\web - this folder, in which we will have programs
C:\Server\domains - and our sites are in this folder
Otzhe, at the folder \web\ we create 3 folders for apache, php, mysql:
C:\Server\web\apache\
C:\Server\web\php\
C:\Server\web\mysql\
Let's move on to the domains folder and create the \localhost\ folder
C:\Server\domains\localhost\
In the middle of the folder, we will have two subfolders: public_html - for files on the site; logs - for text files, in which “who” is recorded, having given access to the site, such pardons were sent to the robot site.
C:\Server\domains\localhost\public_html\
C:\Server\domains\localhost\logs\
Where the folder structure ends, let's move on to the Apache setup.

Apache customization

To install Apache, we need Apache itself (Kep). Since we have Windows 8.1 x64, we will install Apache x64.
For the sake of excitement, let's move on to the possibilities:
www.apachelounge.com/download/win64
and optionally "httpd-2.4.6-win64.zip". So we need for normal work"Extending package Microsoft Visual C++ 2010 (x64)". For whom zavantazhuemo yogo for sim posilannyam:
www.microsoft.com/en-us/download/details.aspx?id=14632
we will install it.
Since our archives have been taken over by Apache, we see it. Open the archives, let's go to the Apache24 folder, go into it. Anonymous folders and program files will appear, everything is unpacked in the earlier prepared folder:
C:\Server\web\apache\
It's good to go like this:
C:\Server\web\apache\bin\
C:\Server\web\apache\cgi-bin\
C:\Server\web\apache\conf\
C:\Server\web\apache\error\
C:\Server\web\apache\htdocs\
C:\Server\web\apache\icons\
C:\Server\web\apache\include\
C:\Server\web\apache\lib\
C:\Server\web\apache\logs\
C:\Server\web\apache\manual\
C:\Server\web\apache\modules\
We don't need folders like \cgi-bin\, \htdocs\, \icons\ and \manual\ - you can see them.
Let's go to the folder:
C:\Server\web\apache\conf\
І open the Apache configuration file - "httpd.conf" be it text editor. Which file has a row of directives for customizing Apache, and the rows that start with the # sign (hash) have a comment and an explanation. Let's get down to polishing:

Apache Configuration File

# Apache directive
ServerRoot “C:/Server/web/apache”
# Heard on local IP port (80 per standard)
Listen 127.0.0.1:80
# add library extensions for Apache
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule php5_module "C:/Server/web/php/php5apache2_4.dll"
# tell Apache which files are php extensions, you need to take it like php-script
AddHandler application/x-httpd-php .php
# let's say you can change the php file
PHPIniDir “C:/Server/web/php”
# change server name
ServerName 127.0.0.1:80
# change access to directory

Options Includes Indexes FollowSymLinks
AllowOverride All
Allow from all


# directory with our sites
DocumentRoot "C:/Server/domains"
# Index files, priority.

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

# folder for log files
ErrorLog “C:/Server/domains/logs/error.log”
CustomLog “C:/Server/domains/logs/access.log”
# dodamo alias for phpMyAdmin, and fixed alias for cgi

Alias ​​/pma “C:/Server/domains/phpMyAdmin”
ScriptAlias ​​/cgi-bin/ "C:/Server/web/apache/cgi-bin/"

# Right way for cgi

AllowOverride None
Options None
Require all granted

file types


AddType text/html .shtml
AddOutputFilter INCLUDES.shtml
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

# Other configs:



Browser Match "MSIE 10.0;" bad_DNT


RequestHeader unset DNT env=bad_DNT

Where does httpd.conf end up?
The Apache httpd.conf configuration file had additional configs enabled:
Include conf/extra/httpd-mpm.conf
Include conf/extra/httpd-autoindex.conf
Include conf/extra/httpd-vhosts.conf
Include conf/extra/httpd-manual.conf
Include conf/extra/httpd-default.conf
Open the file "C:\Server\web\apache\conf\extra\httpd-mpm.conf" and quickly run through it.
# indicate where we want to save the pid file:

PidFile “C:/Server/web/apache/logs/httpd.pid”

Other parameters are left without changes. View the file "httpd-autoindex.conf", change there only a row for help:
Alias ​​/icons/ "c:/Server/web/apache/icons/"

Options Indexes MultiViews
AllowOverride None
Require all granted

Apache host file

# on application domain on localhost

DocumentRoot "C:/Server/domains/localhost/public_html"
servername localhost
ErrorLog "C:/Server/domains/localhost/logs/error.log"
CustomLog "C:/Server/domains/localhost/logs/access.log" common


# dodamo for the future phpMyAdmin (do not forget to create a folder)

DocumentRoot "C:/Server/domains/phpmyadmin/public_html"
servername localhost
ErrorLog "C:/Server/domains/phpmyadmin/logs/error.log"
CustomLog "C:/Server/domains/phpmyadmin/logs/access.log" common

This file editing ends. Dali in the files that were left out, rightly only paths:
File "httpd-manual.conf":
AliasMatch ^/manual(?:/(?:da|de|en|es|fr|ja|ko|pt-br|ru|tr|zh-cn))?(/.*)?$ "C:/ server/web/apache/manual$1"

The "httpd-default.conf" file has no annual changes. On which Apache configuration is terminated.

PHP customization

If we have Windows 8.1 x64 and Apache x64 installations and upgrades, then php can be x64.
Idemo to the site:

that zavantazhuєmo php archives of the remaining version. We need php as a module, tobto. for whom you want Thread Safe. Since the archives have been taken, we open it and transfer it to the “C: Serverwebphp” folder. Let's create two empty folders "tmp" and "upload". Dalі in tsіy paptsі shukaєmo file php.ini-development and rename yogo in php.ini. Open the file in a text editor and change the directives (commenting rows in the file start with a speck with a coma).

Customizing php.ini

short_open_tag = On
zlib.output_compression = On
post_max_size = 64M
include_path = ".;W:\Server\web\php\includes"
extension_dir = "C:/Server/web/php/ext"
upload_tmp_dir = "C:/Server/web/php/upload"
upload_max_filesize = 64M
extension=php_bz2.dll
extension=php_curl.dll
extension=php_gd2.dll
extension=php_mbstring.dll
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_pdo_mysql.dll
extension=php_sockets.dll
extension=php_sqlite3.dll
; the section specifies the time zone of our server (http://php.net/date.timezone)
date.timezone = "Asia/Ekaterinburg"
session.save_path = "Z:/Server/web/php/tmp/"


On tsoma php customization end.

MySQL customization

We put MySQL x64 as a socket under windows. Zavantazhuemo archives the rest version MySQL x64:
dev.mysql.com/downloads/mysql
At the bottom of the page we know Windows (x86, 64-bit), ZIP Archive and embossed on the "Download" button. You will be redirected to the registration page on the site. Clicking at the bottom of the "No thanks, just start my download" button will start downloading the MySQL archive. After that, we have taken the archives and moved the entire folder to "C: Server \ web \ mysql \"
Now you can open the MySQL configuration file - "C:\Server\web\mysql\my-default.ini". We see the whole yoga together and we bring our data there.
port=3306
host=127.0.0.1
port=3306
bind-address=127.0.0.1
enable-named-pipe
basedir="C:/Server/web/mysql/"
datadir="C:/Server/web/mysql/data/"
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
From i all. In the configuration file, it was specified that scripts can be sent to the server via local IP, and via socket connection.
Lost on the right for Malim. Dodamo in the system change "PATH" way to Apache and MySQL, for which:
  1. Drag the mouse cursor to the lower right corner of the screen
  2. Click on the “Search” icon and enter: keying panel
  3. Select System -> Advanced ( Additional parameters systems)
  4. Select Environment Variables, in the System Variables menu, find the PATH change and click on it.
  5. Write paths to Apache and MySQL:
;C:\Server\web\apache\bin;C:\Server\web\mysql\bin
Let's install the Apache and MySQL services. For this speed, use the "Win + X" keys, the menu will appear in the lower left corner. Vibero "Command row (administrator)".
At the command line, enter to install Apache:
httpd -k install
to install MySQL:
mysqld.exe --install MySQL --defaults-file="C:\Server\web\mysql\my-default.ini"
Let's set the password for MySQL-koristuvach. For which, start the MySQL service with the command:
NET start MySQL
After the service has started, set the password:
mysqladmin –u root password YourPassword
We have added two sites to the "httpd-vhosts.conf" file, so that the browser can instantly work, name the sites and add them to the "hosts" file. Let's go to the folder:
C:\Windows\System32\Drivers\etc\
open the “hosts” file, be it a text editor (run as administrator) and finish the file dodamo:
127.0.0.1 localhost
127.0.0.1 phpmyadmin
Save the file.
To make it easier to launch both the Apache and MySQL services, we create the files start-server.bat and stop-server.bat.
For this, let's go to the "C: Server" folder and create two files.
Change "start-server.bat":
@echo off
NET start Apache2.4
NET start MySQL
Change "stop-server.bat":
@echo off
NET stop Apache2.4
NET stop MySQL
The installation of Apache, PHP and MySQL is completely finished. In order to protest the server, let's create the "index.php" file in the folder "C:\Server\domains\localhost\public_html" with the following instead:

Let's start our server, for which run start-server.bat as an administrator. Once the server has started, open the browser and enter "localhost" in the address bar.
You will need to contact us with information about PHP.

© 2022 androidas.ru - All about Android