Installing Apache under Windows

Source: Internet
Author: User

First, Apache download

Apache download is a big problem, and for an official control, it is a hard and careful project to find a win under MSI version in a bunch of official documents. And the latest version is basically compiled installation version.

A website is recommended here, although the MSI is not the latest version, but wins in the simple:

archive.apache.org

Or go to another software station to download also can

If the MSI version is not found , there is no relationship, and a later introduction to the compilation installation

Second, Apache installation version installation

If you find the installation version of the Apache, then congratulations, fill in the corresponding information, click Next to be able to.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/53/2B/wKioL1RlbDahQZAyAAFLXWRWAEQ241.jpg "style=" float: none; "title=" a1.jpg "alt=" Wkiol1rlbdahqzayaaflxwrwaeq241.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/53/2D/wKiom1Rla8fw76vaAAGtLnJoCmI135.jpg "style=" float: none; "title=" a2.jpg "alt=" Wkiom1rla8fw76vaaagtlnjocmi135.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/53/2B/wKioL1RlbDeA9jJOAAIY3ZypW2A649.jpg "style=" float: none; "title=" a3.jpg "alt=" Wkiol1rlbdea9jjoaaiy3zypw2a649.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/53/2D/wKiom1Rla8iBu2YZAAD14U9XE0o015.jpg "style=" float: none; "title=" a4.jpg "alt=" Wkiom1rla8ibu2yzaad14u9xe0o015.jpg "/>

Third, Apache official version of the installation

Small partners can first look at the installation version needs to modify the information, {Domain,Server Name,Email Address,change} , roughly these four items, then in the compilation of the installation, you need to modify the configuration file in advance, that is, the four items are modified first, and then installed through the command line

First, we unzip the zip package to the folder that needs to be placed


Open conf/httpd.conf file

Modify

Definesrvroot "/apache24"

ServerRoot "${srvroot}"

For

ServerRoot the location of the "d:/winrar/apache2.4"//apache Program

Modify ( optional )

ServerAdmin [email protected]

Modify ( optional )

Servernamelocalhost:80

Modify

DocumentRoot "${srvroot}/htdocs"

<directory "${srvroot}/htdocs" >

For

DocumentRoot "D:/code";// root directory of the website

<directory "D:/code" >

Modify

scriptalias/cgi-bin/"${srvroot}/cgi-bin/"

<directory "${srvroot}/cgi-bin" >

For

scriptalias/cgi-bin/the location of the "d:/winrar/apache2.4/cgi-bin/"//apache Program

<directory "D:/winrar/apache2.4/cgi-bin" >

The general principle is to replace the variables in ${} with the paths we need to configure.


Next, start Apache

Open cmd, enter D: carriage return CD winrar/apache2.4/bin carriage return httpd, if configured correctly, is not any display.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/53/2D/wKiom1RlbCzSXcukAAEEQ2-fYnA713.jpg "title=" a5.jpg "alt=" Wkiom1rlbczsxcukaaeeq2-fyna713.jpg "/>

create a file in the root directory of the Web site to access it. If normal, description,OK.

the following Apache joins system services

(1) close the 3 httpd Command window, or you will get an error.

(2) start --- run, enter cmd, and then open a command prompt. Input D: carriage return CD apache24\bin enter

the command to join the service here is:httpd.exe-k install-n "ServiceName"

ServiceName is the name of Apache in Windows services.

Example:httpd.exe-k install-n "Apache2.4"

(3) by the way to affix the unloading command:httpd.exe-k uninstall-n "Apache2.4"

Four, Apache configuration

here Apache Configuration and compilation of the same version of the installation, do not do a separate introduction, it should be noted that after modifying the Apache configuration file, you need to restart the Apache server.

Five, Apache support PHP

Apache supports php in 2 ways: One is Php5apache2_*.dll, the other is the load mod_fcgid mode.

this needs to see if the file exists php5apache2_*.dll the PHP directory. (in both ways, you need to install VC + + support package, these in the Apache official website has the hint, here does not do more introduction)

Php5apache2_*.dll Way:

Modify httpd.conf

Add to:

LoadModule php5_module "D:/winrar/php56/php5apache2_4.dll"

AddHandler application/x-httpd-php. php

# Configure the path to PHP.ini

Phpinidir "D:/winrar/php56"

Restart Apache to test accordingly .

mod_fcgid Way:

First Download mod_fcgid.so (Apache official website can be downloaded ) placed in the Apache modules directory

Modify httpd.conf

Add to:

Loadmodulefcgid_module modules/mod_fcgid.so

<IfModulemod_fcgid.c>

AddHandler fcgid-script. fcgi. php

Fcgidinitialenv PHPRC "D:/winrar/php56"

Fcgidinitialenv Php_fcgi_max_requests 1000

Fcgidmaxrequestsperprocess 1000

Fcgidmaxprocesses 5

Fcgidiotimeout 120

Fcgididletimeout 120

Fcgidwrapper "D:/winrar/php56/php-cgi.exe". php

AddType application/x-httpd-php. php

</IfModule>

under <directory , modify:

Options Indexes FollowSymLinks

For

Options indexesfollowsymlinks execcgi

Restart Apache for the appropriate test.

VI. Testing

<?php

Phpinfo ();

?>


Installing Apache under Windows

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.