Sections:

Installing Apache 2.4 on Windows 10

Prerequisites

  1. Browse to https://www.apachelounge.com
  2. Click Downloads
  3. Make sure the VS16 is selected on the left navigation menu.
  4. 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.
  5. Run VC_redist.64.exe
  6. Install the Microsoft Visual C++ 2015-2022 Redistributable (x64) program
  7. After the install is sucessful, click the close button.

Download the correct version

  1. Browse to https://www.apachelounge.com
  2. Click Downloads
  3. Make sure the VS16 is selected on the left navigation menu.
  4. On the Apache Lounge website, locate the Apache 2.4 binaries VS16 section.
  5. Locate the green Apache 2.4 Win64 section.
  6. Click the http-2.4.x-win64-VS16.zip link to download the web server.

Extract

  1. Open the file. Click on the Extract All button.
  2. Set the "Files will be extracted to this folder" to C:\Apache24
  3. Click Extract
  4. Click the Search Icon. Type Command Prompt
  5. Right-click on the Command Prompt program.
  6. Choose Run as Administrator. When it prompts you, choose Yes.

Configure

  1. 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
  2. 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
  3. Save the file. Close Notepad.
  4. In the command prompt window, run:

    cd C:\Apache24\bin
  5. Start the webserver by running the following command in the Command Prompt window.

    httpd
  6. Browse to http://127.0.0.1
  7. 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
  8. 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.

  1. Starts Apache on startup. In the Command Prompt window, run:

    httpd -k install
  2. Confirm that you see a The 'Apache 2.4' service is successfully installed message.
  3. Start the web server.

    httpd -k start