Are you looking to set up an Apache web server on your Windows 10 machine? You're in the right place. In this step-by-step guide, we'll walk you through the process of installing Apache, configuring it, and getting your first website up and running. Let's dive right in.
Prerequisites
Before we start, ensure you have the following:
- Windows 10 (64-bit or 32-bit)
- Admin privileges on your computer
- About 10-15 minutes of your time
Download and Install Apache
The first step is to download the Apache HTTP Server for Windows from the official Apache Lounge. We recommend using the 'Win64' version if you're on a 64-bit system, or 'Win32' for 32-bit.

Once downloaded, run the installer and follow these steps:
- Accept the license agreement.
- Choose the 'Complete' installation option.
- Select the installation directory. The default (C:\Apache24\) is fine.
- Choose whether to install Apache as a service. This is recommended for most users.
- Select the port number. You can stick with the default (80) or change it if another application is using that port.
- Choose whether to enable the 'Keep Alive' feature. This can improve performance but may also increase CPU usage.
- Click 'Install' to begin the installation.
Test the Installation
Once the installation is complete, open your web browser and navigate to http://localhost. You should see the default Apache welcome page. If you do, congratulations! Apache is successfully installed on your Windows 10 machine.
Configure Apache
Now that Apache is installed, let's configure it to serve your website. First, locate your Apache configuration file. By default, it's located at C:\Apache24\conf\httpd.conf.

Open the file in a text editor and make the following changes:
| Line to find | Change to |
|---|---|
| #LoadModule dir_module modules/mod_dir.so | LoadModule dir_module modules/mod_dir.so |
| #Include conf/extra/httpd-vhosts.conf | Include conf/extra/httpd-vhosts.conf |
These changes will enable the directory module and include the virtual hosts configuration file.
Create a Virtual Host
Next, create a new virtual host configuration file for your website. In the C:\Apache24\conf\extra\ directory, create a new file named 'mywebsite.conf'. Add the following content to this file:
```apache
Replace 'mywebsite.com' with your actual domain name, and 'C:/Apache24/htdocs/mywebsite' with the path where you'll store your website files.
Restart Apache
Finally, restart the Apache service for your changes to take effect. You can do this from the command prompt by running:
```bash net stop Apache2.4 net start Apache2.4 ```
Or, if you prefer a graphical interface, you can use the Services panel in the Windows Control Panel.
That's it! Your Apache web server is now set up and ready to serve your website. To learn more about configuring Apache, check out the official Apache documentation. Happy coding!