Cannot Install the Apache Service Please Stop This Application and Try Again

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

It applies to cocky-hosted installations of a MIDAS room booking and resources scheduling system on Windows-based servers merely.

This first commodity outlines how to install Apache on Windows. Other web servers (such equally Microsoft's Internet Information Services (IIS)) are likewise bachelor for Windows.

Please note that this article is provided "as is" and is correct at time of writing. For farther assistance installing or configuring Apache, please refer to the vendor's own documentation/back up.

Contents:

  • Step i - Download Apache for Windows
  • Step 2 - Unzip
  • Step 3 - Configure Apache
  • Step 4 - Start Apache
  • Stride 5 - Bank check Apache
  • Step half-dozen - Install Apache as a Windows service
  • Step vii - Monitor Apache (optional)

Step 1 - Download Apache for Windows

Apache for Windows may be freely downloaded from ApacheLounge.

Both 32-fleck (x86) and 64-scrap (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 assume that the Windows server is running a 64-bit operating organisation, and so nosotros'll download Apache 2.4.52 Win64 (httpd-2.iv.52-win64-VC16.zip)

Equally per the information on the ApacheLounge download page, you'll also need to ensure that you take the relevant C++ Redistributable for Visual Studio installed on your server too. It'southward possible that this volition already be installed on your arrangement, just if in dubiousness, download and run "vc_redist_x64.exe" (for a 64-scrap operating system), or "vc_redist_86.exe" (for a 32-scrap system) from the links on the ApacheLounge site offset.


Step ii - Unzip

Once the download has completed, open up the downloaded "httpd-2.four.52-win64-VC16.zip" file, and extract its contents to a suitable location on your server i.eastward. C:\Apache24 or D:\Apache, etc

Step 3 - Configure Apache

One time you lot'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.

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

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

If there is no SRVROOT variable nowadays in your httpd.conf file, so 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 likewise need to make the following modifications to the http.conf file:

  • A) Add "ExecCGI" to "Options" directive:
    Locate the post-obit 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
  • B) Locate and uncomment the following line: (by removing the # symbol from the starting time of the line)

    AddHandler cgi-script .cgi

    ...and also 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 as text to a spider web browser)
  • C) Add the following line to the end of the httpd.conf file:

    ScriptInterpreterSource Registry

    ...this allows Apache to ignore the very get-go line of .cgi/.pl files which direct Apache to the install location of Perl, and instead decide the location of Perl from the Windows Registry

Pace 4 - Kickoff Apache

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

If yous opened a control prompt, start Apache by entering the following command:

httpd.exe

If yous opened a PowerShell prompt, start Apache past entering the following command:

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

(Supersede D:\Apache\ with the location where yous previously extracted your Apache server)

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

Allow Apache through Windows Firewall

If Apache (httpd.exe) fails to beginning with a "could not bind to address" error, this will likely be due to another service already running on Apache'south default port (fourscore). Check that you don't currently have an IIS (Cyberspace Data Services) server already running. If you practise, you lot'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 demand to refer to the vendor's own documentation for assist irresolute server listening ports).


Step v - Check Apache

With the previous control window withal open up, open your web browser and navigate to http://127.0.0.1

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

Check if Apache is running correctly

Pace 6 - Install as a Windows service:

When you close the control/PowerShell window, Apache will exit.
Nevertheless, to ensure that Apache is running all the time, it can quickly be installed every bit a Windows service.
Simply open an administrative command prompt or PowerShell prompt again, and this time enter the following, for a Command Prompt:

httpd.exe -k install

...or in a PowerShell Prompt:

First-Procedure PowerShell -Verb RunAs

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

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

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

You can and then first the service past typing:

net start Apache2.4

Install Apache as a Windows Service

Step 7 - Monitor Apache (optional)

To permit you lot to monitor the electric current land of your Apache server, as well equally allow yous to quickly beginning/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 and then that information technology automatically runs whenever Windows starts.

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

Monitor Apache State on Windows

Next In This Series...


reesecrocke.blogspot.com

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

0 Response to "Cannot Install the Apache Service Please Stop This Application and Try Again"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel