MIDAS KnowledgebaseMIDAS Knowledgebase

How to install & configure Apache on a Windows server

This article is part one of our three part series "How to install pre-requisites needed for running a self-hosted edition of MIDAS from a Windows server".
It applies to self-hosted installations on Windows-based servers only.
This article outlines how to install Apache on Windows. Other other web servers (such as IIS) are also available for Windows.
Please note that this article is provided "as is" and is correct at time of writing. For further assistance installing/configuring Apache, please refer to the vendor's own documentation/support.

Contents:


Step 1 - Download Apache for Windows

Apache for Windows may be freely download from ApacheLounge.32-bit (x86) and 64-bit (x64) versions are available, depending upon whether your Windows server runs a 32 or 64-bit version of Windows:

Download Apache for Windows

For this guide, we'll assuming the Windows server is running a 64-bit operating system, and we'll download Apache 2.4.17 (httpd-2.4.17-win64-VC14.zip)

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, but if in doubt, download and run the "vc_redist_x64/86.exe" application from the link on the ApacheLounge site first.


Step 2 - Unzip

Once the download has completed, open the downloaded "httpd-2.4.17-win64-VC14.zip" file, and extract its contents to a location of your server i.e. C:\Apache24 or D:\Apache, etc


Step 3 - 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 all references to "C:/Apache24" in the http.conf file accordingly, i.e:
ServerRoot "C:/Apache24"ServerRoot "D:/Apache"
DocumentRoot "C:/Apache24/htdocs"DocumentRoot "D:/Apache/htdocs"
<Directory "C:/Apache24/htdocs"><Directory "D:/Apache/htdocs">
ScriptAlias /cgi-bin/ "C:/Apache24/cgi-bin/"ScriptAlias /cgi-bin/ "D:/Apache/cgi-bin/"

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


Step 4 - Start Apache

Open an command prompt in the "bin" folder at the location where you extracted Apache (Hold "Shift" whilst right-clicking and select "Open command window here"):

Open a command prompt in current folder

Start Apache by entering the following command:

httpd.exe

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

Allow Apache through Windows Firewall


Step 5 - Check Apache

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:

Check if Apache is running correctly


Step 6 - Install as a Windows service:

When you close the command window, Apache will exit.
However, to ensure that Apache is running all the time, it can quickly be installed as a Windows service.
Simply open an administrative command prompt again, and this time enter the following:
httpd.exe -k install
You should then see a message that the Apache2.4 service has been successfully installed.

You can then start the service by typing:

net start Apache2.4

Install Apache as a Windows Service


Step 7 - Monitor Apache (optional)

To allow you to monitor the current state of your Apache server, as well as allow you to quickly start/stop/restart the server, Apache comes with a small utility called "Apache Monitor".
Double click ApacheMonitor.exe from the bin folder to run the utility, or place a shortcut to in in your Startup folder so that it automatically runs whenever Windows starts.

Monitor Apache State on Windows
You might also be interested in...
» » »

← Return to Knowledgebase