Apache HTTP Server 2.4 with SSL on Windows Server 2025 on Azure User Guide
Overview
This guide covers the deployment and use of Apache HTTP Server with SSL on Windows Server 2025 on Microsoft Azure, using cloudimg's virtual machine image from the Azure Marketplace.
Apache HTTP Server is the Apache Software Foundation's open source (Apache License 2.0) web server. This image runs it as a Windows service that serves your site over HTTPS from the first boot of your VM: every VM makes its own TLS key and certificate when it first starts, plain HTTP requests are redirected to HTTPS, and only TLS 1.2 and TLS 1.3 are accepted. Put your site in the web root, or swap in a certificate from a public certificate authority, and it is ready for the internet.
The image is Microsoft Windows Server 2025 Datacenter with the Desktop Experience (the full graphical interface), Gen2, x64, built from Microsoft's own image on the Azure Marketplace (MicrosoftWindowsServer:WindowsServer:2025-datacenter-g2, version 26100.33828.261112). The Windows Server licence is included in the VM price and billed by Microsoft.
What's included:
- Apache HTTP Server 2.4.71 for Windows (64-bit), the Apache Lounge build (Visual Studio 2026, OpenSSL 3.5.9), its checksum verified when the image was built, in
C:\Program Files\Apache24\, with the Microsoft Visual C++ runtime it needs - Apache running as the Windows service Apache2.4 under its own virtual service account NT SERVICE\Apache2.4, never LocalSystem: started at boot and restarted if it ever stops
- HTTPS on port 443 with HTTP/2, using this VM's own 3072-bit RSA key and self-signed certificate, made at the first boot of your VM. No key ships in the image, so no two VMs share one. The private key is readable only by SYSTEM, Administrators and the Apache service account
- HTTP on port 80, answering every request with a permanent redirect (301) to the same address over HTTPS
- TLS 1.2 and TLS 1.3 only, with forward-secret AEAD ciphers (the Mozilla "intermediate" profile); SSL 3.0, TLS 1.0 and TLS 1.1 are refused
- Hardened defaults: the
Serverheader says onlyApache(no version, no operating system), no server signature on error pages,TRACErefused, no directory listings, no/cgi-bin/and noserver-statusorserver-infopages - Windows Firewall rules Apache HTTP Server (HTTP-In) and Apache HTTP Server (HTTPS-In), allowing ports 80 and 443 in for
httpd.exe - Windows Server 2025 Datacenter, Desktop Experience, version 24H2, build 26100.33828, with Microsoft's November 2026 cumulative update. Windows Update ran during the build and reported nothing pending when the image was captured on 3 December 2026
- The Azure VM agent, so Azure features such as Reset password and Run command work
- Accelerated networking supported (on sizes that offer it), Trusted Launch and NVMe sizes supported
- cloudimg's support team is on hand 24 hours a day by email (support@cloudimg.co.uk), with a guaranteed response within 24 hours
Platform: Microsoft Azure (Gen2 Hyper-V; Trusted Launch, NVMe and accelerated networking supported)
Administrator account: the user name and password you choose when you deploy the VM. There is no default Windows password on this image.
Configuration: C:\Program Files\Apache24\conf\extra\httpd-cloudimg.conf (the HTTP and HTTPS sites) and C:\Program Files\Apache24\conf\httpd.conf
Prerequisites
- An Azure subscription
- A Remote Desktop client: Remote Desktop Connection (
mstsc) on Windows, Windows App (formerly Microsoft Remote Desktop) on macOS, or Remmina on Linux - The public IP address of the machine you will connect from, so you can allow Remote Desktop from that address only
Recommended size: Standard_B2ms (2 vCPUs, 8 GiB memory). Apache itself used about 32 MB of memory (its two httpd processes) on a new VM; choose a larger size for a busy site.
Step 1: Deploy the Virtual Machine
Option A: Azure Portal
- In the Azure Marketplace, search for "Apache HTTP Server with SSL on Windows Server 2025 cloudimg"
- Select the offer and click Create
- Configure the basics:
- Subscription and Resource group: select or create
- Virtual machine name and Region: your choice
- Size:
Standard_B2msrecommended - Under Administrator account, enter a Username and a Password that you choose. Azure refuses reserved names such as "administrator", "admin" and "guest"
- Under Inbound port rules, allow RDP (3389), HTTPS (443) and HTTP (80). Azure opens all three to the whole internet; ports 443 and 80 are meant to be public for a web server, but restrict 3389 straight after deployment (step 7)
- Click Review + create, then Create
- When the deployment finishes, open the VM's Networking (Network settings) page and edit the inbound rule for port 3389: set Source to My IP address (or your office or VPN address range)
Note the VM's Public IP address on its Overview page.
Option B: Azure CLI
Accept the offer terms once per subscription, then create the VM with no inbound rules. Leave out --admin-password and the CLI asks for the password, which keeps it out of your shell history:
az vm image terms accept --urn cloudimg1647283583153:apache-httpd-ssl-windows-server:default:latest
az vm create \
--resource-group myResourceGroup \
--name my-apache \
--image cloudimg1647283583153:apache-httpd-ssl-windows-server:default:latest \
--size Standard_B2ms \
--admin-username <your-admin-name> \
--public-ip-sku Standard \
--nsg-rule NONE
Then allow Remote Desktop from your own address only, HTTPS and HTTP from anywhere, and read the VM's public address:
az network nsg rule create \
--resource-group myResourceGroup \
--nsg-name my-apacheNSG \
--name allow-rdp-from-my-ip \
--priority 1000 \
--direction Inbound --access Allow --protocol Tcp \
--destination-port-ranges 3389 \
--source-address-prefixes <your-public-ip>/32
az network nsg rule create \
--resource-group myResourceGroup \
--nsg-name my-apacheNSG \
--name allow-web \
--priority 1010 \
--direction Inbound --access Allow --protocol Tcp \
--destination-port-ranges 443 80 \
--source-address-prefixes Internet
az vm show -d --resource-group myResourceGroup --name my-apache --query publicIps -o tsv
While you are still building your site, use --source-address-prefixes <your-public-ip>/32 in the second rule too, and open it to Internet when you go live.
Step 2: Connect with Remote Desktop
- Open your Remote Desktop client and connect to the VM's public IP address
- Windows: run
mstsc, enter the IP address and click Connect - macOS: in Windows App, add a PC with the IP address
- Linux: in Remmina, create an RDP connection to the IP address
- When asked for credentials, sign in as
<vm-name>\<your-admin-name>with the password you set at deployment. On Windows, choose More choices, then Use a different account - Accept the certificate warning: the VM uses a self-signed Remote Desktop certificate
Windows may show its privacy settings screen at your first sign-in; choose your settings and click Accept.
Apache does not need you to stay signed in: it runs as a Windows service from the moment the VM starts. It shows in Services (services.msc) as Apache2.4: Running, Automatic, logging on as NT SERVICE\Apache2.4.

