25.1 C
Texas

How to Install Apache on Windows 10

Hello, how are you? In this post, we are going to talk a bit about Apache. A web server is a fundamental element of the internet. In fact, through them run the web pages and multimedia material that are on the network. Every time you type a web address in a browser, it generates a request to a remote server. Additionally, it responds with a service called a web server, showing the web page you want to see. Apache works by establishing a connection between a server and the browsers of website visitors as they send files to each other. It is a multi-platform software, so it works on both Unix and Windows servers. Although its use has been decreasing over time, it still maintains great penetration in the server market. For that reason, let’s see how to install Apache in Windows 10.

Prerequisite

First, you need to download and install Microsoft Visual Studio C++ 2019. You can do it from this link. After downloading it, install it as another program and restart Windows to make the changes effective.

Downloading Apache.

The Apache project does not provide binaries or executable files for Windows. Instead, it offers source code to compile. If you are unable to do so, then the same page offers several binary distributions on the internet. In this case, we will use Apache Lounge. The first thing we have to do is go to the page and download the latest version. At the time of writing this post, it is 2.4.41.

Download the latest version of Apache Lounge
Download the latest version of Apache Lounge

Next, create a folder named Apache24. This folder must be located in the root of the directory where Windows is installed. For example: C:\Apache24. Then unzip the content you just downloaded into the Apache24 folder. Please make sure that all folders are unzipped into the directory.

Installing Apache

- Advertisement -

Now open a command prompt as administrator and enter the following commands to get to the bin folder:

cd.. 
cd..
cd Apache24 
cd bin 
Entering the bin folder
Entering the bin folder

Now it is time to install and run the server, with this intention please write httpd If you have done everything correctly, then the cursor will remain blinking in the console. In addition, the installer will ask the Windows firewall to be able to connect to the network. You allow access according to your needs.

Apache server starting and connecting through Windows firewall.
Apache server starting and connecting through Windows firewall.

If you have done everything correctly, then the cursor will remain blinking in the console. Now we will test the server in the web browser by typing localhost or the ip address of the PC. You’ll see the message: it works!

Apache web server running in Opera under Windows 10 environment.
Apache web server running in Opera under Windows 10 environment.

Finally stop the service by pressing the combination Control+C.

Installing Apache as a system service.

Once the Apache web server has been installed, configured and tested, all that remains is to configure it as a system service. With this in mind, go to the same address we have mentioned and open a CMD with administrator privileges. Then type the following command:

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

To check that it is indeed a system service, please run the following command on a Command Prompt:

  services.msc  

Now we can see all of windows services, look for Apache HTTP Server and check if the Startup Type is Automatic. Consequently, every time we start Windows the server will start automatically. This way you don’t have to start it every time.

Apache service configured in automatic startup.
Apache service configured in automatic startup.

Conclusion

Finally we have seen how to install Apache on Windows 10. As we mentioned, it is still a very popular option for web servers. So it is very interesting to have this tool. Before saying goodbye I invite you to see our post about Maven in Windows 10.

- Advertisement -
Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

2 COMMENTS

  1. Hi,

    I had had downloaded Apache and unziped in root directory, but the prompt command can’t find the bin folder.

    Can you help please?

    Thank you.

    • make sure you’re running prompt as admin otherwise you’ll get C:\users\user123\> and you can’t change the sys controls from a basic user account. If you’re running as admin you’ll see C:\WINDOWS\system32>

LEAVE A REPLY

Please enter your comment!
Please enter your name here



Latest article