How to Install Apache on Windows
This tutorial is specifically for installing Apache web server in Windows.
There are 2 ways this can be done.
- The AUTOMATED but less powerful way. (See end of article for some discussions on this).
- The MANUAL but more powerful way. Read on for this.
Here is a video lesson:
STEP 1: First go to this Apache official site downloads page .
STEP 2: On that page – follow the link that says “Apache httpd for Microsoft Windows is available from a number of third party vendors.” The other links are for Linux versions on that page.
STEP 3: On the subsequent page, I always download from ApacheHaus – as it always works great for me.
STEP 4: On the ApacheHaus downloads page, you will see a LOT of options.
Step 5: These different download options are based on combinations of :
- Apache server versions (ver 2.4x is the latest as I write this)
- Windows versions (can be 32 bit or 64 bit)
- Visual Studio version used to compile the code
Step 6: It is critical to make the make the right choice to download – as it will impact everything else.
Step 7: The parameters to consider:
- If you are running 32 bit Windows, your choice should be limited to the zip files which have “x86” in their name.
- If you are running 64 bit Windows, your choice is ideally “x64” in their name. You can technically run both.
- Visual Studio version – choose VC11 – remember what you chose. You will later have to choose the same VC version while selecting PHP.
Step 8: EXAMPLE: In my case, I have chosen Apache 2.4.16, Windows 64, VC 11 version. So, the zip file name for me was – httpd-2.4.16-x64-vc11.zip
Step 9: Download the zip file.
Step 10: Extract to C: drive. So you should now have a folder like this path: “C:\Apache24” – the last two numbers will be your own version numbers.
Step 11: Run Apache as a Windows Service!
- Run Command Prompt as administrator (right click and “Run as administrator”)
- Traverse to your Apache installation’s bin folder – (e.g: “C:\Apache24\bin“)
- NOTE: The executable file “httpd.exe” in the bon folder is the Apache server!
- Run command to install Apache as a Windows Service – “httpd -k install”
- TEST: You should get a confirmation message saying Apache service is successfully installed.
- Start Apache web server with command “httpd -k start”
- NOTE: you don’t have to do this every time! Next time, when you boot Windows, the Apache Service will be auto started.
STEP 12: Test your Apache web server by opening a browser window and typing “http://localhost” in the address bar. You should get a welcome “IT WORKS” message
Congrats! You are done!