VMware ESXi and vSphere Cluster Management

How to Install Apache HTTP Server on Windows

Learn how to download, configure, install, start, and verify Apache HTTP Server as a Windows service on 32-bit or 64-bit Windows.

Apache HTTP Server is a web server that receives HTTP requests and serves web pages and other web content. This guide explains how to install it locally on Windows, register it as a Windows service, start it, and verify it through localhost.

You should be comfortable navigating Windows folders, extracting ZIP archives, opening an elevated Command Prompt or Windows Terminal, and understanding basic HTTP concepts.

How Apache HTTP Server is distributed for Windows

The Apache HTTP Server project may provide source code rather than a ready-to-run official Windows installer. Windows users commonly install Apache from a third-party provider that publishes precompiled binaries.

Apache Lounge is an example of a community source for precompiled Apache HTTP Server binaries for Windows. Before downloading, confirm that the provider is trusted, the package is current and supported, and its build requirements are documented. Using an untrusted binary can create security risks, while using an incompatible build can prevent Apache from starting.

Download a ZIP archive that matches your Windows architecture and check the provider's notes for required Microsoft Visual C++ runtime libraries.

Determine Windows architecture

Apache packages are commonly labeled x64 for 64-bit Windows and x86 for 32-bit Windows. A 64-bit version of Windows normally uses the x64 Apache build.

  1. Open Settings.
  2. Select System, then About.
  3. Find System type. It will identify whether Windows is 64-bit or 32-bit.

You can also open System Information by searching for msinfo32, then inspect System Type. Choose the Apache package that matches the operating system architecture.

Install the required Visual C++ Redistributable

The Visual C++ Redistributable contains Microsoft runtime libraries required by many compiled Windows applications. Particular Apache builds may depend on a specific compatible runtime.

Do not assume that one Visual C++ version works for every Apache release. Read the selected binary provider's build requirements and install the appropriate redistributable before starting Apache:

  • Install the x64 redistributable for an x64 Apache build.
  • Install the x86 redistributable for an x86 Apache build.
  • Use the runtime version identified by the provider's dependency notes.

A missing or incompatible runtime can produce a missing DLL message or cause Apache to exit immediately.

Download and extract Apache

  1. Download the Windows ZIP archive for the correct architecture.
  2. Extract the archive. It should contain an Apache24 directory.
  3. Move or extract that directory to C:\Apache24.
  4. Confirm that C:\Apache24\bin\httpd.exe and C:\Apache24\conf\httpd.conf exist.

C:\Apache24 is the expected installation path used by the commands and examples in this guide. Apache uses ServerRoot as its installation base directory for resolving internal paths. If you install Apache elsewhere, update ServerRoot and any related paths in the configuration when they do not match the actual folder.

Understand the Apache directory layout

ComponentTypical locationPurpose

Apache executableC:\Apache24\bin\httpd.exe — Runs Apache, tests configuration, and manages the service.

Main configuration fileC:\Apache24\conf\httpd.conf — Apache's primary configuration file.

Document rootC:\Apache24\htdocs — The default directory for files served by the local website.

Log directoryC:\Apache24\logs — Contains access and error logs.

Windows service — Usually named Apache2 — A background application managed by Windows.

The DocumentRoot directive identifies the directory Apache serves by default. The default configuration normally points it to the htdocs directory.

Test the Apache configuration

A configuration syntax test checks whether Apache can read its configuration and whether directives, paths, and included files are valid. Run it before registering or starting the service.

  1. Open Command Prompt or Windows Terminal as administrator. Search for the terminal application, right-click it, and choose Run as administrator.
  2. Change to the Apache binary directory:
cd C:\Apache24\bin

Run the syntax test:

httpd.exe -t

A successful test reports that the syntax is OK. If the command identifies a file and line number, correct that configuration problem and repeat the test. Do not continue until the syntax test succeeds.

Install Apache as a Windows service

A Windows service is a background application managed by Windows. Registering Apache as a service lets you start and stop it through Windows or command-line tools.

From the elevated terminal already open in C:\Apache24\bin, run:

httpd.exe -k install

