If it can help you, please use your finger: like, comment, follow, thank you.
Before using Apache, you have to go to download, recommend directly to the official website download, address can be directly Baidu search “httpd. Apache”, the first is:
Click “Go” to download the appropriate version file, depending on your development environment. However, this website is like a maze, if you do not know English, be warned, easy to get lost.
After downloading the file and decompressing it, you are advised to place the Apache24 folder in the root directory of drive C or DRIVE D, and then add this path to the environment variables section of the system. Assuming I have drive D, then open the configuration file “D:\Apache24\conf”, named “httpd.conf”, using Notepad or any editor. The configuration file looks like this:
Part of the Apache2.4 configuration file httpd.conf
The configuration file mainly needs to be configured with the value and port of the root variable (${SRVROOT}). You can find the following two places in the configuration file (httpd.conf) :
Root directory variable
Default Port Configuration
In both cases, the value of the first root variable must be configured to change “/Apache24” to the full path of the Apache directory, such as the following (note that this is a slash “/ “, not a backslash “\”) :
After the root directory variable is configured
Then, the port number can default to port 80, but if your computer uses port 80, you need to change it to another port, or change the application that used port 80 on your computer.
Because, in most cases, any failure to install the service or start the service is caused by a port number, never doubt this.
Then, one last thing to note, in addition to the default port 80 for the Apache main program, is that the default port number for managing server authentication, HTTPD-SSL, is port 443. The default port number for httpD-ssl is port 80 or 443 if you install VM Ware. Open the “D:\Apache24\conf\extra” directory, then open the “httpd-ssl.conf” file, and modify it as follows:
Httpd-ssl Default port setting
Change to port 442:
Httpd-ssl port number changed to port 442
At this point, the basic configuration of Apache2.4 is complete. Next, you can perform operations on Apache in the command prompt (CMD) with administrator privileges. Here are some basic instructions:
HTTPD -k install ## Install Apache service HTTPD -k uninstall ## Net start Apache2.4 # # # # close service net stop Apache2.4 view port usage netstat ano # # to find specific port is which applications use netstat ano | findstr searches "443" # # must use double quotation marks, Single quotes no # # # according to the process for application tasklist | findstr searches "2048"Copy the code