Advance

How to Install Apache on Windows Server

How to Install Apache on Windows Server

How to Install Apache on Windows Server. Apache is one of the most popular web servers used to provide web services today. The basis of this web server is Linux and it is commonly installed and used in Linux distributions.
Due to the light weight and high performance of the Apache web server, users are also interested in using it on Windows.

There are several ways to use this web service, including installing Xampp. In this article, we are going to install the Apache web server independently on Windows.

You can Choose your perfect Windows VPS Server Packages from eldernode.

 

A) Download Apache for Windows

1- First, click on the link below and download the Apache web server for Windows. Note that on this page there are two versions for 32-bit and 64-bit Windows that you must download and install the appropriate version for your operating system.

Download Apache for Windows

 

install apache on windows server

 

As per the information on the ApacheLounge download page, you’ll also need to ensure that you have the relevant C++ Redistributable for Visual Studio installed on your server too. It’s likely that this will already be installed on your system, but if in doubt, download and run vc_redist_x64.exe (for a 64-bit operating system), or vc_redist_86.exe (for a 32-bit system) from following links.

Once the download has completed, open the downloaded “ httpd-2.4.43-win64-VS16.zip” file, and extract its contents to a suitable location on your server i.e. C:\Apache24.

Recommended Article: Tutorial Clear Local DNS Cache

B) Configure Apache

Once you’ve extracted Apache, we’ll need to configure it. Start by locating the file httpd.conf (which will be in the “conf” sub directory), and open this in a standard text editor.

By default, this configuration file assumes that you’ve extracted Apache to C:\Apache24. If however you’ve extracted Apache to a different location (i.e. D:\Apache), you’ll need to update the ${SRVROOT} variable within in the httpd.conf file to point to the new location accordingly, i.e:

 Define SRVROOT "C:/Apache24"  Define SRVROOT "D:/Apache"  

Regardless of where you extracted Apache to, you’ll also need to make the following modifications to the http.conf file:

 

1) Add ExecCGI to Options directive:

Locate the following line: Options Indexes FollowSymLinks

…and append ExecCGI:

 Options Indexes FollowSymLinks ExecCGI  

This tells Apache that CGI/Perl scripts are allowed outside of the cgi-bin directory.

 

2) Locate and uncomment the following line: (by removing the # symbol from the start of the line)

 AddHandler cgi-script .cgi  

also, add the following line:

 AddHandler cgi-script .pl  

These two lines tell Apache how to handle .cgi/.pl files.

 

3) Add the following line to the end of the httpd.conf file:

 ScriptInterpreterSource Registry  

 

C) Start Apache

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

Hold Shift whilst right-clicking and select Open command window here or Open PowerShell window here:

 

install apache on windows server

 

After opening the command prompt, start Apache by entering the following command:

 httpd.exe  

If you opened a PowerShell prompt, start Apache by entering the following command:

 & "D:\Apache\bin\httpd.exe"  

If you see a Windows Firewall prompt, allow access as appropriate:

 

install apache on windows server

 

With the previous command window still open, open your web browser and navigate to http://127.0.0.1. If Apache is running, you should see the words “It works!” displayed in your browser:

 

install apache on windows server

 

D) Install as a Windows service

To ensure that Apache is running all the time, it can quickly be installed as a Windows service.

Open an administrative command prompt or PowerShell prompt and enters the following, for a Command Prompt:

 httpd.exe -k install  

PowerShell Prompt:

 Start-Process PowerShell -Verb RunAs  

This ensures that PowerShell is running as an administrator. Then enter:

 & "D:\Apache\bin\httpd.exe" -k install  

 

You can start the service by typing the following command:

 net start Apache2.4  

 

install apache on windows server-5

 

Dear user, we hope you would enjoy this tutorial, you can ask questions about this training in the comments section, or to solve other problems in the field of Eldernode training, refer to the Ask page section and raise your problem in it as soon as possible. Make time for other users and experts to answer your questions.

Goodluck.

We Are Waiting for your valuable comments and you can be sure that it will be answered in the shortest possible time.

Leave Your Comment

Your email address will not be published.

We are by your side every step of the way

Think about developing your online business; We will protect it compassionately

We are by your side every step of the way

+18054214518

7 days a week, 24 hours a day