How to Install Apache HTTP Server on Windows Server 2025
Apache HTTP Server remains one of the most widely deployed web servers in the world, and running it on Windows Server 2025 is a practical option for teams that need a familiar open-source stack in a Windows environment. Unlike Linux distributions where Apache is available through package managers, Windows requires a manual installation using pre-compiled binaries from Apache Lounge, the community-maintained source for official Windows builds. This guide walks through a complete production-ready setup: extracting binaries, editing the core configuration file, installing Apache as a Windows service, configuring virtual hosts, enabling SSL, and verifying the deployment.
Prerequisites
- Windows Server 2025 with administrative privileges
- Microsoft Visual C++ Redistributable 2015–2022 (x64) installed — required by Apache Lounge builds
- A domain name or local hostname if you plan to configure virtual hosts
- An SSL certificate (self-signed or CA-issued) if HTTPS is required
- Windows Defender Firewall access to open ports 80 and 443
- Basic familiarity with the Windows command prompt or PowerShell
Step 1: Download the Apache Lounge Windows Build
Navigate to https://www.apachelounge.com/download/ in a browser. Download the latest Apache 2.4 Win64 ZIP archive (e.g., httpd-2.4.63-250207-win64-VS17.zip). Avoid the SourceForge or third-party mirrors — Apache Lounge is the canonical, regularly updated source for Windows binaries.
Also download and install the required Visual C++ Redistributable from Microsoft if it is not already present on the server:
# Check if VC++ Redistributable is installed
Get-ItemProperty HKLM:SOFTWAREMicrosoftVisualStudio14.0VCRuntimesx64 -ErrorAction SilentlyContinue
If the key is absent, download and run the installer from the official Microsoft Visual Studio downloads page before proceeding.
Step 2: Extract Apache to C:Apache24
Extract the ZIP archive. Inside you will find an Apache24 folder. Move this folder to the root of your C: drive so the path becomes exactly C:Apache24. Apache’s default configuration is hard-coded to this path, and using any other location requires updating multiple directives.
# Using PowerShell to extract and move
Expand-Archive -Path "$env:USERPROFILEDownloadshttpd-2.4.63-250207-win64-VS17.zip" -DestinationPath "C:"
# The result should be C:Apache24
Verify the directory structure:
C:Apache24
├── bin (httpd.exe and support utilities)
├── conf (httpd.conf and include files)
├── htdocs (default document root)
├── logs (access.log, error.log)
└── modules (.so module files)
Step 3: Configure httpd.conf
Open C:Apache24confhttpd.conf in a text editor with administrator privileges. The key directives to set for a baseline configuration are:
# Core identity and paths
ServerRoot "C:/Apache24"
ServerName yourdomain.com:80
Listen 80
# Document root
DocumentRoot "C:/Apache24/htdocs"
<Directory "C:/Apache24/htdocs">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
# Logging
ErrorLog "logs/error.log"
CustomLog "logs/access.log" combined
# Include virtual hosts file
Include conf/extra/httpd-vhosts.conf
Note that Apache on Windows uses forward slashes in paths even though Windows normally uses backslashes. Enable mod_rewrite by uncommenting the following line:
LoadModule rewrite_module modules/mod_rewrite.so
For SSL support, also uncomment:
LoadModule ssl_module modules/mod_ssl.so
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
Include conf/extra/httpd-ssl.conf
Step 4: Install Apache as a Windows Service
Open an elevated command prompt (Run as Administrator) and run the following command from the Apache bin directory:
cd C:Apache24bin
httpd.exe -k install
Apache registers itself as a Windows service named Apache2.4. Verify the installation and test the configuration before starting:
# Test configuration syntax
httpd.exe -t
# Start the service
net start Apache2.4
# Stop the service
net stop Apache2.4
# Restart the service
net stop Apache2.4 && net start Apache2.4
# Alternatively, use sc.exe for more control
sc start Apache2.4
sc stop Apache2.4
sc query Apache2.4
Set the service to start automatically on boot:
sc config Apache2.4 start= auto
Step 5: Configure Virtual Hosts
Open C:Apache24confextrahttpd-vhosts.conf and define your virtual hosts. Comment out or remove the example placeholder entries first, then add your own:
# Default catch-all virtual host
<VirtualHost *:80>
ServerName default
DocumentRoot "C:/Apache24/htdocs"
<Directory "C:/Apache24/htdocs">
AllowOverride All
Require all granted
</Directory>
ErrorLog "logs/default-error.log"
CustomLog "logs/default-access.log" combined
</VirtualHost>
# Site-specific virtual host
<VirtualHost *:80>
ServerName www.example.com
ServerAlias example.com
DocumentRoot "C:/Sites/example"
<Directory "C:/Sites/example">
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog "logs/example-error.log"
CustomLog "logs/example-access.log" combined
</VirtualHost>
Step 6: Configure SSL
Place your certificate files in C:Apache24confssl (create this directory if needed). Edit C:Apache24confextrahttpd-ssl.conf and locate the default SSL virtual host block:
<VirtualHost *:443>
ServerName www.example.com:443
DocumentRoot "C:/Sites/example"
SSLEngine on
SSLCertificateFile "C:/Apache24/conf/ssl/example.crt"
SSLCertificateKeyFile "C:/Apache24/conf/ssl/example.key"
SSLCertificateChainFile "C:/Apache24/conf/ssl/ca-bundle.crt"
SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1
SSLCipherSuite HIGH:!aNULL:!MD5:!RC4
SSLHonorCipherOrder on
<Directory "C:/Sites/example">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Force HTTP to HTTPS by adding a redirect in the HTTP virtual host block:
<VirtualHost *:80>
ServerName www.example.com
Redirect permanent / https://www.example.com/
</VirtualHost>
Step 7: Open Firewall Ports and Test
Open Windows Defender Firewall to allow inbound traffic on ports 80 and 443:
# Allow HTTP
netsh advfirewall firewall add rule name="Apache HTTP" protocol=TCP dir=in localport=80 action=allow
# Allow HTTPS
netsh advfirewall firewall add rule name="Apache HTTPS" protocol=TCP dir=in localport=443 action=allow
Test the configuration and restart Apache to apply all changes:
C:Apache24binhttpd.exe -t
net stop Apache2.4 && net start Apache2.4
Open a browser and navigate to http://localhost. You should see the Apache “It works!” default page from C:Apache24htdocsindex.html. For virtual host testing on a single machine, add entries to C:WindowsSystem32driversetchosts pointing your test domain to 127.0.0.1.
Conclusion
You now have a fully functional Apache HTTP Server running as a Windows service on Windows Server 2025 with virtual host support, mod_rewrite enabled, and SSL configured. This setup is suitable for serving static sites, PHP applications (with mod_php or PHP-FPM via mod_proxy_fcgi), and as a reverse proxy frontend. For ongoing maintenance, check the Apache Lounge download page regularly for security updates, and always run httpd.exe -t after any configuration change before restarting the service to catch syntax errors before they take the server down.