Step 3: Check that Apache is running
Open Windows PowerShell as administrator (right-click the Start button, then Terminal (Admin)) and run:
Get-Content C:\ProgramData\Apache24\cloudimg-firstboot.done
Get-CimInstance Win32_Service -Filter "Name='Apache2.4'" | Format-Table Name, State, StartMode, StartName -AutoSize
Get-NetTCPConnection -State Listen -LocalPort 80, 443 | Sort-Object LocalPort | Format-Table LocalAddress, LocalPort, @{n='Process';e={(Get-Process -Id $_.OwningProcess).ProcessName}} -AutoSize
& 'C:\Program Files\Apache24\bin\httpd.exe' -v
& 'C:\Program Files\Apache24\bin\httpd.exe' -t 2>&1 | ForEach-Object { "$_" }
done 2026-12-03T09:08:29.4002289Z cert_sha256=f6109cfb8b275dde9b74134ee582194c1b9452c07b25bfcfb7f0b647267460d1
Name State StartMode StartName
---- ----- --------- ---------
Apache2.4 Running Auto NT SERVICE\Apache2.4
LocalAddress LocalPort Process
------------ --------- -------
0.0.0.0 80 httpd
:: 80 httpd
:: 443 httpd
0.0.0.0 443 httpd
Server version: Apache/2.4.71 (Win64)
Apache Lounge VS18 Server built: Nov 11 2026 08:56:23
Syntax OK
The first line is written when the one-time first-boot task has made this VM's certificate and checked that Apache answers; cert_sha256 is your VM's own certificate fingerprint, so it differs on every VM. httpd -t checks the configuration: Syntax OK.

