Cara Setting Virtual Host

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 2

Cara konfigurasi virtual host

Nama paket Apache2 sama dengan yang digunakan untuk web server #apt-get install apache2 Membuat directory penyimpanan html virtual #mkdir /var/www/virtualhost #cd /var/www/virtualhost #nano index.html
<html><head><title>Yosep Website</title></head> <body>Selamat datang di website saya. Nama saya Yosep nomor absen 33.<br> <marquee>Untuk sementara website ini masih dalam tahap perbaikan</marquee> </body> </html>

membuat database untuk masing-masing domain # cd / # cd /etc/bind/zones tempat kita menyimpan db.local, db.domainkita dan db.127 Untuk mempermudah copy saja db.local ke db.DomainKita # cp db.local db.yosep # nano db.yosep
; ; db,local berfungsi untuk memetakan hostname ke IP ; $TTL 604800 @ IN SOA yosep.com. root.yosep.com. ( 2 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800 ) ; Negative Cache TTL ; @ IN NS ns.yosep.com. @ IN A 192.168.30.10 @ IN AAAA ::1 ns IN A 192.168.30.10 www IN CNAME ns

membuat file konfigurasi pada apache # cd / # cd /etc/apache2/sites-available # nano yosep


<VirtualHost 192.168.30.10:80> ServerName yosep.com

ServerAlias www.yosep.com DocumentRoot /var/www/yosep/ </VirtualHost>

Konfigurasi pada named.conf # cd / # cd /etc/bind # nano named.conf


// This is the primary configuration file for the BIND DNS server named. // // Please read /usr/share/doc/bind9/README.Debian.gz for information on the // structure of BIND configuration files in Debian, *BEFORE* you customize // this configuration file. // // If you are just adding zones, please do that in /etc/bind/named.conf.local include "/etc/bind/named.conf.options"; include "/etc/bind/named.conf.local"; include "/etc/bind/named.conf.default-zones"; zone "kelompok1.com" { type master; file "/etc/bind/zones/db.local"; }; zone "yosep.com" { type master; file "/etc/bind/zones/db.yosep"; }; zone "30.168.192.in-addr.arpa" { type master; file "/etc/bind/zones/db.127"; };

Mengkatifkan virtualhost #a2ensite virtualhost Menon-aktifkan virtualhost #a2dissite virtualhost CLI restart virtualhost #/etc/init.d/apache2 restart Lakukan pengecekan #nslookup www.virtualhost.com

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy