Thousands of readers can be wrong

A Dreamer, a Photographer, a Musician, a Webdesigner... sometimes a Java coder too: I am Niccolò Favari and this blog is about New Media, Creativity, Business, Communication, Entrepreneurship and lots more. Boring stuff indeed, because I am a very boring dude.

Well, what's the point? I have no point. I just keep writing. And it feels good.

RSS Feeds Icon

LinkedIn Icon

Facebook Icon

Get your own Webserver up in minutes

Today we’re gonna set up a WAMP server. This is not a step by step guide. It’s more a “concept” paper. I will show you what you have to do in order to get your server up in minutes but you’ll have to work your way to the end alone.

WAMP is an acronym for the combination Microsoft Windows, Apache, MySQL and one or more of Perl, PHP and Python [...]

Each element of the WAMP acronym provides an essential layer of functionality:

  • Microsoft Windows is the operating system;
  • Apache is the web server;
  • MySQL is the DBMS (database management system [or, database server]);
  • PHP is an object-oriented web scripting language;
  • Perl is a powerful, general-purpose, object-oriented scripting language;
  • Python is yet another powerful, general-purpose, object-oriented scripting language.

Taken from the Wikipedia

A friend of mine came to me and asked “how di you set up wordpress on your notebook?” and so I showed him how. (I was just beta-testing the version 2 of WP on a notebook before getting it on my “production site”).

Why do you need this?

As I anticipated, you may need a local webserver for various reasons:

  • you wanna learn PHP or SQL and you just want to get the job done without too many hassles
  • you wanna test the latest bleeding edge script you just downloaded from the internet
  • you have a broadband, always on internet connection and you decided to become your own hosting provider

Getting a URL (a Web Address)

Before you begin you need to obtain a web address. Since you probably have a dynamic IP, everytime you connect to the internet you get a different address. It’s quite impossible to assign a name, a url, to an ever changing IP address. That name would point to the same IP… while your computer could have a different one. Free services like dynDNS or no-ip.com provide your with a little software that can solve this problem.

You register an account with them (it’s free). You get a url that points to your actual IP. Their software automatically check and update the remote IP assigned to that url so it is exactly the same as your current one. The resulting name will always point to your machine.

Dynamic DNS in the Netgear Web Admin Setup

If you got a router like mine (Netgear DG384G v2) you can set your name and password for dynDNS in the Dynamic DNS tab, via the web setup without the softwares.

Try to setup your own Web Address; should you ever need more info check out the great article on LifeHacker: how to assign a domain name to your home web server

Setting up the server

This step is as easy as downloading Apache2Triad and installing it.

Apache2Triad

I recommend the 1.4.x series as it contains Apache 2.0, PHP4 and MySQL4 which are supposed to be more stable and widespread over Apache 2.2, PHP5 and MySQL5.

There is an article on LifeHacker (again) on How To Set Up A Personal Home Web Server but it follows the hard path: downloading every single component and installing it (to tell the truth it covers only the apache webserver… so stick with Apache2Triad if you want the whole fun!)

NOTE:
It is quite important to choose a hard to guess password when you install Apache2Triad. It will be used to access the web control panel and it could be used by others as well to compromise the security of the server by remotely accessing your control panel.

Apache2Triad Control Panel
This is the web control panel of Apache2Triad. Notice the cool icons ;)

When you have set up your apache2triad webserver (and you’re basically done) remember to select “change domain” and insert your new dynDNS or no-ip domain name.

Have fun

Yes. It was only a 2 steps job. Pretty Easy uh? Should you ever need support post your comment here and I’ll be glad to help you or either point you to the resources you need.

Troubleshooting

Q: I cannot access my webserver from the outside.
A: Disable every kind of software firewall and the try again. If the problem persists you have misconfigured something.

Q: When I type my own address I see the web control panel of my router.
A: This is because the address translation is made by your router. If you were to view the server from outside the LAN network, you could perfectly see it. You can bypass this problem by simply editing the hosts file found in “C:\WINDOWS\system32\drivers\etc“.
Add the following lines to it:
127.0.0.1 localhost
192.168.0.2 yourdomain.homedns.org

The first line maps the “localhost” name to “127.0.0.1“. The second line does the same kind of mapping but when you type the domain name assigned to dynDNS it will be like you were typing 192.168.0.2 and no more the address of your router.

Please note that 192.168.0.2 should be the address assigned to your computer by the router. It is the internal LAN address of your machine. Open up your LAN connection panel to obtain it if you don’t know it.

Q: I want my software firewall to be on.
A: In this case you simply need to configure it. Personally I think that the XP firewall is a good piece of software. You simply need to open the 80 and 25 ports (unless you’re using different ports for the servers).

Q: I have a firewall inside my router.
A: Check your router configuration to correctly forward ports 80 (hhtp) and 25 (ftp). Should you ever need help with port forwarding check out portforward.com

Q: I’m overwhelmed by traffic!
A: Hell yeah, sometimes it just happens… take a look at Configuring Apache - Don’t Succumb To The “Slashdot Effect”