Saturday, October 6, 2012

WAMP server on a PC

This weekend I was thinking of hosting a web site. :D  To facilitate it, I needed a web server, and I did not have any clue of how to do this thing. But I've overheard people talking about this thing called an Apache server or something. So I googled Apache Server along with my need. Since Google always knows exactly what we need, it came up with all sorts of solutions.

Then I went through a few articles and got to know about the WAMP server.

WAMP = Windows, Apache. MySQL, PHP

Name it-self gave me a slight insight of it's usage. It is obviously a method to integrate Windows OS with Apache web server and is powered by both PHP for scripting and MySQL for databases.This was what I wanted. So I downloaded it to my Laptop and start experimenting on it.

From google I found out that by typing 'localhost' in my web browser I can access the web sites within my server. But in my case it was different, that is once I typed 'localhost' it directed me to some Windows Application namely IIS7. 

I read about it and understood the mechanism behind this problem. It is that whenever I type 'localhost' in my browser it starts a http request to my loop back  address. (127.x.x.x:80) Then I realized that IIS7 is listening to the port 80 on my laptop. There are two options now, one is to prevent IIS7 from listening to port 80 and the other is to change the port which Apache web server listens to.

As usual I did both. First I found out the configuration file for the Apache Web Server,  httpd.conf, and I read it to understand. It was straight forward. 

I replaced the entry 

LISTEN 80
to
LISTEN 8080.

Then I restarted the service and typed 'localhost:8080' in my web browser. It directed me to the WAMP server index page and proved that I was right.

The other way was to disable IIS7 and doing this was pretty easy.

First typed services.msc in run. Then disabled World Wide Web Publishing Service from the list. But here you don't need to change the listening port number of the 'httpd.conf'.

Either way the server is now up in my PC.

You can access it by typing 'localhost' or 'localhost:8080' according to the way you did the setup.

Thank you.

No comments:

Post a Comment