Hello, in this post we will talk about Apache and how to install in Windows Server 2019. This is a very popular web server; and what is it?, it is a software designed to transfer hypertext data, that is, web pages with all their elements (texts, widgets, banners, etc.) through the HTTP protocol. Specifically, Apache is a free and Open Source web server, running under GPL license and that has as an interesting feature, being multiplatform, that is to say, it can be operated in Windows, Linux, and MAC Os. In addition, it executes HTTP/1.1 protocol and for Being Open Source, anyone can modify its code. In the same way, it is maintained by the developer´s user community that works under the guidance of the Apache Software Foundation. It is still, one of the most used web servers, with almost 50% of penetration in the net

How to install and configure Apache on Windows Server 2019

Firstly, we need to download Microsoft Visual Studio C++ 2019, we can do it from here. Please install and reboot the server.

Installing Visual C++
Installing Visual C++

Now, we need to download Apache. Note that, the Apache HTTP Server Project itself does not provide binary releases of software, only source code. Individual committers may provide binary packages as a convenience, in addition, we can obtain a binary package from binary distributions available on the Internet. In our particular case, we will work with Apache Lounge version. The binaries can be downloaded from here.

Unzipping Apache´s binaries
Unzipping Aàche´s binaries

Installing Apache

The binaries came into a ZIP file, in order to installed it, we need to unzip in the root directory of the drive, in our case it is C:\Apache24. Now open a CMD with privileges of administrator, to do that just type on search bar cmd, when Command Prompt appears, right-click on it to run as administrator.

Run CMD  as  administrator
Run CMD as administrator

On the cmd, we have to navigate to C:\Apache24\bin by using cd command

cd..
cd Apache24 
cd bin

Next, run the program by typing httpd.exe. If there are no errors, the cursor will sit and blink on the next line. Now we can check our installation by typing in browser´s address: http://localhost, a very clear message (It works) will indicate, that everything is fine.

Apache starting and running
Apache starting and running
http://localhost on the address browser. Confirmation message: it works! Apache is working
http://localhost on the address browser. Confirmation message: it works!

In order to shut down Apache, we go back to CMD and press control+C.

Installing Apache as a system service

Once that we confirmed the Apache server is working and shut it down, we are ready to install it as a system service. To achieve that, we need to open a Command Prompt window as administrator in the same location before and type:

 httpd.exe -k install -n "Apache HTTP Server" 
Setting Apache as a system service
Setting Apache as a system service

Then, in another CMD window we have to enter the next command:

 services.msc 

Now we can see all of windows services, look for Apache HTTP Server and check if the Startup Type is Automatic. Now restart the server, log back in again, and go to this page in the browser’s URL bar: http://localhost/

Configuring Windows’ Firewall

Ok, we already have installed Apache as system service, now we need to configure the windows´firewall to allow connections from the internet to our web server. With this intention, we must open the firewall an create a new rule. Let is see how to do it.

In this case, we click on Windows Start and type firewall to open it

Starting Windows Firewall with Advanced Security
Starting the Windows Firewall with Advanced Security

Click on Inbound Rules and then in New Rule

Creating a new rule on windows firewall
Creating a new rule on windows firewall

Select Port in Rule Type and press Next.

Selecting Port in the type of rule
Selecting Port in the type of rule

In the next window, select TCP and Specific local ports and put this number on the input box: 80, 443, 8080 and press next.

Selecting local ports to allow connections
Selecting local ports to allow connections

Select Allow the connection.

Allow the connection
Allow the connection

Check in all the boxes, to apply rules at Domain, Private and Public.

Apply to all the options
Apply to all the options

Assing a name relatively to the rule we just created. For example: Allow incoming connections in Apache and click finish.

Assigning rule name to allow incoming connections to Apache
Assigning rule name

Now we can try connecting from another device, by open in a browser the IP address of our server. In my case http://192.168.1.59/. Well, as can be seen, our apache server is configured and ready to use. From now, we can install PHP module or MySQL. Also, we invited you to check our tutorial about FTP servers

LEAVE A REPLY

Please enter your comment!
Please enter your name here