Kamis, 27 Maret 2014

Merubah / Customize Nama Domain "Localhost"

Localhost merupakan domain default bawaan webserver. Jika sobat blogger selesai menginstal webserver (misal: xampp, wamp, appserv, easyphp,PhPTriad, dsb ) kemudian ingin mengetahui hasil dari instalan web server di komputer kita berhasil atau tidak,pertama kali yg dilakukan yaitu mengisi address bar browser dengan “localhost”. Jika sobat blogger punya keinginan untuk mengganti nama domain dari localhost menjadi seperti domain yang asli berbayar di computer local ,

Trik ini menambahkan host di local server atau di localhost kita. Jadi misal kita ingin aplikasi web yang telah di buat di localhost ketika mengaksesnya lewat browser bukan lagi http://localhost/ tetapihttp://namadomain.com/ maka kita perlu menambahkan host ke server lokal di komputer kita. bisa juga di sebut memberikan nama lain dari localhost.





Oke, silahkan sobat blogger perhatikan tutorial berikut
Pertama buka Windows Explorer, kemudian akses alamat ini :

C:\WINDOWS\system32\drivers\etc

nb: alamat tempat file "host" pada OS windows sama dari versi windows Xp - windows 7  

Setelah dibuka maka akan menemukan beberapa file antara lain : host, lmhost, networks, protocol, dan services.

kemudian pilih file "host" 

Edit file "host" pakai notepad++  atau file editor lain. Setelah dibuka akan muncul text default :


# 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:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
127.0.0.1 localhost
Setelah file tersebut dibuka tambahkan baris di bawah tulisan “127.0.0.1 localhost” sesuai dengan nama domain yang dikehendaki misal domainkamu.com. Jadi file tersebut setelah ditambahkan akan menjadi seperti ini :
# 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:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
127.0.0.1 localhost
127.0.0.1 domainkamu.com
Setelah itu simpan atau Ctrl+S. Kemudian buka browser dan ketikkan multimedia.com maka akan diarahkan ke localhost kita, hehe sampai disini domain kamu sudah berubah menjadi domainkamu.com 

Populer Post