banner



How To Install Apache Server In Windows

This article is the showtime function of our "How to install prerequisites needed for running a cocky-hosted edition of MIDAS from a Windows server" serial.

It applies to self-hosted installations of a MIDAS room booking and resource scheduling organisation on Windows-based servers simply.

This commencement commodity 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 assist installing or configuring Apache, please refer to the vendor's own documentation/back up.

Contents:

  • Step one - Download Apache for Windows
  • Footstep 2 - Unzip
  • Step 3 - Configure Apache
  • Step four - First Apache
  • Footstep 5 - Check Apache
  • Pace 6 - Install Apache as a Windows service
  • Step vii - Monitor Apache (optional)

Pace 1 - Download Apache for Windows

Apache for Windows may be freely downloaded from ApacheLounge.

Both 32-bit (x86) and 64-flake (x64) versions are bachelor, depending upon whether your Windows server runs a 32 or 64-chip version of Windows:

Download Apache for Windows

For this guide, we'll assume that the Windows server is running a 64-bit operating system, and so nosotros'll download Apache 2.4.52 Win64 (httpd-2.4.52-win64-VC16.zip)

Every bit per the information on the ApacheLounge download page, you'll also need to ensure that you lot have the relevant C++ Redistributable for Visual Studio installed on your server also. It'southward possible that this volition already exist installed on your organization, 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-fleck arrangement) from the links on the ApacheLounge site offset.


Stride 2 - Unzip

Once the download has completed, open the downloaded "httpd-ii.four.52-win64-VC16.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. Kickoff by locating the file "httpd.conf" (which volition be in the "conf" subdirectory), and open this in a standard text editor.

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

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

If there is no SRVROOT variable present in your httpd.conf file, then instead you'll demand to manually update all instances of "C:/Apache24", 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 too need to make the post-obit modifications to the http.conf file:

  • A) Add together "ExecCGI" to "Options" directive:
    Locate the following line:

    Options Indexes FollowSymLinks

    ...and suspend "ExecCGI":

    Options Indexes FollowSymLinks ExecCGI

    ...this tells Apache that CGI/Perl scripts are allowed exterior of the cgi-bin directory
  • B) Locate and uncomment the following line: (by removing the # symbol from the first of the line)

    AddHandler cgi-script .cgi

    ...and besides add the following line:

    AddHandler cgi-script .pl

    ...These two lines tell Apache how to handle .cgi/.pl files (i.e. execute them rather than nowadays them to equally text to a web browser)
  • C) Add the post-obit line to the end of the httpd.conf file:

    ScriptInterpreterSource Registry

    ...this allows Apache to ignore the very start line of .cgi/.pl files which directly Apache to the install location of Perl, and instead make up one's mind the location of Perl from the Windows Registry

Step 4 - Starting time Apache

Open up a Control or PowerShell prompt in the "bin" binder at the location where you extracted Apache (Hold "Shift" whilst right-clicking and select "Open up control window here" or "Open PowerShell window here"):
Open a command prompt in current folder

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 post-obit command:

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

(Replace D:\Apache\ with the location where y'all previously extracted your Apache server)

If you see a Windows Firewall prompt, let admission as appropriate. If yous fail to allow Apache access through your server's firewall, other computers/devices volition be unable to connect to your spider web server, then be certain to let access accordingly:

Allow Apache through Windows Firewall

If Apache (httpd.exe) fails to starting time with a "could not bind to accost" error, this will probable be due to some other service already running on Apache's default port (80). Check that yous don't currently have an IIS (Cyberspace Data Services) server already running. If yous practice, you'll need to stop/disable IIS in club to run Apache (or change the listening port on either IIS or Apache to let both services to run concurrently. You may need to refer to the vendor's own documentation for assistance changing server listening ports).


Pace 5 - Bank check Apache

With the previous command window still open, open your web browser and navigate to http://127.0.0.one

If Apache is running, you should see the words "It works!" displayed in your browser:

Check if Apache is running correctly

Step half dozen - Install every bit a Windows service:

When y'all shut the command/PowerShell window, Apache will exit.
Withal, to ensure that Apache is running all the time, information technology tin can quickly be installed as a Windows service.
Simply open an administrative control prompt or PowerShell prompt once again, and this fourth dimension enter the following, for a Command Prompt:

httpd.exe -g install

...or in a PowerShell Prompt:

Starting time-Procedure PowerShell -Verb RunAs

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

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

(Supercede D:\Apache\ with the location where yous previously extracted your Apache server)You should then run across a message that the Apache2.4 service has been successfully installed.

Y'all tin then start the service by typing:

internet start Apache2.4

Install Apache as a Windows Service

Step 7 - Monitor Apache (optional)

To allow y'all to monitor the current state of your Apache server, as well as allow you lot to quickly kickoff/stop/restart the server, Apache comes with a minor utility called "Apache Monitor".
Double click ApacheMonitor.exe from the bin binder to run the utility, or place a shortcut to, in your Startup folder so that information technology automatically runs whenever Windows starts.

TIP: To quickly locate your Startup folder on Windows 10 and afterwards, printing WinKey + R and and so blazon "trounce:startup" (current user) or "shell:common startup" (all users)

Monitor Apache State on Windows

Next In This Series...


Source: https://mid.as/kb/00143/install-configure-apache-on-windows

Posted by: lancasterrowend.blogspot.com

0 Response to "How To Install Apache Server In Windows"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel