Install and Configure Apache on Windows Server 2022

In this guide from the Windows Tutorials, we intend to teach you How To Install and Configure Apache on Windows Server 2022.

Apache HTTP Server is a free and open-source web server that delivers web content through the internet. It is commonly referred to as Apache and after development, it quickly became the most popular HTTP client on the web.

Install and Configure Apache on Windows Server 2022

With this tutorial, you will learn to install and configure Apache on your Windows Server.

Now follow the steps below to complete this guide.

Installing Apache on Windows Server 2022

First, you need to download Apache from the ApacheLounge. Depending on your Windows Server, choose the 32 or 64-bit version of windows.

Download Apache for windows

Note: Be sure you installed the latest 14.30.30704 Visual C++ Redistributable for Visual Studio 2015-2022.

When your download is completed, open your downloaded file and extract it to a suitable location like c:/Apache24 or etc.

Now you need to make some configuration changes.

Configure Apache

Now that you have extracted Apache on your Windows server, you need to configure it.

Open the conf subdirectory and open the httpd.conf file with a text editor like notepad.

We assume that you have extracted the file in the c:/Apache24.

You need to update the ${SRVROOT} variable point to the new location like this:

Define SRVROOT "C:/Apache24"

Also, you need to locate the following lines and change them to the new location that you have extracted Apache:

ServerRoot "C:/Apache24"
DocumentRoot "C:/Apache24/htdocs" 
<Directory "C:/Apache24/htdocs"> 
ScriptAlias /cgi-bin/ "C:/Apache24/cgi-bin/"

After that you need to uncomment and set the server name point to your server name or its IP address:

ServerName www.example.com:80

Next, locate the following line and add the “ExecCGI” in front of it:

Options Indexes FollowSymLinks ExecCGI

After that, find the line below and uncomment it by removing the # from the beginning of the line:

AddHandler cgi-script .cgi

And also add the following line:

AddHandler cgi-script .pl

At the end of the file add the following line:

ScriptInterpreterSource Registry

When you are done, save and close the file.

Now you can start Apache on your Windows Server 2022.

Open a command/PowerShell prompt in the “bin” folder at the location where you extracted Apache.

In a command prompt you can start Apache with the following command:

httpd.exe

You can start Apache in a PowerShell prompt with the following command:

& "c:\Apache24\bin\httpd.exe"

Now you can verify that your Apache is running on your server by typing 127.0.0.1 in your web browser.

http://127.0.0.1

You will see:

Check Apache on Windows Server

If you see this in your web browser means that your Apache is running on your Windows Server 2022.

Conclusion

Apache HTTP web servers are used by over 67% of all web servers in the world. Apache web servers are easy to customize environments, they’re fast, reliable, and highly secure. This makes Apache web servers a common choice by best-in-class companies.

At this point, you learn to Install and Configure Apache on Windows Server 2022.

Hope you enjoy using it.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles

POPULAR TAGS

Most Popular