Download, install, and configure the apache server

Source: Internet
Author: User

Download, install, and configure the apache server
1. Download: click the link under "Download" on the left side of apache to open the following page:

You can select a version here. I select 2.4.16 and click "2.4.16"
Click "Files for Microsoft Windows"
Click "APcheHaus"
Click the icon under "Download" in the red area above to Download the file. After downloading and decompressing the file, the directory is as follows.
2. the configuration is not downloaded. msi installation version, so we can not directly double-click the installation program to execute a silly installation, but we need to configure, the results after the configuration is the same as our installation market outlook, in fact, I think this method is simpler. The apache storage directory is used as an example. I want to put apache files under the root directory of drive D (you can certainly put them deeper ), the operation is to copy the folder Apache24 to the root directory of drive D. Do not use the remaining two files. When modifying the configuration file, open the conf folder under the Apache24 folder on disk D and use a text tool to open httpd. conf file, you can use Notepad, but we recommend using tools such as sublime, because these tools will display the line number for us to find. Find the 37 rows: ServerRoot "c:/Apache24" changed to ServerRoot "d:/Apache24", that is, change the address to the actual address where we store the apache24 folder to find the ServerAdmin admin@example.com of line 209, you can change it here or not. If you want to change it, you can change it to your mailbox. Change "ServerName www.example.com: 80" to "ServerName 127.0.0.1: 80" in line 218. In this example, the server is actually given an address and port number. If it is only for LAN access, the server is configured as 127.0.0.1, you can also change the port number 80 to another port to find the DocumentRoot "c:/Apache24/htdocs" in line 242 and change it to DocumentRoot "d:/Apache24/htdocs", but only a drive letter is changed. Change <Directory "c:/Apache24/htdocs"> to <Directory "d:/Apache24/htdocs"> In line 243, and change the drive letter. Change DirectoryIndex index.html of Row 3 to DirectoryIndex index.html index. php index.htm, but add the format of two other documents. Find the ScriptAlias/cgi-bin/"c:/Apache24/cgi-bin/" in line 359 and change it to ScriptAlias/cgi-bin/"d:/Apache24/cgi-bin /", only changed the drive letter. Change <Directory "c:/Apache24/cgi-bin"> to <Directory "d:/Apache24/cgi-bin"> and change the drive letter. So far, the related configuration has been changed. Start Apache and start running. Enter cmd to open the command window. Note that if it is a win8 or 8.1 system, open the command window at the command prompt (administrator. Enter d ", Press enter, enter cd Apache24, press enter to enter this directory, enter cd bin, press enter to enter the bin directory and enter httpd. If nothing is practical at this time, congratulations, all configurations in the previous step are successful. If the configuration fails, an error is displayed. The error may be
Then you need to install Microsoft Visual C ++ 2010 SP1 Redistributable Package (x64). If you have installed vs on your computer, this is already installed. If an error is still reported after installation, for example, MSVRUNTIME, you can download a Visual C ++ Redistributable for Visual Studio 2015 RC,: visual c ++ redistributable for visual studio 2015 rc, after installation, you can run the "httpd" command. After you add Apache to the system service and use the httpd command to start the apache service, the command window cannot be closed. Otherwise, the service will be stopped. Obviously, this is not user-friendly, we want to be the same as other programs, such as SQL server, as long as the service of this program has been started, this service will not survive, you don't have to open this command window every time and enter a series of commands above. First, close the command window, stop the Apache service, and start-run. Enter cmd. As shown above, the command window should be opened as an administrator, otherwise, access is denied. Enter d:, press enter to enter drive d, enter cd Apache24, press enter to enter this directory, enter cd bind, enter the bindirectory, enter httpd.exe-k install-n "ServerName", Press enter to add service, ServerName, is the name of the service you added to the service list, which can be customized. For example, I am using "apache"
If your service is successfully added, the blue service will appear in the service list. Now you have two ways to start the apache service. One is to open the command window, enter a series of commands (see the above), and the other is to start the service on this interface. Now, the download and configuration of the apache server are complete!


Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

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.