How to install & configure Apache on a Windows server

This article is the first part of our “ How to install prerequisites needed for running a self-hosted edition of MIDAS from a Windows waiter “ series. It applies to self-hosted installations of a MIDAS room engagement and resource schedule system on Windows-based servers only. This beginning article outlines how to install Apache on Windows. other web servers ( such as Microsoft ‘s Internet information Services ( IIS ) ) are besides available for Windows. Please eminence that this article is provided “ as is ” and is correct at fourth dimension of writing. For far aid install or configuring Apache, please denote to the seller ‘s own documentation/support.

Contents:

Step 1 – Download Apache for Windows

Apache for Windows may be freely downloaded from Apache for Windows may be freely downloaded from ApacheLounge Both 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 WindowsDownload Apache for Windows
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.52 Win64 (httpd-2.4.52-win64-VC16.zip) For this usher, we ‘ll assume that the Windows waiter is running a 64-bit operate on system, and so we ‘ll download Apache 2.4.52 Win64 ( httpd-2.4.52-win64-VC16.zip ) As per the information on the ApacheLounge download page, you ‘ll besides need to ensure that you have the relevant C++ Redistributable for Visual Studio installed on your server besides. It ‘s possible that this will already be installed on your system, but if in doubt, download and run “ vc_redist_x64.exe ” ( for a 64-bit engage arrangement ), or “ vc_redist_86.exe ” ( for a 32-bit system ) from the links on the ApacheLounge web site first .

Step 2 – Unzip

Once the download has completed, open the downloaded “httpd-2.4.52-win64-VC16.zip” file, and extract its contents to a suitable location on your server i.e. C:\Apache24 or D:\Apache, etc once the download has completed, open the download “ httpd-2.4.52-win64-VC16.zip ” file, and extract its contents to a desirable localization on your server i.e. degree centigrade : \Apache24 or vitamin 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. 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. By default, this shape file assumes that you ‘ve extracted Apache to C : \Apache24. If however you ‘ve extracted Apache to a unlike location ( i.e. five hundred : \Apache ), you ‘ll need to update the ${SRVROOT} variable within in the httpd.conf file to point to the new localization consequently, i.e : Define SRVROOT “ C : /Apache24 ” → Define SRVROOT “ D : /Apache ” If there is no SRVROOT variable star present in your httpd.conf file, then alternatively you ‘ll need to manually update all instances of “ C : /Apache24 ”, i.e. : ServerRoot “ C : /Apache24 ” → ServerRoot “ D : /Apache ”
DocumentRoot “ C : /Apache24/htdocs ” → DocumentRoot “ D : /Apache/htdocs ”

ScriptAlias /cgi-bin/ “C:/Apache24/cgi-bin/” → ScriptAlias /cgi-bin/ “D:/Apache/cgi-bin/”
careless of where you extracted Apache to, you ‘ll besides need to make the comply modifications to the http.conf file :

  • A) 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
  • B) Locate and uncomment the following line: (by removing the # symbol from the start 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 present them to as text to a web browser)
  • C) Add the following line to the end of the httpd.conf file: ScriptInterpreterSource Registry…this allows Apache to ignore the very first line of .cgi/.pl files which direct Apache to the install location of Perl, and instead determine the location of Perl from the Windows Registry

Step 4 – Start 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 here” or “Open PowerShell window here”):
Open a Command or PowerShell motivate in the “ bank identification number ” folder at the placement where you extracted Apache ( Hold “ Shift ” whilst right-clicking and select “ Open command window here ” or “ open PowerShell window here ” ) :

Open a command prompt in current folderOpen a command prompt in current folder If you opened a command immediate, start Apache by entering the surveil instruction : httpd.exe If you opened a PowerShell prompt, start Apache by entering the following command : & “ five hundred : \Apache\bin\httpd.exe ”(Replace D:\Apache\ with the location where you previously extracted your Apache server) ( Replace D : \Apache\ with the localization where you previously extracted your Apache server ) If you see a Windows Firewall prompt, allow access as allow. If you fail to allow Apache access through your waiter ‘s firewall, early computers/devices will be unable to connect to your world wide web server, thus be sure to allow access consequently :
Allow Apache through Windows FirewallAllow Apache through Windows Firewall If Apache ( httpd.exe ) fails to start with a “ could not bind to address ” error, this will probably be due to another military service already running on Apache ‘s default port ( 80 ). Check that you do n’t presently 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 seller ‘s own documentation for aid changing waiter listening ports ) .

Step 5 – Check Apache

With the previous command window still open, open your web browser and navigate to http://127.0.0.1 With the former dominate window inactive 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 correctlyCheck if Apache is running correctly

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: When you close the command/PowerShell window, Apache will exit.However, to ensure that Apache is running all the clock, it can promptly be installed as a Windows service.Simply open an administrative command immediate or PowerShell prompt again, and this time enter the pursue, for a Command Prompt : httpd.exe -k install…or in a PowerShell Prompt: … or in a PowerShell Prompt : Start-Process PowerShell -Verb RunAsThis ensures that PowerShell is running as an administrator. Then enter: This ensures that PowerShell is running as an administrator. then accede : & “ five hundred : \Apache\bin\httpd.exe ” -k install(Replace D:\Apache\ with the location where you previously extracted your Apache server)You should then see a message that the Apache2.4 service has been successfully installed. ( Replace D : \Apache\ with the location where you previously extracted your Apache server ) You should then see a message that the Apache2.4 service has been successfully installed. You can then start the service by typing : internet startle Apache2.4Install Apache as a Windows ServiceInstall 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 your Startup folder so that it automatically runs whenever Windows starts. To allow you to monitor the current state of your Apache waiter, deoxyadenosine monophosphate well as allow you to cursorily start/stop/restart the waiter, Apache comes with a humble utility called “ Apache Monitor ” .Double chatter ApacheMonitor.exe from the bin folder to run the utility program, or place a shortcut to, in your Startup folder so that it mechanically runs whenever Windows starts. tap : To promptly locate your Startup folder on Windows 10 and belated, press WinKey + R and then type “ shell : startup ” ( current user ) or “ blast : coarse inauguration ” ( all users )

Monitor Apache State on WindowsMonitor Apache State on Windows

Next In This Series…

source : https://thefartiste.com
Category : Tech

About admin

I am the owner of the website thefartiste.com, my purpose is to bring all the most useful information to users.

Check Also

articlewriting1

Manage participants in a zoom meeting webinar

Call the people who attend the meet as follows Alternate host host Who scheduled the …

Leave a Reply

Your email address will not be published.