Sie sind auf Seite 1von 6

PENGATURAN NETWORK VIRTUALBOX

KONFIGURASI IP ADDRESS
root@debian:/home/esiprek# nano /etc/network/interfaces

perhatikan perintah yang font tebal

# This file describes the network interfaces available on your system


# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface


auto enp0s3
iface enp0s3 inet dhcp

Save konfigurasi IP Address dengan cara ketik Ctrl+X, kemudian tekan Y dan Enter

Pengujian
Cek konfigurasi IP Address dengan perintah ip a pastikan IP sesuai dengan pengaturan yang kita
butuhkan, hasilnya (harap disesuaikan) :

root@debian:/home/esiprek# nano /etc/apt/sources.list


1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group
default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host noprefixroute
valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP
group default qlen 1000
link/ether 08:00:27:88:74:e1 brd ff:ff:ff:ff:ff:ff
inet 10.10.1.84/22 brd 10.10.3.255 scope global dynamic enp0s3
valid_lft 554sec preferred_lft 554sec
inet6 fe80::a00:27ff:fe88:74e1/64 scope link
valid_lft forever preferred_lft forever

KONFIGURASI REPOSITORY
Repository yang akan kita pakai adalah dari internet maka pastikan akses internet server Debian
mendapatkan internet, cara pengecekan dengan cara ping domain internet, contoh 8.8.8.8 atau
1.1.1.1

root@debian:/home/esiprek# ping 1.1.1.1


PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.
64 bytes from 1.1.1.1: icmp_seq=1 ttl=58 time=12.6 ms
64 bytes from 1.1.1.1: icmp_seq=2 ttl=58 time=12.7 ms
64 bytes from 1.1.1.1: icmp_seq=3 ttl=58 time=12.4 ms
^C
--- 1.1.1.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 12.423/12.568/12.664/0.104 ms

Setelah internet didapatkan, selanjutnya atur alamat repository seperti berikut :


root@debian:/home/esiprek# nano /etc/apt/sources.list

deb http://deb.debian.org/debian bookworm main contrib non-free-firmware


deb-src http://deb.debian.org/debian bookworm main contrib non-free-firmware

Lanjutkan dengan mengupdate repository :


root@debian:/home/esiprek# apt update
Hit:1 http://deb.debian.org/debian bookworm InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.

INSTALASI PAKET LAYANAN


root@debian:/home/esiprek# apt install openssh-server bind9 apache2

