How to install Apache on Windows 10

How to install Apache on Windows 10, download Apache Web Server and Ms Visual C++ Redistributable Package from: https://www.apachelounge.com/download/ make sure to download the same bitness x86 or x64

Install the Ms Visual C++ Redistributable Package first, just double click the executable file and follow the instructions.


Configuring Apache Web Server

Create a new folder in C Drive name it "apache" extract the Apache httpd zip file you've downloaded to anywhere on your computer and then copy all files and folders over into "c:\apache"

Navigate to "c:\apache\conf" folder, double click "httpd.conf" to open it.

Find the Server Root:

ServerRoot "c:/apache24"

Change it to:

ServerRoot "c:/apache"

The next line is: Server Admin

ServerAdmin admin@example.com"

Change it to:

ServerAdmin admin@localhost

The next line is: Server Name

#ServerName www.example.com:80

Un-comment the line and replace www.example.com with localhost:

ServerName localhost:80

The next lines: DocumentRoot and Directory

DocumentRoot "c:/apache24/htdocs"
<Directory "c:/apache24/htdocs">

Change the path to:

DocumentRoot "c:/apache/htdocs"
<Directory "c:/apache/htdocs">

The next line is: cgi-bin Directory

<Directory "c:/apache24/cgi-bin">

Change it to:

<Directory "c:/apache/cgi-bin">

Save the configuration file.


Installing Apache

Run Command Prompt as Administrator

Navigate to the Apache bin folder

Type in "cd \apache\bin" and then press Enter
Type in "httpd -k install" to install the Apache service
Type in "httpd -k start" to start the Apache Server

For details see the image below:

Apache Command Prompt

Open up your browser and navigate to "http://localhost"

Apache Test Page

If it displays the text "It Works" it means the Apache Web Server has been installed successfully.

If you want to move the default Apache Document Root to another location, change the path in the Apache DocumentRoot and Directory

DocumentRoot "d:/MyWebs"
<Directory "d:/MyWebs">


Apache Monitor

Apache Monitor is a GUI tool used to star, stop, and restart the Apache server. To open this tool go to the Apache Bin folder "C:\apache\bin" double-click the "ApacheMonitor.exe"


Uninstall Apache

If you want to upgrade, downgrade or remove Apache completely from your system follow the steps below.

Run Command Prompt as Administrator
Navigate to the Apache Bin folder

Type in "cd \apache\bin" and then press Enter
Type in "httpd -k stop" to stop the Apache Service
Type in "httpd -k uninstall" to uninstall the Apache Service.

For details see the image below:

Apache Command Prompt

Right-click Apache Monitor icon on your Taskbar and then click "Exit"

That's it, now you can delete the "C:\apache" folder or replace it with other versions.

Here is a video on YouTube How to install Apache on Windows 10


No comments:

Post a Comment