Thursday, 2 August 2012

Merubah Nama Domain Localhost


Baru aja browsing nyari-nyari tutorial php buat tugas geladi, eh nemu tutorial ginian. Lumayan nih buat referensi, jadi aku copas aja kesini. sumbernya dari ilmuwebsite.com. Dalam tutorial ini dijelaskan bagaimana merubah domain http://localhost menjadi domain seperti halnya domain TLD yang dibeli dari penyedia layanan hosting/domain. Cara ini berlaku di windows, jadi untuk linux mungkin sedikit berbeda settingnya.
Nah, buat yang udah pernah instal XAMPP atao Apache mungkin udah gak asing lagi dengan localhost. Berikut langkah-langkah merubah domain localhost menjadi domain yang anda inginkan :
Pertama buka Windows Explorer, kemudian akses alamat ini : C:WINDOWSsystem32driversetc. Setelah dibuka maka akan menemukan beberapa file antara lain : host, lmhost, networks, protocol, dan services.
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 domaingue.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 domaingue.com
Setelah itu simpan atau Ctrl+S. Kemudian buka browser dan ketikkan domaingue.com maka akan diarahkan ke localhost kita :D.
Catatan : Setau saya tips ini berlaku hanya di windows, untuk inux triknya sedikit berbeda, tapi masih bermain table name server, pada file host juga.
Terima Kasih. Semoga bermanfaat. Selamat mencoba.

Original link : http://ilesmana.com

No comments:

Post a Comment

Apabila ada yang kurang dimengerti ataupun sesuatu hal yang ingin di sampaikan kepada penulis, silakan isi form komentar, komentar yang mengandung unsur SARA dan tidak pantas akan Admin hapus tanpa pemberitahuan.