install Apache Server on Windows

In this tutorial we will describe the Apache server installation on Windows system. To build an Apache server with MySQL and PHP you should look at our WAMP (windows, apache, mysql and php) tutorial in the previous section.

Download and Install Apache 

  1. Download Apache Win32 Binary without crypto (no mod_ssl) (MSI Installer) from the site httpd-2.2.19-win32-x86-no_ssl
  2. Double-click on this file to start Apache installation and click "Run" to continue.
  3. Install Apache in the folder C:\Program Files\Apache Software Foundation\Apache2.2.
  4. Go to browser and typ http://localhost in the adresbalk.
  5. You will see something as this: "It works!".

Apache Configuration

The Apache configuration file "C:\Program Files\Apache Software Foundation\Apache2.2\conf" is stored in the "\ httpd.conf" file. Apache Document Root default to the folder "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs". The document root is where all your PHP or HTML files are placed, so that Apache will handle. Of course you can also refer to any folder you want to change. We choose a new folder and in another drive, D:/www. We have to tell the Apache the new situation. Get the "httpd.conf" file and open with Notepad editor.

  1. Find the following line:
    <Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs">
    change to
    <Directory "D:/www">
  2. To allow ".htaccess" file chage "AllowOverride None" to "AllowOverride All"
  3. Save the file httpd.conf and close it.
  4. Create a new file "index.html" with the following content:
    <html>
    <body>
    <h1>It works!</h1>
    <P>My document root is moved to the directory D:/www. </P>
    </body>
    </html>
  5. Save this file into directory D:/www.
  6. Restart Apache: "Start > All Programs > Apache HTTP Server 2.2 > Control Apache Server > Restart".
  7. Test: type in your browser the following: http://localhost