Y'herd thisun? 

“Falcon One is going to be the lowest cost per flight to orbit of any production rocket. Which means we’re cheaper than the Chinese, cheaper than [the] Russians or anywhere else – and we’re doing it in the United States with American labour costs.”
-Elon Musk

MONO/Ubuntu part 8 - Test client host files


Test client hosts files

This is somewhat optional at this point of the Ubuntu/Mono tutorial, but if you do it now it'll be out of the way. It has a lot of upside so why not just do it.

Instead of typing the IP Address of the server all the time, you can make your work simpler by changing the hosts files on your client machines. This allows you to use a human readable (and faster typable) name for the server in your client browsers. When you use a network application, such as a browser, the hosts files are checked first so even if the names you put in the file are "real" out on the internet, your machine will instead go to the IP Address you put in the file.

On a Windows machine, you navigate by click or commandline to the C:\Windows\System32\drivers\etc\ folder and open the "hosts" file with notepad. Then you just add lines at the bottom, each line being the IP address, a tab, and the text that you want to be able to type into a browser to call up that address.

If you want to use different extensions (*.com, *.net, *.fred, etc.) or subdomains (www.*, test.*, etc.) just add each on a new line. As you see, I want to be able to strum my fingers with "asdf". By adding lines for "", "" and "" to the hosts file I can use any of those urls to get to the server at If however I point a browser to the url "" or "" then the machine won't use the host file mapping and instead will go out to the internet DNS servers and try to find a "real" site with that url.

For Macs previous to OSX 10.2 setting a custom host value was a pain in the neck. Since Jaguar, though, it's just like Windows. Start Terminal and navigate to the /private/etc/ folder and edit the hosts file.

sudo nano /private/etc/hosts

Add the lines to the bottom of the file.

For Linux clients, it's the same deal. Usually the path to the file is "/etc/hosts"

Changes you save to the hosts file should be picked up by new networking application instances, such as opening a new browser window. However, you might have to close all existing "instances" to goose the app's server (Firefox has to have all instances closed first but new IE instances just get it without shutting down other running ones. A while back I remember having to reboot for Safari on Mac to get the change, but not since upping to Leopard.).

Give your Apache site a test using the hosts mapping...

Coming next: get your Mono ASP.Net running fast and simple (and full featured), step by step.


jump to:

  • 1: Why?
  • 2: Installation
  • 3: Update the OS with APT
  • 4: Remoting to the box with SSH
  • 5: NANO quickies for 95% of the jobs
  • 6: Firewalling Ubuntu 8.10 Server
  • 7: Installing Apache2 and MONO
  • 8: Test client host files
  • 9: Configure MONO on Apache2
  • 10: Apache default pages
  • 11: Handling Apache and Mono Errors
  • 12: Subdomains and Christian porn
  • 13: Virtual Host Tweak: unmanaged cAse sensitiviTy
  • 14: Managed cAse sensitiviTy
  • 15: Managing files and folders
  • 16: Logging Apache Accesses and Errors
  • 17: Ubuntu Task Managers
  • 18: Ubuntu Services and Service Managers
  • 19: Installing Oracle 10g XE Server
  • 20: Connecting Mono to Oracle

  • home     who is smith    contact smith     rss feed π
    Since 1997 a place for my stuff, and it if helps you too then all the better