How to Install Apache HTTP Server on Windows
Learn how to install Apache HTTP Server on Windows, choose the correct binary and runtime, register the service, start it, and verify localhost.
Apache HTTP Server is web-server software that accepts HTTP requests and serves web content. On Windows, the usual installation method is to download a compiled Windows binary distribution, install its required Microsoft Visual C++ runtime, extract the ZIP archive, and register Apache as a Windows service.
This guide covers a typical Apache 2.4 installation for local development and testing. Basic Windows file navigation, ZIP extraction, administrator terminals, and local browser URLs are helpful prerequisites.
How Apache Is Distributed for Windows
The Apache HTTP Server project provides source code, but Windows users commonly install Apache from a third-party provider that compiles that source into a Windows binary package. Source code is not the same as a ready-to-run Windows distribution: source code must be compiled, while a binary package includes executables such as httpd.exe.
Apache Lounge is one community source of compiled Apache HTTP Server packages for Windows. Before downloading, evaluate the provider, package integrity, release information, and stated build requirements. Download only from a source you trust, and check any available checksums or signatures according to that provider's instructions.
For background, see What Is Apache HTTP Server and What Is a Web Server.
1. Select the Correct Apache Package
Apache packages are built for a specific processor architecture:
| Windows architecture | Apache package | Typical use |
|---|---|---|
| 64-bit (x64) | 64-bit Apache build | The normal choice for most current Windows installations |
| 32-bit (x86) | 32-bit Apache build | Older 32-bit Windows systems or a specific compatibility requirement |
To identify the architecture, open Settings, choose System, then About, and inspect System type. You can also search Windows for System Information and inspect the system type there.
- Confirm whether Windows is x64 or x86.
- Select a matching Apache HTTP Server ZIP distribution from the chosen Windows binary provider.
- Read the package notes before installing. They should identify the compiler version and required Microsoft runtime.
2. Install the Microsoft Visual C++ Runtime
Compiled Apache Windows builds may depend on Microsoft Visual C++ Redistributable runtime libraries. If the required runtime is missing, Apache may fail to launch because a runtime DLL cannot be found.
- Read the selected binary provider's build requirements.
- Install the specified Microsoft Visual C++ Redistributable before starting Apache.
- Match the redistributable architecture to Apache: x64 for an x64 build, or x86 for an x86 build.
Newer Apache builds can require a different Visual C++ Redistributable version from older builds. Do not assume that a runtime used by an older package is sufficient; follow the requirements for the exact package you downloaded.
3. Extract Apache to a Simple Directory
Use File Explorer or another Windows-compatible archive utility to extract the downloaded ZIP file. A conventional installation path is:
C:\Apache24
After extraction, the installation should contain directories similar to these:
C:\Apache24
├── bin
├── conf
├── htdocs
├── logs
└── modules
The executable, configuration, document root, and logs should be directly below C:\Apache24. Avoid accidentally creating a duplicated path such as C:\Apache24\Apache24 when the package configuration expects C:\Apache24.
| Component | Typical location or source | Purpose |
|---|---|---|
| Apache ZIP distribution | Selected Windows binary provider | Precompiled Apache files for Windows |
| Visual C++ Redistributable | Microsoft runtime package specified by the build provider | Runtime libraries required by the compiled Apache executable |
bin\httpd.exe | C:\Apache24\bin\httpd.exe | Apache HTTP Server executable and administration commands |
conf\httpd.conf | C:\Apache24\conf\httpd.conf | Primary Apache configuration file |
htdocs | C:\Apache24\htdocs | Default document root for web files |
logs\error.log | C:\Apache24\logs\error.log | Startup and runtime error information |
| Windows Services console | services.msc | Graphical management of the Apache background service |
4. Understand the Installation Layout
bin: Contains administrative programs, includinghttpd.exe.conf: Contains Apache configuration files. The main file ishttpd.conf.htdocs: The default document root, where Apache looks for a testindex.html.logs: Contains request and diagnostic logs.error.logis the primary file for startup problems.modules: Contains loadable Apache modules supplied by the distribution.
Apache's ServerRoot setting identifies the installation base. It must agree with the directory where Apache was extracted. The Listen directive controls the network address and port; the conventional default for unencrypted HTTP is port 80. The document-root setting identifies where local website files are served.
For configuration-file concepts, see Configuration Files.
5. Register Apache as a Windows Service
A Windows service is a background process registered with Windows. Once Apache is registered, it can be controlled from the Services console and can optionally be configured to start automatically with Windows.
- Open Command Prompt or PowerShell with Run as administrator. An elevated terminal is required for service registration.
- Change to the Apache executable directory:
cd C:\Apache24\bin
In an elevated Command Prompt, register the service:
httpd.exe -k install
The command must be run where httpd.exe is present, unless its full path is supplied. After successful registration, Apache should appear in Windows Services. The service name and display name can depend on the package and installation state.
6. Start and Manage Apache
Open the Services management console by pressing Windows + R, entering the following command, and pressing Enter:
services.msc
- Locate the Apache service created during registration.
- Open its context menu and choose Start.
- Confirm that its status changes to Running.
You can also control a registered Apache service from an elevated terminal in C:\Apache24\bin:
httpd.exe -k start
httpd.exe -k stop
httpd.exe -k restart
-k startrequests that the service start.-k stoprequests that the service stop.-k restartrestarts Apache so configuration changes can take effect.
7. Verify the Installation
- Start the Apache service.
- Open a browser on the same computer.
- Request:
http://localhost/
localhost refers to the computer running the browser. A default Apache welcome page or test response shows that Apache is listening and serving content.
To test the document root, create or replace this file:
C:\Apache24\htdocs\index.html
For example:
<!doctype html>
<html>
<head><title>Local Apache Test</title></head>
<body><h1>Apache is serving this page</h1></body>
</html>
Refresh http://localhost/. If the new page appears, Apache is serving files from the expected document root.
Common Installation Checks
| Check | How to perform it | Successful outcome |
|---|---|---|
| Correct architecture selected | Compare Windows system type with the Apache package architecture | The package and operating system are compatible |
| Required Visual C++ runtime installed | Review the provider's requirements and installed Microsoft runtimes | Apache can load its required runtime libraries |
| Apache configuration syntax valid | Run httpd.exe -t from C:\Apache24\bin | Apache reports Syntax OK |
| Apache service running | Check the service in services.msc | The service status is Running |
| Local HTTP response available | Open http://localhost/ | The default or custom page is returned |
Troubleshooting
Apache reports a missing runtime DLL
Review the binary provider's runtime requirement and confirm whether the package is x86 or x64. Install the matching Microsoft Visual C++ Redistributable, then try starting Apache again.
The service cannot be installed
- Confirm that the terminal was opened with administrator privileges.
- Run
cd C:\Apache24\binand verify thathttpd.exeis present. - Open
services.mscand check whether a service with the same name already exists.
Correct the permissions, path, or service-name conflict before repeating httpd.exe -k install.
The service stops immediately
Test the configuration syntax:
cd C:\Apache24\bin
httpd.exe -t
Fix any reported syntax error. Also inspect C:\Apache24\logs\error.log, verify that ServerRoot matches C:\Apache24, and check the Listen directive. Another application may already be using port 80.
Localhost does not open
- Verify that the Apache service is running in
services.msc. - Check whether Apache listens on port 80 or another port.
- If the configured port is different, request it explicitly, for example
http://localhost:8080/. - Review
error.log, local firewall settings, and other web servers that might interfere.
The browser displays an unexpected site
A different web server may own port 80, or the Apache document root may contain different files than expected. Check which service owns the HTTP port, inspect the document-root setting, and review the contents of C:\Apache24\htdocs.
Basic Post-Installation Awareness
The main configuration file is C:\Apache24\conf\httpd.conf. You do not need to redesign it for a basic installation, but three settings are especially important:
ServerRoot: Must point to the actual Apache installation directory.Listen: Defines the address and port where Apache accepts HTTP connections. Port 80 is the conventional default.- Document root: Identifies the directory from which web files are served; the default is commonly
C:\Apache24\htdocs.
Make a backup before editing configuration files. After changes, run httpd.exe -t and restart Apache. Apache access and error logs are useful for diagnosing requests and startup failures; see Log Files: Access Log and Error Log.
Installation Summary
- Identify whether Windows is x64 or x86.
- Download a matching Apache HTTP Server ZIP binary from a trusted Windows provider.
- Install the Visual C++ Redistributable required by that build and match its architecture.
- Extract Apache so its files are directly under
C:\Apache24. - Open an elevated terminal and run
httpd.exe -k installfromC:\Apache24\bin. - Start the Apache service through
services.mscorhttpd.exe -k start. - Open
http://localhost/and replaceC:\Apache24\htdocs\index.htmlwith a test page if desired.