Pembuatan domain lokal menggunakan XAMPP 7.x dengan sistem operasi Windows sangat diperlukan ketika anda ingin melakukan perancangan sebuah sistem menggunakan PHP Framework seperti Laravel, karena penggunaan domain lokal sesuai dengan instruksi yang disediakan di dokumentasi framework dan tidak merubah susunan folder dan file yang terdapat pada framework tersebut. Hal ini juga memudahkan anda ketika ingin melakukan upload file ke hosting karena telah anda coba berdasarkan nama domain yang anda tuju. Berikut langkah-langkah sederhana yang bisa anda lakukan.
1. Cari File Hosts yang terdapat pada :
C:\Windows\System32\drivers\etc\hosts
2. Edit File Hosts (Administrator Privilege) dan tentukan nama domain
# Copyright (c) 1993-2009 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
# localhost name resolution is handled within DNS itself.
127.0.0.1 localhost
::1 localhost
127.0.0.1 domain.id
127.0.0.1 sistem.id
127.0.0.1 sekolah.id
3. Cari File httpd-vhosts.conf yang terdapat pada :
C:\xampp\apache\conf\extrahttpd-vhosts.conf
4. Edit File httpd-vhosts.conf
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
<VirtualHost *:80>
ServerName localhost
DocumentRoot "C:\xampp\htdocs"
</VirtualHost>
<VirtualHost *:80>
ServerName sistem.id
DocumentRoot "C:\xampp\htdocs\lara_sistem\public"
<Directory "C:\xampp\htdocs\lara_sistem\public">
Options Indexes FollowSymLinks Includes
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
5. Start XAMPP dan Domain lokal sistem.id sudah ready di Browser.
Good Luck!
Reblogged this on PHP Faiz.
LikeLike
Reblogged this on fauziahfitriblog.
LikeLike
Reblogged this on Long Life Gang Pemilu.
LikeLike