Membuat domain di localhost
Seorang programmer PHP sangat butuh software di komputernya untuk menjalankan aplikasi PHPnya , salah satunya adalah XAMPP , karena fasilitasnya sangat komplit dibandingkan Software serupa seperti EasyPHP,APPSERV,dll .
Pada Tutorial kali ini akan membahas bagaimana membuat domain di localhost.
domain yang akan saya buat yaitu gedeblog.sms, Ada tiga tahap untuk membuat domain di localhost :
Tahap 1
Edit file hosts
letaknya untuk tiap system operasi berbeda beda ,
a. LINUX/UNIX
letaknya di etc/hosts
b. Apple
letaknya di Folder System:Preferences dan di Folder System itu sendiri.
c. Windows NT/2000/XP Pro
letaknya di c:\winnt\system32\drivers\etc\hosts atau di c:\windows\system32\drivers\etc\hosts
d. Windows XP Home/Vista
letaknya di c:\windows\system32\drivers\etc\hosts
buka file hosts dengan editor
1 | 127.0.0.1 localhost |
127.0.0.1 /localhost merupakan default dari webserver di komputer kita. Tambahkan baris dibawah untuk domain yang kita inginkan, misalnya :
1 2 | 127.0.0.1 localhost 127.0.0.1 gedeblog.sms |
Tahap 2
Edit file httpd-vhosts.conf , letaknya di [Drive_server_anda]:\xampplite\apache\conf\extra\
tambahkan :
1 2 3 4 5 6 | NameVirtualHost *:80 <VirtualHost *:80> ServerAdmin admin@gedeblog.sms DocumentRoot [drive_server_anda]:/xampplite/htdocs/gedeblog/ ServerName gedeblog.sms </VirtualHost> |
Tahap 3
Restart apache dan jalankan domain yang anda buat.
Hasilnya :

mudah bukan , selamat membuat domain sendiri di komputer anda


This post has 11 comments
April 29th, 2009
tes aja
May 1st, 2009
Biasa pake Linux + Nginx, udah lupa gimana pake Apache.. :P
Postingan Terakhir Nazieb…Watchmen
May 6th, 2009
Seep…tak cobane kang….
Postingan Terakhir masHendri_cakep…Ramuan Seorang Blogger
May 10th, 2009
Saya pernah install XAMPP di windows XP malah problem, apakah saya install ya ?
Postingan Terakhir kanoko…ClickBank telah hadir di Indonesia
May 10th, 2009
hm… makanan temen saya sehari-hari buat domain di localhost tuh mas… klo saya coding aja dulu…
May 22nd, 2009
Waduh, harus di coba nih! Biasa pake Appserv sih…
hmm harus donlot xampp dulu nih, tp kl di appserv bisa ga sih nambahin nama domain sendiri?
oiya, salam kenal
Postingan Terakhir Budiclan…Cari Uang dari Facebook - Tes Belajar SEO
==================
Gedeblog:
di Appserv bisa kok bro .., caranya sama..tinggal u ngubah file hosts dan httpd-vhosts.conf aja…yg letaknya u sesuaikan dengan settingan kompi u , salam knal juga bro
June 4th, 2009
Tahap 2
Edit file httpd-vhosts.conf , letaknya di [Drive_server_anda]:\xampplite\apache\conf\extra\
tambahkan :
1
2
3
4
5
6
NameVirtualHost *:80
ServerAdmin admin@gedeblog.sms
DocumentRoot [drive_server_anda]:/xampplite/htdocs/gedeblog/
ServerName gedeblog.sms
(pak mau nanya nich? maksudnya yg tahap 2 itu gmn? terutama yg
Edit file httpd-vhosts.conf , letaknya di [Drive_server_anda]:\xampplite\apache\conf\extra\
(posisi nya itu dimana)
Terima kasih.
Yosh.
=============
Gedeblog:
tergantung drive anda menginstal servernya pak, klo saya install di drive C , berarti letaknya ya C:\xampplite\apache\conf\extra\
klo di D ya letaknya D:\xampplite\apache\conf\extra\
June 13th, 2009
.wah, kerenn . .
.thx infonya . .
.langsung coba ah . .
June 23rd, 2009
ko jadi gini mas keluarnya
Access forbidden!
You don’t have permission to access the requested directory. There is either no index document or the directory is read-protected.
If you think this is a server error, please contact the webmaster.
Error 403
ungunet.com
06/23/09 19:39:06
Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i PHP/5.2.9
================
Gedeblog :
itu artinya di folder itu blm ada file utama seperti index.php,index.html klo blm ada tinggal buat file diberi nama index.html ato index.php klo tidak ada masalah dgn chmod di folder itu , sehingga tidak terbaca oleh luar , agar bisa terbaca tinggal di chmod 755 ato 777 di folder itu
August 7th, 2009
di coba …
thx artikelnya …
November 4th, 2009
boss saya blom bisa nih, saya dah rubah filenya,
#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn’t need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
#
# for further details before you try to setup virtual hosts.
#
# You may use the command line option ‘-S’ to verify your virtual host
# configuration.
#
# Use name-based virtual hosting.
#
##NameVirtualHost *:80
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any block.
#
##
## ServerAdmin webmaster@dummy-host.example.com
## DocumentRoot /www/docs/dummy-host.example.com
## ServerName dummy-host.example.com
## ServerAlias http://www.dummy-host.example.com
## ErrorLog @rel_logfiledir@/dummy-host.example.com-error_log
## CustomLog @rel_logfiledir@/dummy-host.example.com-access_log common
##
##
## ServerAdmin webmaster@dummy-host2.example.com
## DocumentRoot /www/docs/dummy-host2.example.com
## ServerName dummy-host2.example.com
## ErrorLog @rel_logfiledir@/dummy-host2.example.com-error_log
## CustomLog @rel_logfiledir@/dummy-host2.example.com-access_log common
##
NameVirtualHost *:80
ServerAdmin admin@zinx.com
DocumentRoot C:/xampplite/htdocs/gedeblog/
ServerName zinx.com
pa bener cara ngerubahnya gtu? trus di save?…