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.
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.
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.
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.
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"
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
Click on Inbound Rules and then in New Rule
Select Port in Rule Type and press Next.
In the next window, select TCP and Specific local ports and put this number on the input box: 80, 443, 8080 and press next.
Select Allow the connection.
Check in all the boxes, to apply rules at Domain, Private and Public.
Assing a name relatively to the rule we just created. For example: Allow incoming connections in Apache and click finish.
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