What is a Web Server?
When you browse the Internet or any other web site your browser requests for web pages from another computer. This is known as a web request. The Web Server that resides in that computer identifies that a browser is requesting a web page and do the required processing and deliver the web page to the browser.
Now you have to understand this, a Web Server is not a Server. A Server is a high end computer whereas a Web Server is a program running on a computer that processes web requests. But both are referred to as Servers for convenience.
There are many Web Servers that you can use for this purpose such as
Microsoft IIS (Internet Information Server)
We will be using Apache as the Web Server. In fact many web hosts uses Apache for its reliability and configurability. And it’s free and open sourced.
If you need to know more about Apache please visit this page.
www.apache.org
Now let’s Download, Install and Configure Apache.
These steps are for the Windows platform.
Downloading Apache
The installation files for apache can be downloaded from www.apache.org.
Click HTTP Server under "Apache projects"
Download the HTTP Server installation (.msi) file for Win32.
Installing Apache
- Once you have downloaded the installation file simply double click and launch it.

- Click "Next"
- Read and accept the license agreement to proceed and click "Next".
- Read all of the instructions if you like to. Click "Next".

- Since Apache is going to be used for development requirements put the following information.
Network Domain: localhost
Server Name: localhost
Administrator’s Email Address: any email address
Keep the recommended selection
- Click "Next"
- Keep the selection as “Complete” and click "Next".
- Choose a path for the destination folder. You can keep the default path if you are OK with it. Click "Next".
- Click "Install". Be patient while the apache server is being installed.
And that’s it.
Configuring Apache
Now when you open your browser and type http://localhost or 127.0.0.1 (This is the IP address for localhost for all computers) or the IP address of your computer you will get the following page.

Now you are seeing the default web page in the "htdocs" folder. Assuming that you have given the default path as the installation directory for Apache this will be at
C:\Program Files\Apache Group\Apache2\htdocs
The reason that you see the web page that is in htdocs is that Apache is configured to show you that folder when you browse to the network domain (in our case it is http://localhost).
You can put your web projects here and run them. But however this is not recommended.
Why?
Well, first of all you are in a directory that a program is saved to. When Apache is uninstalled or repaired for some reason you most probably will lose all the files saved inside htdocs. And when you delete and rearrange your own files within this folder there is the possibility that you might accidently delete or renames a file or a folder that is vital to the functionality of Apache.
The best thing to do is that you create your own folder somewhere else and configure Apache to that folder.
Here is how it is done.
Go to Start > All Programs > Apache HTTP Server 2.0.54 > Configure Apache Server > Edit the Apache httpd.conf Configuration File
You can also open this file by navigating to
C:\Program Files\Apache Group\Apache2\conf\httpd.conf
Once you opened the file scroll down and find this part.
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs"
Now let’s assume that you need “C:\Projects” to be your “Document Root” then you edit this part as follows.
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
#DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs"
DocumentRoot "C:/Projects"
Note: Always remember to comment the line that you intend to change and add the changed line below the commented line. This way you will know exactly what you changed.
Then scroll down to find this part
#
# This should be changed to whatever you set DocumentRoot to.
#
Directory "C:/Program Files/Apache Group/Apache2/htdocs"
Change this part as follows
#
# This should be changed to whatever you set DocumentRoot to.
#
#Directory "C:/Program Files/Apache Group/Apache2/htdocs"
Directory "C:/Projects"
When you’re done, save the file and restart Apache. This is very important because all the changes that you made to the httpd.config will take effect only after restarting the service.
Now you can put an html file in to the folder you specified and then go to the browser and navigate to http://localhost to see the result.