localhost to myname.com

Localhost is your machine, and to access some application running on it you use something like http://localhost or localhost:<port>.

Letz say you want your name in the URl that you supply to access the application, then you need to do the following things on Windows:

Goto C:\Windows\System32\drivers\etc and edit the hosts file

# Copyright (c) 1993-1999 Microsoft Corp.
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
# For example:
# rhino.acme.com # source server
# x.acme.com # x client host
# localhost

Comment last line and add new one: myname

Now to access your web application, just direct ur browser to http://myname:<port&gt;

I added this info as I myself keep forgetting the hosts file location 😉


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s