How to Install Apache Web Server on Windows 10
This article is the first part of our "How to install prerequisites needed for running a self-hosted edition of MIDAS from a Windows server" series. It applies to self-hosted installations of a MIDAS room booking and resource scheduling system on Windows-based servers only. This first article outlines how to install Apache on Windows. Other web servers (such as Microsoft's Internet Information Services (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 or configuring Apache, please refer to the vendor's own documentation/support. 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: 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 the links on the ApacheLounge site first. 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 Define SRVROOT "C:/Apache24" → Define SRVROOT "D:/Apache" If there is no SRVROOT variable present in your httpd.conf file, then instead you'll need to manually update all instances of "C:/Apache24", i.e.: ServerRoot "C:/Apache24" → ServerRoot "D:/Apache" Regardless of where you extracted Apache to, you'll also need to make the following modifications to the http.conf file: Options Indexes FollowSymLinks Options Indexes FollowSymLinks ExecCGI AddHandler cgi-script .cgi AddHandler cgi-script .pl ScriptInterpreterSource Registry If you opened a 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. If you fail to allow Apache access through your server's firewall, other computers/devices will be unable to connect to your web server, so be sure to allow access accordingly: If Apache (httpd.exe) fails to start with a "could not bind to address" error, this will likely be due to another service already running on Apache's default port (80). Check that you don't currently have an IIS (Internet Information Services) server already running. If you do, you'll need to stop/disable IIS in order to run Apache (or change the listening port on either IIS or Apache to allow both services to run concurrently. You may need to refer to the vendor's own documentation for assistance changing server listening ports). If Apache is running, you should see the words "It works!" displayed in your browser: httpd.exe -k install Start-Process PowerShell -Verb RunAs & "D:\Apache\bin\httpd.exe" -k install You can then start the service by typing: net start Apache2.4 TIP: To quickly locate your Startup folder on Windows 10 and later, press WinKey + R and then type "shell:startup" (current user) or "shell:common startup" (all users)Contents:
Step 1 - Download Apache for Windows
Apache for Windows may be freely downloaded from ApacheLounge.
For this guide, we'll assume that the Windows server is running a 64-bit operating system, and so we'll download Apache 2.4.39 Win64 (httpd-2.4.39-win64-VC15.zip)
Step 2 - Unzip
Once the download has completed, open the downloaded "httpd-2.4.39-win64-VC15.zip" file, and extract its contents to a suitable location on 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" subdirectory), and open this in a standard text editor.${SRVROOT}
variable within in the httpd.conf file to point to the new location accordingly, i.e:
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/"
Locate the following line:
Step 4 - 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"):
Step 5 - Check Apache
With the previous command window still open, open your web browser and navigate to http://127.0.0.1
Step 6 - Install as a Windows service:
When you close the command/PowerShell 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 or PowerShell prompt again, and this time enter the following, for a Command Prompt:
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 your Startup folder so that it automatically runs whenever Windows starts.
Next In This Series...
How to Install Apache Web Server on Windows 10
Source: https://mid.as/kb/00143/install-configure-apache-on-windows