1. First, download the installation package apache, and unzip to the specified directory. (Windows version) https://www.apachehaus.com/downloads/httpd-2.4.41-o111c-x64-vc15-r2.zip
2. Modify conf / httpd.conf configuration file
After 2.1SRVROOT changed apache directory
Define SRVROOT "F:\Apache24"
2.2 Changing port (optional)
Listen 33211
3. Create a service in windows
3.1 Note CMD window to use the windows open, otherwise it will report an error, lack of prompt access.
[SC] OpenService Failed 5 : Access Denied.
3.2 CMD navigate to apache installation directory bin directory, enter the following command to create a service, the service name for the -n parameter can be customized
httpd.exe -k install -n Apache2.4
3.2.1 If there is a conflict, change the Port port, usually port 443 is occupied, or custom port is not available, similar to what tips:
The the Installing ' Apache2.4 ' -Service of The ' Apache2.4 ' -Service IS successfully Installed. Testing the httpd.conf .... the Errors Reported here Wallpaper MUST BE-Service The corrected before CAN BE Started. (The OS 10048 ) of each socket address (protocol / network address / port) only once. : AH00072: make_sock: Could Not the bind to address [::]: 443 (the OS 10048 ) each socket address (protocol / network address / port) only once. : AH00072: make_sock: could not address the bind to 0.0 . 0.0 : 443 AH00451: NO Listening Sockets the Available, Shutting Down AH00015: Unable to Open logs
3.2.1.1 Close the specified port occupancy (apache or change in use is occupied port https://blog.csdn.net/kunga0814/article/details/53495005 )
Use netstat PID in CMD -ano query occupied port belongs, then open the Task Manager -> View details specified PID of the process, the right end of the process the process tree.
After re-run the install command.
Attached: Delete windows have been created following the service, you must have administrator privileges CMD
sc delete Apache2.4
4 start and stop apache service
net start Apache2.4 net stop Apache2.4