Tuesday 18 August 2015

Cara Setting MultiDomain Di Debian


Langkah - langkah Setting Multi Domain di Debian
# nano /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.2.1
netmask 255.255.255.0
network 192.168.2.0
broadcast 192.168.2.255
auto eth0:0
iface eth0:0 inet static
      address 192.168.2.2
      netmask 255.255.255.0
      network 192.168.2.0
      broadcast 192.168.2.255
auto eth0:1
iface eth0:1 inet static
      address 192.168.2.3
      netmask 255.255.255.0
      network 192.168.2.0
      broadcast 192.168.2.255
# /etc/init.d/networking restart
# apt-get install bind9
# nano /etc/bind/named.conf.options
forwarders {
192.168.2.1;
192.168.2.2;
192.168.2.3;
};
# nano /etc/bind/named.conf.local
zone "smk.com" {
type master;
file "/etc/bind/db.smk";
};
zone "ict.com" {
type master;
file "/etc/bind/db.ict";
};
zone "bisnis.com" {
type master;
file "/etc/bind/db.bisnis";
};
zone "2.168.192.in-addr.arpa" {
type master;
file "/etc/bind/db.smk.rev";
};
# cp /etc/bind/db.local /etc/bind/db.smk
# cp /etc/bind/db.local /etc/bind/db.ict
# cp /etc/bind/db.local /etc/bind/db.bisnis
# cp /etc/bind/db.127 /etc/bind/db.smk.rev
# nano /etc/bind/db.smk
;
; BIND data file local loopback interface
;
$TTL 604800
@ IN SOA ns.smk.com. admin.smk.com. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns.smk.com.
@ IN A 192.168.2.1
ns IN A 192.168.2.1
www IN A 192.168.2.1
# nano /etc/bind/db.ict
;
; BIND data file local loopback interface
;
$TTL 604800
@ IN SOA ns.ict.com. admin.ict.com. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns.ict.com.
@ IN A 192.168.2.2
ns IN A 192.168.2.2
www IN A 192.168.2.2
# nano /etc/bind/db.bisnis
;
; BIND data file local loopback interface
;
$TTL 604800
@ IN SOA ns.bisnis.com. admin.bisnis.com. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns.bisnis.com.
@ IN A 192.168.2.3
ns IN A 192.168.2.3
www IN A 192.168.2.3
# nano /etc/bind/db.smk.rev
;
; BIND reverse data file for local loopback interface
;
$TTL 604800
@ IN SOA ns.smk.com. admin.smk.com. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns.smk.com.
1 IN PTR ns.smk.com.
2 IN PTR ns.ict.com.
3 IN PTR ns.bisnis.com.
# nano /etc/resolv.conf
search smk.com
nameserver 192.168.2.1
# nano /etc/hosts
# /etc/init.d/bind9 restart
# nslookup www.smk.com
# nslookup www.ict.com
# nslookup www.bisnis.com
# apt-get install apache2 php5
# cd /var/www
# mkdir smk
# mkdir ict
# mkdir bisnis
# chmod 755 smk
# chmod 755 ict
# chmod 755 bisnis
# nano smk/index.html
<h1><marquee>SUKSES 1</marquee></h1>
# nano ict/index.html
<h1><marquee>SUKSES 2</marquee></h1>
# nano bisnis/index.html
<h1><marquee>SUKSES 3</marquee></h1>
# nano /etc/apache2/ports.conf
NameVirtualHost 192.168.2.1:80
NameVirtualHost 192.168.2.2:80
NameVirtualHost 192.168.2.3:80
Listen 80
# nano /etc/apache2/sites-available/default
<virtualhost 192.168.2.1:80>
ServerAdmin webserver@smk.com
ServerName www.smk.com

DocumentRoot /var/www/smk
<Directory />
Options FollowSymLinks
AllowOverride None
DocumentRoot /var/www/smk>
<Directory />
# cp /etc/apache2/sites-available/default /etc/apache2/sites-available/ict
# cp /etc/apache2/sites-available/default /etc/apache2/sites-available/bisnis
# nano /etc/apache2/sites-available/ict
<virtualhost 192.168.2.2:80>
ServerAdmin webserver@ict.com
ServerName www.ict.com

DocumentRoot /var/www/ict
<Directory />
Options FollowSymLinks
AllowOverride None
DocumentRoot /var/www/ict>
<Directory />
# nano /etc/apache2/sites-available/bisnis
<virtualhost 192.168.2.3:80>
ServerAdmin webserver@bisnis.com
ServerName www.bisnis.com

DocumentRoot /var/www/bisnis
<Directory />
Options FollowSymLinks
AllowOverride None
DocumentRoot /var/www/bisnis>
<Directory />
# /etc/init.d/apache2 restart
# a2ensite ict

# a2ensite bisnis

No comments:

Post a Comment

Silahkan tinggalkan saran dan komentar anda