Setting up your first web server on windows with Apache, PHP and MySQL
Published: August 5, 2003
User Rating: 9.1 (514 votes)
Preparation
While the files are being downloaded, you can prepare your server in the meantime.
-
Checking the server for connection
Make sure that the server is connected to the other computers and centrally accessibly by the clients (or from computers). You can check this by ping the server computer. To do that issue the following command at the client computer:ping xxx.xxx.xxx.xxxwhere
xxx.xxx.xxx.xxx
is the ip address of the server computer. For e.g.ping 192.168.0.1if you receive a series of reply from the server, then the clients can access the server.
Note: If you are installing on a single system, or on your own system for personal use, then use
127.0.0.1
as your ip addressIf you are unable to receive any response from the server, make sure:
- The system in on and running.
- Network cables are properly connected and that OS shows an active connection on it. It might be a loose connection from hub to other system in between.
- Your firewall isn't blocking your clients from accessing your server.
-
Creating the root web directory
Create a directoryc:\www
ord:\www
. This directory would be used as the root directory where all the sites and intranet applications would be saved. So lets say if we were to keep a copy of our own site, then we would create a sub-directory namedigitalamit
and the structure would bec:\www\digitalamit
and so on for other web sites -
Creating a virtual domain name
We want our website to have a virtual domain name. Taking the example of our own website, lets say it to be digitalamit.loc. Now the reason why .loc has been added is to represent that is a local (internal), intranet web site. You can follow the same convention for local website and avoid any confusion between the local copy and on the real web server.To do this we 'll have to tell your your network where to redirect when a local domain is requested. So we have to put the entry for it on your local gateway server or local DNS server. For single system network, your local system is your DNS server.
To do this, we would have to create or modify the
"HOSTS"
file. On Windows 95/98, goto Windows Directory and edit"HOSTS"
file (without quotes), no extensions, just the file name. If you don't findHOSTS
file in the windows directory, try finding the"HOSTS.sam"
file. This is a sampleHOSTS
file provided by Microsoft to let you know on how to use theHOSTS
fileOn Windows NT/2000/XP, this file is located in the
"WINDOWS\system32\drivers\etc"
directory. If the file doesn't exist, create it.Add the following lines to the file
127.0.0.1 localhost xxx.xxx.xxx.xxx domain.loc www.domain.locwhere
xxx.xxx.xxx.xxx
is the ip address of the server computer.Note: If you are installing on a single system, or on your own system for personal use, then use
127.0.0.1
as your ip addressAnd instead of writing domain.loc, write the name of the site you are making, taking an example of our own site digitalamit, write something like this:
127.0.0.1 localhost 192.168.0.1 digitalamit.loc www.digitalamit.locSave and close the file and issue the following command in command prompt, first on the server and then on ALL the clients to check whether the domain name is accessable from all the clients or not.
ping digitalamit.locor whatever domain name you have entered. If you receive a series of reply from the server, then the host configuration is complete.
In case you are unable to ping to new domain, try with the ip address. If still unable, check the action list as mention above. In case, if for some reason your cann't edit the
HOSTS
file or not allowed to, then you 'll have add the above lines in each and every clientsHOSTS
file.
About
Amit Arora is web developer with expertise in developing eCommerce enabled websites for the businesses.

Monitored by Site24x7
Uptime