Using windows hosts file

Windows hosts file, located under “[SystemDriveLetter]:\Windows\System32\drivers\etc” is very useful when you have to test your web applications hosted either locally or on a remote server and you do not wish to map them to your DNS.

Let’s take an example where you have a website named : http://www.my-simple-web-application.com. You will most likely have 3-4 versions of the application dev, preprod, test, live (where live would be http://www.my-simple-web-application.com)

To facilitate testing you could come up with a standard way of addressing these environments :

http://dev.my-simple-web-application.com
http://preprod.my-simple-web-application.com
http://test.my-simple-web-application.com

Each of these sub-domains might point to the same or different servers. This is where the hosts file comes handy, you can configure something like :

127.0.0.1 dev.my-simple-web-application.com
127.0.0.1 preprod.my-simple-web-application.com
127.0.0.1 test.my-simple-web-application.com

In this example all IP addresses are local, you can change them as needed, beware that this configuration should be place on each desktop (development and test) that you want to use these sub-domains.

On another note, this configuration can also be achieve network wide if you have a configurable router where you can add global hosts.

There a number of other situations where hosts file can be helpful :
1) You are migrating your website to a new server, in this case you can specify you existing domain name in the hosts file and point it to the IP of the new server
2) You have multiple web servers hosting the same application and one of them is not working properly you can target the mischievous server and change your host file to point only this server.

Web Stress Tool

Today I have been trying to web stress my development website using ACT from Microsoft. I am using Visual Studio 2005 Professional, and while taking a look to find this precious tool that was readily available in the previous version VS.NET 2003. I couldn’t find it. (uh!!! did i forget to install it ???? ) checked out but nothing done, checked on the web and reach a forum post which said. Application Test Center is no more available on VS.NET 2005, you can buy a new licence of VS.NET Team tester to to be able to use some stress tool. Ok how nice 🙂 marketing strategy…

Anyway, i have been wandering around the web to find a proper web stress/load tool to be able to test my web developments. results have been pretty deceiving… could not find a proper tool for testing ASP.NET Websites. After some time i came up on sourceforge. to find this tool : WEBLOAD (Open source performance testing) which is the open source version of the recognised Radview Webload.

I’ll be now trying this tool and then give some feedback soon after.

Fiddler – HTTP Debugging Proxy

This is a quiet nice tool, that i have been using for sometimes now.

What is Fiddler?

Fiddler is a HTTP Debugging Proxy which logs all HTTP traffic between your computer and the Internet. Fiddler allows you to inspect all HTTP Traffic, set breakpoints, and “fiddle” with incoming or outgoing data. Fiddler is designed to be much simpler than using NetMon or Achilles, and includes a simple but powerful JScript.NET event-based scripting subsystem.

The website is available here.