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
- Use
Power : A server computer that is used at corporate offices are much powerful in the sense of hardware and software.
Use :
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.
Requirements:
- 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)
- Create
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:sitetmp"] - Run the apache setup and install apache in ‘m:serversapache’ 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.
Note :
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:serversphp-5-Win32’ and rename it to ‘php’
- Copy file php5apache2.dll from ‘m:serversphpsapi’ to ‘m:serversphp’
- Copy file php.ini-recommended from ‘m:serversphp’ 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 same with this "Add AddType application/x-httpd-php-source .phps"
Now one more thing I’d like to clarify here.. the slashes and trailing
slashes are of great importance in the config files, so put exactly as
I have written. - Add "m:serversphpdlls" to the System PATH
+ Set PATH under Start >Settings >Control Panel >System
>Advanced >Environment Variables >System variables >Path - Now paste "LoadModule php5_module m:/servers/php/php5apache2.dll" to the bottom of the LoadModule subsection in php.ini file
- Open NOTEPAD and paste this <? php phpinfo(); ?> into it and save it as test.php into m:/site/
- Reboot.
- Then
from your web-browser open ‘http://localhost/test.php’, if you see the
info. then well done, if not, then something got screwed up…
Now your Web Server is up and running. Now your computer is ready to
create a website on your own and host it to the intranet. All your
website’s data goes into the ‘site’ folder. Create as much links you
want insert multimedia and use php scripts. Well This was just a basic
web server. Windows XP has a connectivity limitations for Web Server.
Only upto 10 connections/sessions can be created. That means at a time
only 10 people can view your site. But that is enough as a home server.