Config Ip Address
nano /etc/netplan/50-cloud-init.yaml
network:
ethernets:
enp0s3:
addresses:
- 172.17.77.155/24 #sesuaikan dengan ip yang di gunakan
gateway4: 172.17.77.254
nameservers:
addresses:
- 172.17.77.155 #
- 8.8.8.8
search:
- tentang.com #isikan nama dns yang akan di buat
optional: true
version: 2
#Update
apt-get update
#upgrade
apt-get upgrade
#install paket Bind9
apt-get install bind9
#Edit file defalut zone
nano /etc/bind/named.conf.default-zones
tambahkan zone seperti di bawah :
zone "tentang.com" {
type master;
file "/etc/bind/db.tentang";
};
zone "77.17.172.in-addr.arpa" {
type master;
file "/etc/bind/db.172";
};
#cp file db.local menjadi db.tentang
cp /etc/bind/db.local /etc/bind/db.tentang
#cp file db.127 menjadi db.172
cp /etc/bind/db.127 /etc/bind/db.172
# Open db.tentang dan edit menjadi sbb :
Nano /etc/bind/db.tentang
; BIND reverse data file for local loopback interface
;
$TTL 604800
@ IN SOA ns.tentang.com. root.tentang.com. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns.tentang.com.
@ IN A 172.17.77.155
@ IN MX 10 mail.tentang.com.
ns IN A 172.17.77.155
www IN CNAME ns
mail IN A 172.17.77.155
# Open db.172 dan edit menjadi sbb :
Nano /etc/bind/db.172
; BIND reverse data file for local loopback interface
;
$TTL 604800
@ IN SOA ns.tentang.com. root.tentang.com. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns.tentang.com.
1 IN PTR ns.tentang.com.
1 IN PTR www.tentang.com
1 IN PTR mail.tentang.com
#Edit Resolv.conf tambahkan name server sbb :
nameserver 172.17.77.155
search tentang.com
#restart Bind
/etc/init.d/bind9 restart
#test dns
root@eraadmin:/# nslookup tentang.com
Server: 172.17.77.155
Address: 172.17.77.155#53
Name: tentang.com
Address: 172.17.77.155
root@eraadmin:/# nslookup www.tentang.com
Server: 172.17.77.155
Address: 172.17.77.155#53
www.tentang.com canonical name = ns.tentang.com.
Name: ns.tentang.com
Address: 172.17.77.155
Membuat Virtual Host Web Server APache2 Ubuntu 18.04
#Install Apache2
apt-get install apache2
#buat file tentang.conf
touch tentang.conf /etc/apache2/site-available/
#buka file tentang.conf dan isi
nano /etc/apache2/site-available/tentang.conf
ServerName tentang.com
ServerALias www.tentang.com
ServerAdmin webmaster@tentang.com
DocumentRoot /var/www/html/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
#aktifkan Virtual host
a2ensite tentang.conf
#restart apache2
systemctl restart apache2
Finish
coba test buka di browser
www.tentang.com
0 Komentar