Step 4: See HTTPS, the redirect and the TLS versions
The image includes curl.exe in Apache's bin folder (Windows' own curl.exe cannot pin a certificate file). Ask Apache for its page over HTTPS, trusting exactly this VM's certificate, then try plain HTTP, TLS 1.3 and the old TLS 1.1:
$curl = 'C:\Program Files\Apache24\bin\curl.exe'
& $curl -sI --cacert C:\ProgramData\Apache24\server.crt https://localhost/
& $curl -sI http://localhost/docs/?page=2
& $curl -s -o NUL --tlsv1.3 --cacert C:\ProgramData\Apache24\server.crt -w "TLS 1.3 -> HTTP/%{http_version} %{http_code}`n" https://localhost/
& $curl -sS -o NUL --tlsv1.1 --tls-max 1.1 --ciphers DEFAULT@SECLEVEL=0 --cacert C:\ProgramData\Apache24\server.crt https://localhost/ 2>&1 | ForEach-Object { "$_" }
HTTP/2 200
last-modified: Thu, 03 Dec 2026 08:25:01 GMT
etag: "595-661b67ef0f4ae"
accept-ranges: bytes
content-length: 1429
content-type: text/html
date: Thu, 03 Dec 2026 09:14:45 GMT
server: Apache
HTTP/1.1 301 Moved Permanently
Date: Thu, 03 Dec 2026 09:14:45 GMT
Server: Apache
Location: https://localhost/docs/?page=2
Content-Type: text/html; charset=iso-8859-1
TLS 1.3 -> HTTP/2 200
curl: (35) TLS connect error: error:0A00042E:SSL routines::tlsv1 alert protocol version
- HTTPS answers
200over HTTP/2, and theserverheader gives no version or operating system - HTTP answers
301with the same path and query onhttps://, so links and bookmarks tohttp://keep working - TLS 1.3 works; TLS 1.1 is refused by the server ("protocol version"), even though curl offered it with every old cipher allowed

Step 5: Open your site in a browser
From your own computer, browse to https://<public-ip>/ (or http://<public-ip>/, which takes you to HTTPS). Your browser warns that the connection is not private, or that the certificate is not trusted: the certificate is this VM's own self-signed one, which no browser trusts until you tell it to. That is expected until you use a certificate from a public certificate authority (Step 7) or trust this one (Step 6).
Before you accept the warning, check it is your VM's certificate: open the certificate details from the browser's address bar and compare its SHA-256 fingerprint with the SHA256Fingerprint line in C:\ProgramData\Apache24\apache-tls.txt (Step 6).
The image's start page then shows where everything is:

