Build A Web Server On A Normal Desktop Computer
If you have been working with computers from a long time, you know that
in no time there will be more then one computers at your place. If the
computers are your concern only for the office, you must be aware that
all the computers at the office are interconnected and connected to a
larger and powerful computer known as a server. What is a server?
A server is distinguished from other machines by :
Power : A server computer that is used at corporate offices are much powerful in the sense of hardware and software.
A server is used as a central device, which provides other computers
with different service like File sharing, Application sharing, Internet
Sharing, Hardware Sharing.
A server is not just recognized by the hardware it uses, but also the
Operating System. A hardware will not perform any operations until it
has a proper software to utilize the hardware’s capabilities.
A standard home PC can be used as a server if you install the server softwares and configure it properly.
In this topic we will discuss on how to create a basic web server on a Windows XP computer.
- Apache-win32 server ( download)
- PHP-win32 ( download)
- Microsoft Windows XP
- About 1 hour, some patience and basic networking knowledge
So you have it all? Lets get started…!
On your Windows XP Computer, enable the IIS [Internet Information Server] to enable web hosting.
Installation of Apache:
- Select a drive that has enough free space, maybe approx. 400-500 MB (my whole server setup is round about 380 MB)
a folder named 'servers' and another called 'site' in the root of your
drive. And also create one 'tmp' folder into ur 'site' folder [eg.
"m:\servers", "m:\site" and "m:\site\tmp"]
- Run the apache setup and install apache in 'm:\servers\apache' and enter rest of the stuff, I am telling you-
+ Network domain [localhost]
+ Server name [localhost]
+ E-mail [ root@localhost]
+ Run for all users as a service on port 80 - recommended [check]
- If have a domain name then enter that instead of 'localhost'. Change the email to whatever you want to.
localhost = 127.0.0.1 [This is the loopback IP address of all the
computers. This cannot be changed and using this ip address your
computer cannot be reached by other computer because it is the common
IP address for all the computers. Localhost id used, as this will be
useful in testing your website from your computer.
Installation of PHP:
- Unzip the downloaded php zip into 'm:\servers\php-5-Win32' and rename it to 'php'
- Copy file php5apache2.dll from 'm:\servers\php\sapi' to 'm:\servers\php'
- Copy file php.ini-recommended from 'm:\servers\php' to your %SYSTEMROOT% [eg. c:\windows]
- Rename it to php.ini
- Now open the php.ini file in NOTEPAD and edit the following entries-
+ doc_root = m:/site/
+ extension_dir = m:/servers/php/extensions/
+ session.save_path = m:/site/tmp/
+ paste "LoadModule php5_module m:/servers/php/php4apache2.dll" to the bottom of the LoadModule subsection in php.ini file
+ search for 'DirectoryIndex' in your NOTEPAD and edit this entry to "DirectoryIndex index.html index.html.var index.php"
+ paste "AddType application/x-httpd-php .php" and to the bottomost part of m:/servers/apache/conf/httpd.conf file
+ do the