Membuat Virtual Host Di Local Computer

4
Membuat Virtual Host di Local Computer (Studi Kasus: XAMPP Windows XP Sp3) Copyright: ? (Document Pribadi silahkan disebarkan!) Langkah 1: Isinya seperti ini: Buka file *conf C:\xampp\apache\conf\httpd.conf Contoh: Anda biasa akses dokument aplikasi web anda pada http://localhost/nama_folder/nama_folder maka, studi kasus ini kita akan ubah menjadi nama_folder.com (Ilustrasi # # 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 # <URL:http://httpd.apache.org/docs/2.2/vhosts/> # 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 <VirtualHost> block. # ##<VirtualHost *:80> ##ServerAdmin [email protected]

Transcript of Membuat Virtual Host Di Local Computer

Page 1: Membuat Virtual Host Di Local Computer

Membuat Virtual Host di Local Computer

(Studi Kasus: XAMPP Windows XP Sp3)

Copyright: ? (Document Pribadi silahkan disebarkan!)

Langkah 1:

Isinya seperti ini:

Buka file *conf C:\xampp\apache\conf\httpd.conf

Contoh: Anda biasa akses dokument aplikasi web anda pada

http://localhost/nama_folder/nama_folder maka, studi kasus ini kita akan ubah

menjadi nama_folder.com (Ilustrasi Pribadi)

## 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 # <URL:http://httpd.apache.org/docs/2.2/vhosts/># 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 <VirtualHost> block.###<VirtualHost *:80> ##ServerAdmin [email protected] ##DocumentRoot "C:/xampp/htdocs/dummy-host.localhost" ##ServerName dummy-host.localhost ##ServerAlias www.dummy-host.localhost ##ErrorLog "logs/dummy-host.localhost-error.log" ##CustomLog "logs/dummy-host.localhost-access.log" combined##</VirtualHost>

##<VirtualHost *:80> ##ServerAdmin [email protected] ##DocumentRoot "C:/xampp/htdocs/dummy-host2.localhost" ##ServerName dummy-host2.localhost ##ServerAlias www.dummy-host2.localhost ##ErrorLog "logs/dummy-host2.localhost-error.log" ##CustomLog "logs/dummy-host2.localhost-access.log" combined##</VirtualHost>

Page 2: Membuat Virtual Host Di Local Computer

Langkah 2:

Tambah kan baris perintah seperti ini pada file httpd.conf

Penjelasan: Disini setiap akses ke localhost akan langung diarahkan ke htdocs, jika ada folder

maka isi folder akan terlihat. Pada baris lain (bisa ditambakan sendiri), kita akan membuat direct link, ketika

mengetikan bokep.com akan diarahkan ke direct link (symlink) yaitu folder bokep.

Langkah 3:

Penjelasan: Secara default, akes localhost akan di arahkan ke folder htdocs yang udah kita

setting di langkah sebelumnya yang di dengar dengan host local/ 127.0.0.1 Pada baris selanjut, ketika kita ketikan bokep.com, maka akan diarahkan ke folder

lab/bokep yang udah kita seting seblumnya.

# Document ROOT<VirtualHost *:80> ServerName localhost DocumentRoot "C:\xampp\htdocs"</VirtualHost>

# Setup "helloworld.tld" Virtual Host<VirtualHost *:80> ServerName bokep.com DocumentRoot "C:\xampp\htdocs\lab\bokep"

<Directory "C:\xampp\htdocs\lab\bokep "> Options Indexes FollowSymLinks Includes AllowOverride All Order allow,deny Allow from all </Directory></VirtualHost>

Buka file *hosts C:\WINDOWS\system32\drivers\etc\hosts

# 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 localhost127.0.0.1 bokep.com

Page 3: Membuat Virtual Host Di Local Computer

Langkah 4:

Penjelasan: Restar server.

Next:

Pake Gnu/Linux, (insyaAllah).

RESTART

http://toniharyanto.com/blog/2012/08/membuat-domain-lokal-menggunakan-apache-virtual-hosts