Step 6: This VM's certificate
The first boot of your VM made a 3072-bit RSA key and a self-signed certificate valid for 825 days, named for the VM (its computer name, localhost, 127.0.0.1 and the VM's private IP addresses). apache-tls.txt describes them; it is readable by any user of the VM, and holds no secret:
Select-String -Path C:\ProgramData\Apache24\apache-tls.txt -Pattern '^(NotAfter|SHA256Fingerprint|Certificate|PrivateKey)=' | ForEach-Object { $_.Line }
(Get-Acl C:\ProgramData\Apache24\server.key).Access | Format-Table IdentityReference, FileSystemRights, AccessControlType -AutoSize
Select-String -Path 'C:\Program Files\Apache24\conf\extra\httpd-cloudimg.conf' -Pattern '^\s*(SSLProtocol|Protocols|SSLCertificate|RewriteRule)' | ForEach-Object { $_.Line.Trim() }
NotAfter=2029-03-07 09:03 UTC
SHA256Fingerprint=F6:10:9C:FB:8B:27:5D:DE:9B:74:13:4E:E5:82:19:4C:1B:94:52:C0:7B:25:BF:CF:B7:F0:B6:47:26:74:60:D1
Certificate=C:\ProgramData\Apache24\server.crt
PrivateKey=C:\ProgramData\Apache24\server.key (readable by SYSTEM, Administrators and NT SERVICE\Apache2.4 only)
IdentityReference FileSystemRights AccessControlType
----------------- ---------------- -----------------
NT AUTHORITY\SYSTEM FullControl Allow
BUILTIN\Administrators FullControl Allow
NT SERVICE\Apache2.4 Read, Synchronize Allow
SSLProtocol -all +TLSv1.2 +TLSv1.3
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
Protocols h2 http/1.1
SSLCertificateFile "C:/ProgramData/Apache24/server.crt"
SSLCertificateKeyFile "C:/ProgramData/Apache24/server.key"

To trust this certificate on a Windows machine of your own (for testing or an internal site), copy C:\ProgramData\Apache24\server.crt to it (the certificate only: never copy server.key), then, in an elevated PowerShell window there:
Import-Certificate -FilePath .\server.crt -CertStoreLocation Cert:\LocalMachine\Root
Edge and Chrome on that machine then trust the VM by its computer name or private IP address, from machines that can reach it by those (in its virtual network, or over a VPN). A name the certificate does not hold, such as the public IP address, still gets a name warning: for a public site, use a certificate from a public certificate authority.
Step 7: Use a certificate from a public certificate authority
For a public site, point a DNS name (for example www.example.com) at the VM's public IP address, and get a certificate for that name from a certificate authority. Apache needs two PEM files:
- the certificate, followed by the authority's intermediate certificates in the same file (the "full chain")
- the private key, unencrypted (a Windows service cannot ask for a passphrase)
Copy both into C:\ProgramData\Apache24\. A file copied into that folder takes the folder's permissions: SYSTEM and Administrators full control, and read for NT SERVICE\Apache2.4 only. Then open C:\Program Files\Apache24\conf\extra\httpd-cloudimg.conf in Notepad (as administrator), change the two certificate paths in the <VirtualHost _default_:443> section, and add your name:
<VirtualHost _default_:443>
ServerName www.example.com
DocumentRoot "${SRVROOT}/htdocs"
Protocols h2 http/1.1
SSLEngine on
SSLCertificateFile "C:/ProgramData/Apache24/www.example.com.crt"
SSLCertificateKeyFile "C:/ProgramData/Apache24/www.example.com.key"
...
Use forward slashes in the paths, as Apache does on Windows. Check the configuration, then restart Apache:
& 'C:\Program Files\Apache24\bin\httpd.exe' -t 2>&1 | ForEach-Object { "$_" }
Restart-Service Apache2.4
Syntax OK
WARNING: Waiting for service 'Apache2.4 (Apache2.4)' to stop...
The warning is PowerShell waiting while Apache finishes its open connections; it is not an error. If httpd -t reports a problem, fix it before restarting: Apache will not start with a configuration it cannot read. Remember to renew the certificate before it expires, and repeat these steps (or copy the renewed files over the old ones and restart).
Step 8: Publish your site
The web root is C:\Program Files\Apache24\htdocs\. Replace index.html there with your own site (or copy your files in beside it); Apache serves new files at once, with no restart. Directory listings are off, so a folder with no index.html answers 403 Forbidden rather than showing its files.

Settings for the whole server (modules, the web root's options) are in C:\Program Files\Apache24\conf\httpd.conf; the HTTP and HTTPS sites and their TLS settings are in conf\extra\httpd-cloudimg.conf, shown above. After any change to either, run httpd -t and Restart-Service Apache2.4 (Step 7). The full Apache 2.4 manual is at httpd.apache.org/docs/2.4, and also installed in C:\Program Files\Apache24\manual\.
Step 9: Keeping Windows and Apache up to date
Windows: Windows Update is on, as in Microsoft's image. Check for updates in Settings > Windows Update, and plan restarts: Apache starts again by itself after a restart, and your site is unavailable while the VM restarts.
Apache: the Apache Software Foundation publishes new 2.4 releases and their security fixes at httpd.apache.org, and Apache Lounge publishes the Windows builds at www.apachelounge.com/download. To upgrade, download the new httpd-2.4.<n>-...-Win64-VS18.zip, check its SHA-256 ((Get-FileHash .\<file>.zip -Algorithm SHA256).Hash) against the one on the download page, and extract it. Then stop Apache, copy the new bin and modules folders over the old ones, leaving conf, htdocs and logs as they are, and start it again:
Stop-Service Apache2.4
Copy-Item .\Apache24\bin\* 'C:\Program Files\Apache24\bin\' -Recurse -Force
Copy-Item .\Apache24\modules\* 'C:\Program Files\Apache24\modules\' -Recurse -Force
& 'C:\Program Files\Apache24\bin\httpd.exe' -t 2>&1 | ForEach-Object { "$_" }
Start-Service Apache2.4
& 'C:\Program Files\Apache24\bin\httpd.exe' -v
Read the release's CHANGES notes first: a new build can need a newer Microsoft Visual C++ runtime, which Apache Lounge links to on the same page.
Server Components
| Component | Version or setting | Where |
|---|---|---|
| Apache HTTP Server | 2.4.71 (Apache Lounge Win64 VS18 build) | C:\Program Files\Apache24\bin\httpd.exe |
| OpenSSL | 3.5.9 (with Apache) | C:\Program Files\Apache24\bin\ |
| Service | Apache2.4, NT SERVICE\Apache2.4, Automatic, restarted on failure |
Services |
| HTTPS | port 443, HTTP/2 and HTTP/1.1, TLS 1.2 and 1.3, this VM's own certificate | conf\extra\httpd-cloudimg.conf, C:\ProgramData\Apache24\ |
| HTTP | port 80, every request redirected (301) to HTTPS | conf\extra\httpd-cloudimg.conf |
| Modules turned on by the image | mod_ssl, mod_http2, mod_rewrite, mod_socache_shmcb (beside Apache's defaults) |
conf\httpd.conf |
| Windows Server | 2025 Datacenter, Desktop Experience, 24H2, build 26100.33828 |
Configuration
Apache reads C:\Program Files\Apache24\conf\httpd.conf, which is Apache's own file with these changes:
Define SRVROOT "C:/Program Files/Apache24", so every relative path is under the install foldermod_ssl,mod_socache_shmcb,mod_rewriteandmod_http2loadedOptions FollowSymLinks(noIndexes) on the web root, and the/cgi-bin/alias commented outServerName localhost:80,ServerTokens Prod,ServerSignature Off,TraceEnable off- at the end,
Include conf/extra/httpd-cloudimg.conf
conf\extra\httpd-cloudimg.conf holds the HTTP and HTTPS sites (Steps 6 to 8): Listen 443, the TLS protocols and ciphers, SSLSessionTickets off, the port 80 site that redirects to HTTPS and the port 443 site with HTTP/2 and the certificate.
Filesystem Layout
| Path | What it holds |
|---|---|
C:\Program Files\Apache24\ |
Apache: bin (httpd.exe, curl.exe, openssl.exe), modules, conf, htdocs (the web root), logs, manual, error, icons, LICENSE.txt (Apache License 2.0) and NOTICE.txt |
C:\Program Files\Apache24\logs\ |
ssl_access.log and ssl_error.log (HTTPS), access.log and error.log (HTTP), error_log (the server's start-up and shut-down messages) |
C:\ProgramData\Apache24\ |
This VM's server.key, server.crt and apache-tls.txt, and cloudimg-firstboot.done. SYSTEM and Administrators full control, NT SERVICE\Apache2.4 read |
C:\ProgramData\apache-firstboot.log |
What the one-time first-boot task did |
The OS disk is Microsoft's 127 GB Windows disk (C:, NTFS, about 108 GB free on a new VM).
Managing the Service
From an elevated PowerShell window:
Restart-Service Apache2.4
Get-Service Apache2.4 | Format-Table Name, Status, StartType -AutoSize
WARNING: Waiting for service 'Apache2.4 (Apache2.4)' to stop...
Name Status StartType
---- ------ ---------
Apache2.4 Running Automatic
Stop-Service Apache2.4 and Start-Service Apache2.4 stop and start it; to keep it stopped across restarts, also run Set-Service Apache2.4 -StartupType Disabled (and -StartupType Automatic to undo). If Apache stops unexpectedly, Windows restarts it after 5 seconds, then 10 seconds, then a minute.
The two Windows Firewall rules are in the group Apache HTTP Server:
Get-NetFirewallRule -Group 'Apache HTTP Server' | Format-Table DisplayName, Enabled, Direction, Action -AutoSize
DisplayName Enabled Direction Action
----------- ------- --------- ------
Apache HTTP Server (HTTP-In) True Inbound Allow
Apache HTTP Server (HTTPS-In) True Inbound Allow
Who can reach the ports from the internet is decided by the VM's network security group in Azure (Step 1).
On Startup
At the first start of your VM, the scheduled task \cloudimg\Apache first boot (SYSTEM) runs once:
- It waits until Windows setup and Azure have finished setting up the VM
- It checks
C:\ProgramData\Apache24has its locked-down permissions and holds no key - It makes this VM's 3072-bit RSA key and self-signed certificate, each file created with its permissions already in place, and writes
apache-tls.txt - It checks the configuration, starts Apache and checks it answers: HTTPS with exactly this certificate, and HTTP redirecting to HTTPS
- It sets the service to Automatic, writes
C:\ProgramData\Apache24\cloudimg-firstboot.done, then deletes its own task and script
Get-Content C:\ProgramData\apache-firstboot.log
2026-12-03T09:08:13.2408983Z provisioning finished
2026-12-03T09:08:20.3020827Z TLS certificate made: CN=<vm-name> sha256=f6109cfb8b275dde9b74134ee582194c1b9452c07b25bfcfb7f0b647267460d1
2026-12-03T09:08:29.3982235Z Apache answers: https=200 Tls13 cert=f6109cfb8b275dde9b74134ee582194c1b9452c07b25bfcfb7f0b647267460d1 http=301 -> https://127.0.0.1/
2026-12-03T09:08:36.5959766Z first boot done
(CN= shows your VM's computer name.) It runs only once, so there is nothing to turn off. Every start after that, Windows starts the Apache2.4 service with the same certificate.
Troubleshooting
The browser cannot reach the site
- Check the VM's network security group allows ports 443 and 80 from your address (Step 1)
- On the VM, check Apache is running and listening (Step 3), and that
https://localhost/answers (Step 4) - A first boot takes a minute or two after the VM starts: until
cloudimg-firstboot.doneexists, Apache is not yet started
Apache will not start after a change
Run & 'C:\Program Files\Apache24\bin\httpd.exe' -t in an elevated PowerShell window: it names the file and line Apache cannot read. Then look at the end of C:\Program Files\Apache24\logs\error_log and ssl_error.log. A certificate and key that do not belong together, or a key with a passphrase, stop Apache from starting.
cloudimg-firstboot.done is missing
The first-boot task may still be running: give it a minute or two after the VM starts and check again. Its log, above, shows how far it got. A failure leaves the task in place, so it tries again at the next start.
The browser warns about the certificate
Expected with this VM's own certificate (Step 5). Trust it on your own machines (Step 6) or use a certificate from a public certificate authority (Step 7).
Forgot the Windows password
Use Reset password on the VM's page in the Azure portal.
Security Recommendations
- Keep Remote Desktop restricted to your own address (Step 1), or use Azure Bastion
- Use a certificate from a public certificate authority for a public site (Step 7), and renew it before it expires
- Keep
server.keyon the VM. It is this VM's own; never copy it to other machines or into the web root - Keep Windows Update on, and update Apache when a new 2.4 release fixes a security issue (Step 9)
- Leave the hardened settings in place (no version in the
Serverheader, no directory listings,TRACEoff, TLS 1.2 and 1.3 only) unless your site needs a change
Support
cloudimg's support team is on hand 24 hours a day by email (support@cloudimg.co.uk), with a guaranteed response within 24 hours, covering deployment, Remote Desktop access, Apache's configuration, certificates and upgrades.
- Email: support@cloudimg.co.uk
- Website: www.cloudimg.co.uk
- Product Catalogue: www.cloudimg.co.uk/products
- User Guides: www.cloudimg.co.uk/guides
Apache HTTP Server, Apache and the feather logo are trademarks of The Apache Software Foundation. All product and company names are trademarks or registered trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.