Mengganti Localhost Menjadi Domain Kita Sendiri (Apache – XAMPP)

Note :
- OS : Windows
- Webserver : Apache – XAMPP

Di local computer, kita biasa menggunakan http://localhost/ untuk membuka local website kita, kita bisa memodifikasi localhost tersebut menjadi domain kita sendiri, misal http://domainku.com/

  1. Buka dan edit file C:/WINDOWS/system32/drivers/etc/host
    Di bawah anda akan menemui baris :
    127.0.0.1       localhost

    Lalu tambahkan satu lagi baris dibawahnya :
    127.0.0.1       domainku.com

    Setelah itu save file tersebut.

  2. Buka dan edit file C:/Program Files/xampp/apache/conf/extra/httpd-vhosts.conf
    Tambahkan baris-baris berikut di bagian paling bawah dari file tersebut :
    NameVirtualHost localhost:80
    <VirtualHost localhost:80>
    DocumentRoot c:/xampp/htdocs
    ServerName localhost
    </VirtualHost>

    NameVirtualHost domainku.com:80
    <VirtualHost domainku.com:80>
    DocumentRoot c:/xampp/htdocs/domainku
    ServerName domainku.com
    </VirtualHost>

    Lalu save file tersebut.

  3. Restart service Apache.
  4. Buka http://domainku.com/ di browser anda.

Sumber

2 Comments

  1. you do write some very complete posts. You suffer from the same disease I do. Want to get the whole story out there and tie it up with a bow all pretty.

  2. dhewana says:

    thanks for comment.. :)

Leave a comment