The default service is commonly named Apache2. A successful installation registers Apache with Windows, but it does not necessarily mean that the server is already responding to requests.

Start and manage the Apache service

Use the Services console

  1. Press Windows+R.
  2. Enter services.msc and press Enter.
  3. Locate the Apache service, commonly listed as Apache2.
  4. Right-click it and select Start.

Open the service's properties to configure its startup type. Select Automatic if Apache should start when Windows starts. Use Manual when you prefer to start it only when needed.

Use Apache's command-line controls

From the elevated Apache binary directory, use these commands:

httpd.exe -k start
httpd.exe -k stop
httpd.exe -k restart

These commands start, stop, or restart the registered Apache service. You can also use the Services console for the same operations and to inspect the current service status.

Verify Apache with localhost

localhost is the hostname for the local computer. With the default HTTP listener, open this address in a browser:

http://localhost/

The Apache default test page or a success message confirms that Apache is responding. The exact page can vary with the downloaded build and configuration.

You can optionally test from a local HTTP client:

curl http://localhost/

Serve a simple HTML page

  1. Create or replace C:\Apache24\htdocs\index.html.
  2. Add a simple page such as:
<!doctype html>
<html>
<head><title>Local Apache Test</title></head>
<body><h1>Apache is serving this page</h1></body>
</html>

Reload http://localhost/. Apache should serve the file from its default DocumentRoot, which is normally C:\Apache24\htdocs.

Resolve common installation and startup problems

SymptomLikely causeHow to diagnoseResolution

Apache fails because a runtime DLL is missing — The Visual C++ Redistributable is absent, has the wrong architecture, or is incompatible — Read the binary provider's dependency notes and inspect the Windows error message — Install the required x64 or x86 redistributable, then run httpd.exe -t again.

Service installation is denied — The terminal was not elevated — Check whether Command Prompt or Windows Terminal was opened with administrator privileges — Close it, reopen it with Run as administrator, and run httpd.exe -k install again.

Port 80 is already in use — IIS, World Wide Web Publishing Service, a Skype-like application, Docker-related services, or another web server is listening on port 80 — Run netstat -ano | findstr :80 and identify the process — Stop or reconfigure the conflicting service if appropriate, or change Apache to an unused port.

Configuration syntax test fails — An invalid directive, path, module reference, or location mismatch exists — Read the file name and line number reported by httpd.exe -t — Correct the directive or path, ensure ServerRoot matches the installation folder, and repeat the test.

localhost does not load — Apache is stopped, the listener uses another port, a firewall interferes, or a browser proxy is involved — Check the service, the Listen directive, the error log, and a local HTTP request — Start Apache, use the correct URL, review firewall rules, and inspect proxy settings.

Fix a port 80 conflict

Port 80 is the standard TCP port for HTTP traffic. Find the process currently using it:

netstat -ano | findstr :80

Use the process ID shown by the command to identify the owning application in Task Manager or through the relevant Windows service. Common conflicts include IIS, the World Wide Web Publishing Service, Skype-like applications, Docker-related services, and another web server.

If you cannot free port 80, edit C:\Apache24\conf\httpd.conf. Change:

Listen 80

to an unused port such as:

Listen 8080

Run the syntax test, restart Apache, and browse to:

http://localhost:8080/

Use the error log

Apache's error log is normally located at C:\Apache24\logs\error.log. It records startup failures, configuration problems, and request errors. Review the newest entries after a failed start or a failed local request.

Installation checklist

  • Windows architecture identified as x64 or x86.
  • Apache package selected from a trusted source and matched to that architecture.
  • Required Visual C++ Redistributable installed.
  • Apache24 extracted to C:\Apache24, or configuration paths updated for another location.
  • httpd.exe -t reports valid syntax.
  • Apache registered with httpd.exe -k install from an elevated terminal.
  • Apache service started through services.msc or httpd.exe -k start.
  • http://localhost/ loads, or the URL includes the configured alternative port.

After the basic installation works, you can continue with Apache HTTP Server setup on Windows and then configure features such as virtual hosts, a different document root, HTTPS, or PHP.