How to setup a Web server

I’m sure there are a lot of tutorials out there, and this just might make a nice addition to them! So, let’s take a look at why you want to turn your computer into a webserver

  • You just want to do cool stuff with HTML and want to share with your friends
  • You want a local portal to share stuff with your friends, like FTP space and such
  • You want more power and control over your server than any web host offers you
  • And many more!

Got a reason? Let’s see what you need for this experiment

  • Windows 2000 or later
  • IIS installed
  • Ports forwarded

Before we move on, I’d like you to know that you cannot run PHP on this server, atleast not without configuring and installing PHP!
All right, let’s move to it!

Setting up Windows
For this experiment, you need Windows 2000 or later. I’d be using Windows Vista Ultimate though. Make sure Windows is installed and you can see the desktop, before you begin! :P
First of all, you need to install a web server. I’d be using Microsoft’s IIS (Internet Information Services) which comes by default with Windows (Even Windows 98 had a web server: PWS (Personal Web Server)) though you can use Apache, if you want.

Installing IIS
Insert your Vista disc, head to Control Panel > Programs and Features > Turn Windows features on or off (you’ll find in the right side bar of the Programs and Features windows). A dialog box will pop, find Internet Information Services
Check it, and anything else you want like IIS’s FTP service or ASP.NET or ASP or CGI, or other features and hit OK

Testing
Open Notepad, enter this

<%
Dim testing
  testing = "This works!"
Response.Write(testing)
%>

Save the file as default.asp in C:\inetpub\wwwroot\ replacing or deleting the files that already exist there. Than, open your browser and type in http://localhost/ in the address bar and hit Enter. If you see text saying This works! than your installation has been successful, and you’re ready to move to the next step!

Taking your server public
Unless you just wanted to test your developed applications locally, without having to upload them to your web host, you have to try this out! I also use it for hosting Ascent’s World of Warcraft emulator, since I do not have a dedicated server. So, for this step you need some knowledge about your internet connection. If you have a static IP address, one that never changes (for example, 203.23.43.187) and you are comfortable with giving people your IP address instead of a more comfortable and easier to remember address, you are pretty much done by now! All you need now is, to forward your ports, and you’re good to go! However, if you want to have an address (like my home hosted site is snuke.mine.nu or snukie.mine.nu or home.alizahid.net :P), than you have take advantage of DynDNS’s free service!

Setting up DynDNS
I have been using DynDNS since last year, and never had any problems! It works great and anybody who’s trying this out, I would recommend you DynDNS! First, go to their website and register yourself an account. Next head to this page, and get yourself a hostname. Choose a name, than the domain you want from the drop down menu. Check the Wildcard box. This makes sure if someone enters asd.snukie.mine.nu, they are still able to view snukie.mine.nu instead of getting an error that says: Cannot find the server!. Now, from the three options in Service Type, go for Host with IP address. This configures the host name and points it to your IP address, which you put in the box below. Leave mail routing unchecked, unless you are setting up an email server (Not covered in this experiment!) and hit Create Host. Next, you forward ports

Forwarding required ports
This step is pretty quick and easy. Go to Control Panel > Windows Firewall > Allow a Program through Windows Firewall > Add port > name it HTTP or IIS and in the port number, enter 80. Make sure the protocol is set to TCP. You’re done!

Testing
Hopefully, you didn’t delete the default.asp we created earlier! Fire up your browser, and enter your newly selected host name in the address bar… TADA! You are just viewing your server from outside, congratulations, you have successfully created a web server with IIS and Windows!

Dynamic IP
Okay, so you have a dynamic IP address? No problem, just repeat the steps on Setting up DynDNS followed by the download of this small tool. It’s DynDNS’s Dynamic IP address updater client, which sits on your computer and updates the IP you enter into your host name’s configuration, so you do not have to update it whenever your dynamic IP changes! Life couldn’t be easier, right?

Now that you have successfully setup a web server on your Windows installation, you can have all the fun you want with it! Develop, test, share, everything!
Got questions? Want to share the address of the server you just made? You’re more than welcome to! Have fun!!


About this entry