Create Virtual Host XAMPP Windows [Bahasa Indonesia]

Create Virtual Host XAMPP Windows [Bahasa Indonesia]

Mengaktifkan virtual host

  1. masuk ke direktori xampp/apache/conf
  2. buka file httpd.conf
  3. aktifkan code berikut
    Include conf/extra/httpd-vhosts.conf

Membuat local domain

  1. masuk ke direktori C:\Windows\System32\drivers\etc\
  2. buka file hosts
  3. tambahkan ip address dan servername/hostname

contoh

127.0.0.2 local.mycontacts.edu

Configurasi virtual host

  1. masuk ke direktori xampp/apache/conf/extra
  2. buka file httpd-vhosts.conf
  3. tambakan code berikut

<VirtualHost *:80>
DocumentRoot “dir”
ServerName hostname
ServerAlias hostname

contoh:

<VirtualHost 127.0.0.2:80>
DocumentRoot “C:\xampp\htdocs\my-contacts\public”
ServerName local.mycontacts.edu

contoh lain
Contoh 1:
<VirtualHost *:80>
DocumentRoot “dir”
ServerName hostname
ServerAlias hostname

Contoh 2:

<VirtualHost *:80>
DocumentRoot “dir”
ServerName hostname
ServerAlias hostname
DirectoryIndex index.php
<Directory “dir”>
Options All
AllowOverride All
Order Allow,Deny
Allow from all

#xampp #virtual #hosts #virtualhost #web

Create Virtual Host XAMPP Windows [Bahasa Indonesia]
2.30 GEEK