Wednesday, January 26, 2011

Windows IIS test server setup

hello everyone,

I picked up a new server to do some testing and need of a little help in setting up my environment at home.

Here is what I would like to do: The test server will be used to test new code and configurations for a SaaS product. I would like from my laptop to enter www.acme.com and have it hit the server. The server is connected to a wireless router.

I have windows server 2008 with IIS running on an an IP of 192.168.1.4.

What is the best way to set this up? I want to hit the test server for www.acme.com and not go out to the internet.

Do i need to mess with the LMHosts file?

Thanks for the help. Im sure its easy but have never done this before.

  • Open the hosts file on the Client PCs in C:\WINDOWS\system32\drivers\etc with Notepad and below the line:

    127.0.0.1 localhost

    add another line with:

    192.168.1.4 www.acme.com

    Your browser should check this file before it does a DNS check and use the given IP address.

    Note: This will redirect all traffic for www.acme.com to that server, so if you need access to the actual website you can add a # before the line in hosts to switch it off.

    chopps : this will be done on every machine accessing the server correct? Do i need to do anything on the server if i want to access the site?
    Grizly : Upped, but make sure you are doing this on YOUR Machine, not your server.. (do the same on the server if you want to access it from there too)
    Seanchán Torpéist : Absolutely on the "client" machines. Server only if you want access like Grizly says. If you have a few test clients (5+ maybe?), then a DNS solution might be a better fix for the long term. Easier to change IP and so on
    chopps : so i can browse 192.168.0.4 and the default page comes up but when i do this it still goes out to the net. 192.168.0.4 acme.com ideas?
    Seanchán Torpéist : If you are browsing to www.acme.com, that also needs to be in **hosts** file. If you go to the command line and **ping acme.com" the reply should be 192.168.0.4. If not, your PC is not checking the host file or the host is not formatted correctly.
    Seanchán Torpéist : Try adding **127.0.0.1 crazyname** to a new line in the host file and then ping **crazyname**. The replies should be from **127.0.0.1**.
  • Pretty easy to do - set your laptop to use your W2K8 server as its DNS server. Enable DNS on the server and create a CNAME record for www.acme.com.

    Your server will then intercept www.acme.com DNS requests and serve up its own IP address.

    LMHosts is or rather was used for WINS, not relevant in this scenario.

0 comments:

Post a Comment