Step 1: Select a binary package provider for Apache for Windows from https://httpd.apache.org/docs/current/platform/windows.html#down.
Step 2: In this tutorial, select Apache Lounge, and then download the following packages from https://www.apachelounge.com/download/.
-
Visual C++ Redistributable for Visual Studio 2015 - 2019: https://aka.ms/vs/16/release/VC_redist.x64.exe
-
Apache 2.4.47 Win64: https://www.apachelounge.com/download/VS16/binaries/httpd-2.4.47-win64-VS16.zip
Step 3: Double click VC_redist.x64.exe to install the Visual C++ Redistributable first.
Step 4: Unzip the httpd-2.4.47-win64-VS16.zip file and place the Apache24 folder under the C drive ("C:\Apache24" is the default ServerRoot in conf\httpd.conf; and the default folder for web files is DocumentRoot "C:\Apache24\htdocs"). If you place the Apache24 folder to another location, change the following setting accordingly.
Define SRVROOT "c:/Apache24"
Note
Paths in httpd.conf and other configuration files must be specified using forward slashes ("/") instead of back slashes ("\").
You could also change the IP address, port number, server name etc. in httpd.conf rather than using the default values.
Tip: In Windows, you can execute the command "netstat -ano | findstr portnumber" to check if the port number is occupied by any other program. For how to verify if a port number is occupied, follow the instructions in Choosing an appropriate port number.
Step 5: Open the command prompt window, go to the C:\Apache24\bin folder, and run the Apache HTTP server.
cd C:\Apache24\bin httpd.exe
Step 6: Test the Apache HTTP server by opening up a Web browser and typing in the address: http://localhost.
The following message indicates the Apache HTTP server is working properly.
You can further test from the development PC by typing http://your_server_ip in a browser.
The Using Apache HTTP Server on Microsoft Windows page has more detailed documentation about using Apache on Windows.