---
title: How To Setup Apache on Windows Server
url: https://docs.vultr.com/how-to-setup-apache-on-windows-server
description: Learn how to install and configure Apache web server on Windows Server with our step-by-step guide. Perfect for beginners and system administrators.
publish_date: 2015-05-06T00:00:00Z
last_updated: 2025-05-09T14:01:40.649000Z
header_image: https://docs.vultr.com/public/doc-assets/91/b2dc35a20db9b5a7.png
---

> Index of every Vultr Docs page in markdown: https://docs.vultr.com/llms.txt

Apache HTTP Server is a widely used open-source web server that allows users to host websites, serve static and dynamic content, and run applications using PHP or other server-side languages. It’s known for its flexibility, performance, and broad support across platforms.

This article explains how to set up Apache on Windows Server. It covers two approaches: using a bundled package like XAMPP for a fast start, and manually installing Apache for a more customizable environment. The article also covers optional PHP integration to serve dynamic content.

## Prerequisites

Before you begin, ensure you have:

* A Windows Server instance (any modern version like 2016, 2019, or 2022).
* Administrator privileges to install software and modify firewall settings.

## Set Up Apache Using XAMPP

If your goal is to get a fully functional web server running quickly, consider using [XAMPP](https://www.apachefriends.org/). XAMPP bundles Apache, PHP, MySQL, and a control panel for easy management.

### Why Use XAMPP for Apache on Windows?

* One-click installer for all components.
* GUI control panel to start/stop services.
* Great for local development or testing.

Even with XAMPP, you can freely modify Apache’s configuration files or extend the environment for advanced needs.

## Install Apache HTTP Server Manually

For more control and a leaner setup, follow the steps below to manually install Apache on Windows Server.

### Download and Extract Apache HTTP Server

1. Go to the [Apache HTTP Server download page](https://httpd.apache.org/download.cgi).
1. Select a binary distribution for Windows, such as one from Apache Lounge.
1. Download the **MSI Installer** or ZIP file.
1. During setup:
    * Choose **“All Users”**.
    * Select **“Service Mode”** to run Apache as a Windows service.
    * Keep port **80** as default unless another service is using it.

### Install and Register Apache as a Windows Service

* Complete the installation using the MSI wizard or extract the ZIP manually.
* Use the **Apache Monitor** to manage the service.
* Or open `services.msc`, find **Apache2.4**, and start it from there.

### Verify Apache Installation in the Browser

Open your browser and visit `http://127.0.0.1`. Apache serves the default welcome page when the server runs successfully.

## Serve Static and Dynamic Content with Apache

Apache serves files from the `htdocs` directory, located inside the Apache installation folder (e.g., `C:\Apache24\htdocs`).

* Replace or add your `.html`, `.php`, or other files here.
* To use other directories or domains, configure **Virtual Hosts** in `httpd.conf`.

## Understand Apache Configuration Files

This section describes Apache's key configuration files and how they influence server behavior.

Apache’s behavior is controlled by these key configuration files:

| File         | Purpose                                                 |
|--------------|---------------------------------------------------------|
| [`httpd.conf`](https://httpd.apache.org/docs/current/configuring.html) | Main server configuration file. Controls ports, modules, and behavior. |
| [`.htaccess`](https://httpd.apache.org/docs/current/howto/htaccess.html) | Optional overrides applied per-directory. Often used in `htdocs`. |

For production use, it's best to modify the `httpd.conf` directly instead of relying heavily on `.htaccess`.

## Add PHP Support to Apache

To serve dynamic web pages with PHP:

### Download a Thread-Safe PHP Build for Windows

1. Visit the [official PHP for Windows downloads](https://windows.php.net/download).
1. Download a **Thread Safe** ZIP package matching your Apache version.
1. Extract the ZIP to a directory such as `C:\php`.

### Configure Apache to Load the PHP Module

Edit your Apache `httpd.conf` file and add these lines at the bottom:

```ini
LoadModule php_module "C:/php/php8apache2_4.dll"
AddType application/x-httpd-php .php
PHPIniDir "C:/php"
```

Replace `php8apache2_4.dll` with the actual file from your PHP directory that matches your installed PHP version. Check using `/php directory` to confirm.

### Test PHP Integration on Windows

1. Restart Apache from the Apache Monitor or `services.msc`.
1. Create a test file at `C:\Apache24\htdocs\test.php` with the following content:

    ```php
    <?php phpinfo(); ?>
    ```

1. Open your browser and navigate to
`http://127.0.0.1/test.php`.

If PHP is configured correctly, Apache serves the PHP configuration info page.

## Conclusion

In this article, you set up the Apache HTTP Server on Windows Server using two possible approaches: a quick-start installation with XAMPP, and a manual installation for more granular control. You learned how to verify the Apache service, serve static web files, and optionally configure PHP support to enable dynamic content.

With Apache installed and running, your Windows Server is now ready to host local or production websites. To further harden and optimize your setup, consider enabling HTTPS, setting up virtual hosts, and following security best practices for public-facing deployments.
