When using Windows, I'm not one of those people who usually installs Wamp, Xamp or any other precompiled "all-in-one" tool for PHP + Apache + Mysql. These tools have their advantages and disadvantages, the most important advantage being the ease and speed of installation and configuration. However, their greatest disadvantage lies in the coupling that arises from the installation of all these components in one. That's why today we will see how to install Apache independently.
What is Apache Haus?
Apache Haus is a pre-compiled package of binaries for the Apache web server from the ASF (Apache Software Foundation). This package is compiled from Microsoft Visual Studio generating highly stable binaries with the operating system. In this compilation, there are a large number of incorporated modules that can be easily used once Apache is installed on the system.
The first thing you need to do is go to the official Apache Haus download page and download the version that suits your machine. In my case it will be the Apache 2.4.43 x64 version, ideal for 64-bit computers. When unzipping the ZIP file we will see a folder named Apache24 and with it a file named readme_first.html which contains relevant information about the installation, the Apache server, how to start the services and some release notes.
The next step will be to move the Apache24 folder to the "Local Disk C" or another preferred location for such programs. To run the application, simply navigate through the console to the Apache binary path which in our case would be C:\Apache24\bin . We run the httpd.exe command which should prompt us for a firewall authorization (if it is enabled) which we must accept as the case may be, and that's it. The next step would be to go to http://localhost to see the Apache Haus home page.
If you read the contents of the readme_first.html file, you will see that one of the most important things here is the configuration of the Apache service. To do this, simply run the following command.
httpd -k install
Finally, you can start the Apache service like this.
httpd -k start
Below are some useful command combinations.
Stop Apache httpd -k stop Restart Apache httpd -k restart Uninstall Apache Service httpd -k uninstall Test Config Syntax httpd -t Version Details httpd -V Command Line Options List httpd -h
As a recommendation, don't forget that you can run the httpd command from anywhere if you add it to the PATH variable of your machine. See you soon!.