Installation and configuration of Apache2.4-win64 and start-up services under Win7

Source: Internet
Author: User

Recently began to learn web development, first installed Apache server, a lot of similar tutorials on the internet, but for the novice is not detailed enough, the installation process to make a detailed record, one as their own notes, but also want to help some friends to inspire.

Software download address in the screenshot, you need to point out that if there is no installation VC14 need to install, otherwise it will be wrong, in fact, the Web page has also been prompted.

http://www.apachelounge.com/download/


Unzip the downloaded file to the directory you want to install. I take D:\Myenv\Apache24 as an example.

Open D:\Myenv\Apache24\conf\httpd.conf with Notepad and prepare to modify the Apache configuration file.

Line 37th, key words: ServerRoot "C:/apache24" This is the installation directory of Apache, according to their actual situation (unpack to write what) fill in, here I fill out "D:/myenv/apache24".
Note: Remember that when you add a path value to the Apache configuration file in a Windows environment, all backslashes, such as C:\directory\file.ext, should be converted to forward slashes: C:/directory/file.ext.


Key words: ServerAdmin admin@example.com This is the Apache administrator email address, change does not matter.
Key words: #ServerName www.example.com:80 This is Apache server address, the front of the "#" removed, "www.example.com" changed to "localhost."


Key words: DocumentRoot "C:/apache24/htdocs" This is the root directory of the site, you will be a good page to put in the directory, you can modify your own.
Key words: <directory "C:/apache24/htdocs" > This is also the site root directory, but must be changed to the same as above, otherwise unable to open the Web site.
Note: The directory you fill in must have been created (must exist), or it will be an error.


Tags: scriptalias/cgi-bin/"c:/apache24/cgi-bin/" This is the Apache server's key file directory, to modify their Apache installation directory under the "Cgi-bin" folder.
Key words: <directory "C:/apache24/cgi-bin" > the same as the previous step, also changed to the same.


At this point, the Apache 2.4 configuration is complete.
You can open the "httpd.exe" test server in the "Bin" folder in the Apache installation directory, and if it flashes, your profile is problematic. If you open an empty command prompt, congratulations.
Do not close this command prompt, open the browser, enter "localhost" in the Address bar, return, if the "It works!" is displayed Indicates that your server configuration is successful.

Note: If the VC14 is not installed, an error is shown here.


The next step is to add Apache services to the system services.

Close the Command window of the previous step, start----run-----cmd, enter the Apapche bin directory, the command to join the service is: httpd.exe-k install-n "ServiceName", ServiceName is the name of Apache in Windows services. For example: Httpd.exe-k install-n "localhost"
Input httpd.exe-k install-n "localhost" will have a successful installation of the prompts, "services" will also have localhost this service item.



If you want to uninstall this service, first stop the service, and then enter Httpd.exe-k uninstall-n "Apache24" Uninstall the service.

There are two ways to start Apache this time:

1, in the system services to start, after starting in the browser input localhost will appear it works.

2, you can control this Apache by the ApacheMonitor.exe under the Apache24\bin folder. The taskbar will also have the convenience of displaying this software to manage Apache running.

At this point, the Apache installation configuration has started.

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.