How to install Apache Server on Windows 7

Before we begin installing Apache Server on Windows 7 the first thing we have to do is downloading the latest version of Apache Web Server at

Update February 2013

As you might notice, site does not provide Win32 binaries anymore, so if you want to run Apache http server on Windows OS with the latest version you can get them from

But the sources are available only in zip format, so like it or not, you have to install them manually, but don't worry I have created an article called "Manually Installing Apache on Windows 7"


Download the Win32 Binary (MSI Installer) as follows.


Once you've finished downloading the Apache MSI Installer, double click the file to start the installation.


Click Next.


Read the License Agreement - If you have no problem with it check "I accept the terms in the license agreement," then click Next.


Click Next


Fill in the following:

Network Domain: localhost
Server Name: localhost
Administrator's email address: admin@localhost

Check for All User on Port 80 as a service. Click Next.


Select "Custom" for the Setup Type and then click Next


Click "Change" to change the destination folder. As an example we are going to install the Apache Server into "C:\Apache", later we will install PHP and MySQL in the same folder as well, so it'll be more easier to manage (upgrade) later.

Create a new folder in C drive name it "Apache" or you could just type in "C:\Apache\" in the "Folder name" and then click OK.


Once we've changed the destination folder, it should be look like the image above. Click Next to continue.


Now we're ready to install the Apache Server. If there is something you want to change we still have a chance to go back by clicking the Back button otherwise click Install.


Wait a few moments until Apache Server fully installed. Click "Finish" to exit the installation.

An icon (Apache Monitor) will appear in the System tray icons as shown below. Left click the icon to stop, to start and to restart the Apache Server.


Don't forget to always restart Apache Server each time we edit or make any changes in the Apache Configuration file (httpd.conf).

Testing Server.

Now it's time to test our server, open up browser in the address bar type in "http://localhost/" or "localhost" and hit Enter.


Yes! It works, congratulations!

Changing Apache Document root

Next we'll make a few changes to the Apache Configuration file (C:\Apache\conf\httpd.conf) or we can access it from the Start Menu > All Programs > Apache HTTP Server 2.2 > Configure Apache Server > Edit the Apache httpd.conf Configuration File.

Create a new folder in D drive name it "My Websites" or you can create it in C drive if you don't have a D drive.

Open up Apache configuration file "httpd.conf"

Find the line below:

DocumentRoot "C:/Apache/htdocs"

Change the path to D:/My Websites, we've just created.

DocumentRoot "D:/My Websites"

Find the next line:

<Directory "C:/Apache/htdocs">

Change it to the same path with the Document Root:

<Directory "D:/My Websites">

Open up Notepad, copy and paste the code html below:

<html><body><h1>It works too</h1></body></html>

Save the file into D:\My Websites as "index.html" don't forget to change "save as type" with "all files" otherwise the file will become index.html.txt

Restart the Apache Server. Open up browser type in "http://localhost/" and then press Enter.


Yes! It works too, again congratulations!


If "http://localhost" or "localhost" is not working, try "" If the latter works, open hosts file with Notepad. The hosts file is located at "C:\Windows\System32\drivers\etc\hosts" and add the following line to the end of the hosts file. localhost

If you have Skype installed on your system, it likely you will get port 80 problem. To fix this problem, set the application not to use port 80, to do this go to the Tools > Options > Advanced > Connection then uncheck "Use port 80 and 443 as alternatives for incoming connections"

Now we are ready to install PHP VC6 ( binaries.) Do not use PHP VC9 with this Apache Server!

VC9 versions of Apache can be fetched at

Follow the following link to find out of how to update this Apache Server with the Apache Lounge binaries.


  1. very helpful .. many thanks

  2. Thank you...

    The detailed explanation with clear screen shots are really helpful.

  3. hiii i did the installation and it went correctly but then when I type localhost in the web browser I did not get the page that i was expected to get. What I get is: :This page is here because the site administrator has changed the configuration of this web server" .....
    so I need your help. What should I do?

  4. thank you its very helpful.....

  5. yup thanks this is useful..:D

  6. Dear Sir i have an error
    on the time installation.CommandPrompt automatically open with this error:
    data couldnot bind.

    and apache doesn't play.

    If you having any idea kindly reply me on same

    1. Do you mean something like "could not bind to address x.x.x.x:80 ..."?, if so, It seems that Apache conflict with another service that using the same port, in this case it's port 80.

      Here is a quick solution, open up Apache configuration file (httpd.conf) and find the following lines:

      Listen 80
      ServerName localhost:80

      Change them both to use port 8888

      Listen 8888
      ServerName localhost:8888

  7. thank you its very help full

  8. Thank You soo much ! :) very very neat ,precise and very helpful.God bless buddy !

  9. i am getting the same error as maria khoury sir can u please help Thank u very much

    1. If you see something like "Seeing this instead of the website you expected?" It's another Apache test page, not an error. It means that your server has been installed correctly.

  10. Thnx Man

  11. AnonymousMay 08, 2013

    Thanks a lot

  12. AnonymousMay 09, 2013

    I am a noob just just trying to learn php by myself i know a little bit of java and c, so i was wondering on what program are u guys opening "httpd" and "php.ini" files? i am opening them on notepad and making required changes

    1. Notepad is fine. I personally use Notepad++, it looks much better because it displays line numbers.

  13. Hi,
    While installing apache i am getting same error message:
    make_sock: could not bind to adrress 0.0.0.:80
    No listening sockets available, shutting down
    unable to open logs.
    I tried one of the solution you have mentioned above but still i am not able to start apache.
    Pls help.

    1. The address should be not 0.0.0.:80

      But if you have just misstyped, it means that port 80 is already used by another program, it can be firewall, antivirus or any other programs.

      You can run "netstat -ano" from command prompt. Click Start/Run and then type netstat -ano, you will see something like TCP and in the last column there is a PID, check that PID number in Task Manager to find what program using that port.

    2. Yes, you were right. is already in use.
      I checked using cmd and is assigned to "System" with process id '4'.
      I tried a lot to kill the task but it says, "Access Denied" and without killing this task i cant run apache.
      Any solution for this...????

    3. Sorry for the delay...
      I am not good at system troubleshooting, perhaps this link can give you some clues to solve your problem why-is-system-process-listening-on-port-80