Custom Search
 


How to install Apache 2.x web server on Windows



Apache is the most popular web server. This article illustrates how to install it on Windows as part of a WAMP (Windows, Apache, MySQL, PHP) web development environment.

The order of installation for WAMP environment

To make installation a smooth process for a WAMP development environment, we want to install these components in the following order.

1. Install MySQL 5.x
2. Install Apache 2.x
3. Install PHP 5.x

For older versions of WAMP, here are the articles.

1. Install MySQL 4.x
2. Install Apache 1.3
3. Install PHP 4.x

Steps to install Apache on Windows as development machine

Here is a list of Apache HTTP server related pages:

  1. Apache HTTP server home page
  2. Apache HTTP server download page
  3. Apache for Windows documentation page

Step 1: Download Apache 2.2

In this article, we use Apache 2.2.14 to demonstrate the installation process.

(1) Go to Archived Win32 binaries download page here http://archive.apache.org/dist/httpd/binaries/win32/

(2) Download Apache 2.2.14

Here is the direct download link apache_2.2.14-win32-x86-no_ssl.msi

Step 2: Verify the downloaded file for integrity

Every Apache download comes with a MD5 hash value. This hash value is a Checksum value that can be used to verify data and file integrity.

Screenshot below shows the Apache installation file was verified by freeware HashCalc.

Checksum calculated by HashCalc:

As we see above, the MD5 checksum value by Apache.org is the same as the one calculated by HashCalc, which means the file is in good shape and can be trusted.

Step 3: Start installation

Double click the installation file. The installation should start straight away. Here are 9 screenshots.

3.1 Welcome

3.2 License Agreement

3.3 Read First

3.4 Server Information

This step needs a bit explanation. Add localhost to both Network Domain and Server Name box. Administrator's Email Address can be anything you like. These info are used for Apache configuration file but you can change them after the installation.

Next, select the first radio button as recommended. This way, Apache will be running as a Windows Service. See Step 6 below for more info about how to start, stop, restart Apache.

3.5 Setup Type

Choose Typical as the setup type.

3.6 Destination Folder

You can leave the default installation folder as is.

3.7 Ready to install

3.8 Installing in progress

3.9 Completed successfully

Step 4: Test your installation

After install, open web browser and type either of the following URLs into your browser's address bar and hit Enter key.

  1. http://localhost
  2. http://127.0.0.1
  3. http://169.254.32.57 or 192.168.0.1 (eg, local network IP address)

If Apache has been installed correctly, you should see a success message opened in your web browser, as shown below.

Note: http://169.254.32.57 could be your local machine's auto assigned IP that Microsoft has reserved (addresses 169.254.00 to 169.254.255.255).

If you use a router which sets up a LAN (Local Area Network), the router can assign an internal IP. For example, Linksys assumes a default internal IP address of 192.168.0.1

To find out your computer's IP address, open a command line window and run ipconfig command:

  • Click Start
  • Click Run
  • In the Run command box, type cmd and hit OK

    Run command

  • When command line window is opened, type ipconfig and hit Enter key.

    Run ipconfig command

Step 5: Edit the Apache httpd.conf Configuration File

Make sure you change the httpd.conf file according to the screenshots shown in the following section.

5.1 Change your document root directory to a more meaningful one.

DocumentRoot is the directory out of which you will serve your documents, eg. PHP, HTML, etc. It's the directory where your PHP or other web page files are placed into. The screenshot below shows that I

1. Commented out DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"
2. and then added DocumentRoot "C:/test"

So, all my php files will be located in a folder named as test on my C drive.

3. Commented out <Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs">
4. and then added <Directory "C:\test">

5.2 Add PHP file type into DirectoryIndex

Add the default document file names that Apache will run if we don't type its filename in web browser.

Note: for this article series, we will install PHP next. How to install PHP5 server-side scripting language on Windows

Edit the line as below shows, ie., DirectoryIndex index.html index.htm index.php

Step 6: Restart Apache

After changing Apache configuration file, remember restart Apache Server so that these changes will take effect.

To start, stop, and restart Apache Server, do this: Start -> Programs -> Apache HTTP Server -> Control Apache Server.

If Control Apache Server menu is not available. You can start, stop, and restart Apache by using Microsoft Management Console for Windows Services.

Start -> Settings -> Control Panel -> Administrative Tools -> Services

By using Windows Services, you can Start, Stop, and Restart Apache from Microsoft Management Console. See screenshot below. Selecting Apache as a Windows service will make it automatically start when your computer starts up, and to keep Apache running when you log-off.

Happy Installing!


Copyright© GeeksEngine.com



Related Articles:

1.Steps to install PHP 5.x on Windows as a development machine
2.How to connect two different versions of MySQL server on the same computer
3.How to configure MySQL server 5.1 on Windows
4.How to install MySQL server 5.1 on Windows with screenshots
5.Five ways to create include path for PHP
6.How to use Date and Time data as integer value in PHP and MySQL
7.How to use Apache Virtual Host to run multiple local websites on Windows
8.Install all PEAR packages by yourself
9.How to install PEAR on Windows
10.How to use PHP and Microsoft SMTP Virtual Server to send emails
11.How to install PHP server-side scripting language on Windows
12.How to install Apache 1.3 web server on Windows
13.How to install two different versions of MySQL server on the same PC
14.How to configure MySQL server 4.1 on Windows
15.How to install MySQL server 4.1 on Windows with screenshots
16.Export Northwind Access database to MySQL via ODBC


Other Recent Articles from the WAMP & LAMP category:

1.Steps to install PHP 5.x on Windows as a development machine
2.How to connect two different versions of MySQL server on the same computer
3.How to configure MySQL server 5.1 on Windows
4.How to install MySQL server 5.1 on Windows with screenshots
5.How to upgrade from PHP4 to PHP5
6.How to load time zone data for MySQL on Windows
7.How to use Apache Virtual Host to run multiple local websites on Windows
8.Install all PEAR packages by yourself
9.How to install PEAR on Windows
10.How to use PHP and Microsoft SMTP Virtual Server to send emails
11.How to install PHP server-side scripting language on Windows
12.How to install Apache 1.3 web server on Windows
13.How to install two different versions of MySQL server on the same PC
14.How to configure MySQL server 4.1 on Windows
15.How to install MySQL server 4.1 on Windows with screenshots
16.How to set up DSN in ODBC Data Source Administrator on Windows
17.Export Northwind Access database to MySQL via ODBC

Copyright © 2012 GeeksEngine.com. All Rights Reserved.

This website is hosted by LunarPages.

No portion may be reproduced without my written permission. Software and hardware names mentioned on this site are registered trademarks of their respective companies. Should any right be infringed, it is totally unintentional. Drop me an email and I will promptly and gladly rectify it.

 
Home | Kung Fu Timer | Feedback | Terms of Use | Privacy Policy