Sections:
Installing Apache 2.4 on Windows 10
Prerequisites
- Browse to https://www.apachelounge.com
- Click Downloads
- Make sure the VS16 is selected on the left navigation menu.
- In the "Apache 2.4 VS16 Windows Binaries and Modules" section, there is a link to vc_redist_x64. Click on that link to download the program.
- Run VC_redist.64.exe
- Install the Microsoft Visual C++ 2015-2022 Redistributable (x64) program
- After the install is sucessful, click the close button.
Download the correct version
- Browse to https://www.apachelounge.com
- Click Downloads
- Make sure the VS16 is selected on the left navigation menu.
- On the Apache Lounge website, locate the Apache 2.4 binaries VS16 section.
- Locate the green Apache 2.4 Win64 section.
- Click the http-2.4.x-win64-VS16.zip link to download the web server.
Extract
- Open the file. Click on the Extract All button.
- Set the "Files will be extracted to this folder" to C:\Apache24
- Click Extract
- Click the Search Icon. Type Command Prompt
- Right-click on the Command Prompt program.
- Choose Run as Administrator. When it prompts you, choose Yes.
Configure
- In the Command Prompt window, run the following commands:
xcopy /S /Y C:\Apache24\Apache24 C:\Apache24
rmdir /S /Q C:\Apache24\Apache24
notepad C:\Apache24\conf\httpd.conf
- In Notepad, search for
#ServerName
. Be sure that you are searching down. Change
#ServerName www.example.com:80
to
ServerName 127.0.0.1:80
- Save the file. Close Notepad.
- In the command prompt window, run:
cd C:\Apache24\bin
- Start the webserver by running the following command in the Command Prompt window.
httpd
- Browse to http://127.0.0.1
- Confirm that you can see. It Works! Note: Apache is configured to read files in the C:\Apache24\htdocs directory. This can be changed by adjusting the DocumentRoot and Directory values in httpd.conf
- In the Command Prompt window, stop the webserver by pressing Ctrl and C. It may take a second or two for the webserver to stop.
Install Apache as a Service
You must be running the Command Prompt window as an administrator.
- Starts Apache on startup. In the Command Prompt window, run:
httpd -k install
- Confirm that you see a The 'Apache 2.4' service is successfully installed message.
- Start the web server.
httpd -k start