proses instalasi
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Suggested packages:
bind-doc resolvconf ufw
The following NEW packages will be installed:
bind9
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 493 kB of archives.
After this operation, 1,158 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian bookworm/main amd64 bind9 amd64 1:9.18.16-1~deb12u1
[493 kB]
Fetched 493 kB in 0s (2,254 kB/s)
Selecting previously unselected package bind9.
(Reading database ... 28811 files and directories currently installed.)
Preparing to unpack .../bind9_1%3a9.18.16-1~deb12u1_amd64.deb ...
Unpacking bind9 (1:9.18.16-1~deb12u1) ...
Setting up bind9 (1:9.18.16-1~deb12u1) ...
Adding group `bind' (GID 110) ...
Done.
Adding system user `bind' (UID 102) ...
Adding new user `bind' (UID 102) with group `bind' ...
Not creating home directory `/var/cache/bind'.
wrote key file "/etc/bind/rndc.key"
named-resolvconf.service is a disabled or a static unit, not starting it.
Created symlink /etc/systemd/system/bind9.service → /lib/systemd/system/named.service.
Created symlink /etc/systemd/system/multi-user.target.wants/named.service →
/lib/systemd/system/named.service.
Processing triggers for man-db (2.11.2-2) ...

Setelah semua paket diinstall atur Kembali network virtualbox menjadi HOST ONLY agar PC bawaan
bisa mengakses server

KONFIGURASI REMOTE SERVER


• Remote dari Client
Jalankan aplikasi Putty dan isikan sesuai IP server 192.168.56.101

Masukkan username dan password Debian, jika berhasil maka muncul shell aplikasi terminal
seperti berikut :
KONFIGURASI DNS SERVER
• Konfigurasi

root@debian:/home/esiprek# nano /etc/bind/named.conf.default-zones

Tambahkan zone domain kita (huruf tebal)


// prime the server with knowledge of the root servers
zone "." {
type hint;
file "/usr/share/dns/root.hints";
};

// be authoritative for the localhost forward and reverse zones, and for
// broadcast zones as per RFC 1912

zone "localhost" {
type master;
file "/etc/bind/db.local";
};

zone "127.in-addr.arpa" {
type master;
file "/etc/bind/db.127";
};

zone "0.in-addr.arpa" {
type master;
file "/etc/bind/db.0";
};

zone "255.in-addr.arpa" {
type master;
file "/etc/bind/db.255";
};

zone "esiprek.net" {
type master;
file "/etc/bind/db.esip";
};

zone "56.168.192.in-addr.arpa" {
type master;
file "/etc/bind/db.192";
};

• Konfigurasi berkas zone, dan forward


root@debian:/home/esiprek# cp /etc/bind/db.127 /etc/bind/db.192
root@debian:/home/esiprek# cp /etc/bind/db.local /etc/bind/db.esip

• Konfigurasi db Zone
nano /etc/bind/db.esip

Sesuaikan dengan domainmu


;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA esiprek.net. root.esiprek.net. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS esiprek.net.
@ IN A 192.168.56.101
www IN A 192.168.56.101

• Konfigurasi db Forward
root@debian:/home/esiprek# nano /etc/bind/db.192
Atur sesuaikan dengan IP Address server
; BIND reverse data file for local loopback interface
;
$TTL 604800
@ IN SOA esiprek.net. root.esiprek.net. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS esiprek.net.
101 IN PTR esiprek.net.
101 IN PTR www.esiprek.net.

• Konfigurasi resolving
root@debian:/home/esiprek# nano /etc/resolv.conf
Tambahkan nameserver server Debian kita
nameserver 192.168.56.101
nameserver 8.8.8.8
nameserver 1.1.1.1
nameserver 8.8.4.4

• Restart agar konfigurasi diupdate


root@debian:/home/esiprek# systemctl restart bind9

Pengujian
root@debian:/home/esiprek# nslookup www.esiprek.net
Server: 192.168.56.101
Address: 192.168.56.101#53

Name: www.esiprek.net
Address: 192.168.56.101

root@debian:/home/esiprek# nslookup esiprek.net


Server: 192.168.56.101
Address: 192.168.56.101#53

Name: esiprek.net
Address: 192.168.56.101

root@debian:/home/esiprek# nslookup 192.168.56.101


101.56.168.192.in-addr.arpa name = www.esiprek.net.
101.56.168.192.in-addr.arpa name = esiprek.net.

KONFIGURASI WEB SERVER


root@debian:/home/esiprek# nano /etc/apache2/sites-available/000-default.conf

Ubah dan sesuaikan dengan domainmu

<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com

ServerName www.esiprek.net
ServerAdmin admin@esiprek.net
DocumentRoot /var/www/html

# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,


# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

# For most configuration files from conf-available/, which are


# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include con
• Hapus file index.html

root@debian:/home/esiprek# rm -f /var/www/html/index.html

• Buat tampilan Website sederhana


root@debian:/home/esiprek# nano /var/www/html/index.html

edit dan atur sedemikian rupa


<html>
<head>
<title> BELAJAR WEB SERVER </title>
</head>
<body>
<h1> BELAJAR WEB SERVER </h2>
</body>
</html>

• Update konfigurasi Apache


root@debian:/home/esiprek# systemctl restart apache2

Pengujian
Jalankan program browser dari PC dan ketik di browser esiprek.net, 192.168.56.101

Das könnte Ihnen auch gefallen