0% found this document useful (0 votes)
101 views

Lab 1: Setup Oracle Virtualbox Lab 2: Membuat Virtual Machine

The document outlines a lab for setting up a Linux server system using Oracle VirtualBox. It includes 9 sections that cover: 1) Setting up the VirtualBox virtual machine. 2) Installing Linux Debian in the VM. 3) Basic Linux commands. 4) Configuring the host-VM and Windows-VM networks. 5) Setting up software repositories. 6) Installing SSH. 7) Installing the LAMP stack. The goal is to install a Debian server VM, connect it to the host network, and install applications like Apache, MySQL, and PHP to set up a basic LAMP server.

Uploaded by

kenjiro08
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
101 views

Lab 1: Setup Oracle Virtualbox Lab 2: Membuat Virtual Machine

The document outlines a lab for setting up a Linux server system using Oracle VirtualBox. It includes 9 sections that cover: 1) Setting up the VirtualBox virtual machine. 2) Installing Linux Debian in the VM. 3) Basic Linux commands. 4) Configuring the host-VM and Windows-VM networks. 5) Setting up software repositories. 6) Installing SSH. 7) Installing the LAMP stack. The goal is to install a Debian server VM, connect it to the host network, and install applications like Apache, MySQL, and PHP to set up a basic LAMP server.

Uploaded by

kenjiro08
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

LAB SO

1 Agustus 2013
Rev 0.2
Nyoman S. ST. CCNP

LAB SISTEM OPERASI

TUJUAN :
1.
2.
3.
4.
5.
6.
7.
8.
9.

Mengenal OS Server Linux Debian


Melakukan instalasi Server
Melakukan Simulasi Server menggunakan ORACLE VirtualBox
Membangun koneksi Jaringan HOST dengan VM
Melakukan Remote Manajemen Server
Mengenal Repository
Menginstall LAMP
Menginstall Proxy
Menginstall DNS

LAB 1 : SETUP ORACLE VIRTUALBOX


LAB 2 : MEMBUAT VIRTUAL MACHINE
1.
2.
3.
4.
5.
6.
7.
8.
9.

Jalankan Oracle VM VirtualBox


Klik File -> New
Welcome to the new -> Next
VM Name and OS type -> Isi Name : debian -> Operating System : Linux -> Version : Debian -> Next
Memory -> Isi 512 MB -> Next
Hard Disk virtual -> Centang Create new Hard Disk -> Next
Welcome to the virtual -> File type centang VDI -> Next
Virtual disk storage details -> centang Dynamically expanding -> Next
Location -> Klik icon folder di location -> arahkan ke drive D (sebelumnya buat folder baru dengan nama
LAB Virtual di drive D) -> Size isi 8 GB -> Next
10. Summary -> Create
Catatan :
Untuk langkah No 6 jika menggunakan Cloning VM pilih Use existing HDD & LAB 3 dilewati
Jalankan VM -> Masuk sebagai root
Ketik : cd /etc/udev/resolv/rules.d
Hapus file : rm rf 70-persistent-net
Reboot

LAB 3 : SETUP LINUX DEBIAN


1.
2.
3.
4.
5.

Masukkan DVD installer debian atau siapkan File ISO di PC/Notebook


Jalankan VirtualBox -> start VM Debian yang sudah dibuat tadi
Welcome to the first run -> Next
Select Installation Media -> klik icon folder
Virtual media manager -> klik add -> arahkan ke lokasi file ISO Debian -> Open -> Next

1|L i n u x L A B

LAB SO
1 Agustus 2013
Rev 0.2
Nyoman S. ST. CCNP

6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.

Summary -> Start


Muncul menu instalasi -> pilih Install
Select a Language -> English
Select your location -> Pilih Other -> Asia -> Indonesia
Configure locales -> United States
Select a keyboard layout -> American English
Configure the network -> Isi Name server address : 8.8.8.8 8.8.4.4
Configure the network -> Hostname : debian
Configure the network -> Domain Name : Kosongkan
Set up users & password -> root password : debian
Set up users & password -> re-enter root password : debian
Set up users & password -> Full name for the user : mhs
Set up users & password -> username for your account : mhs
Set up users & password -> choose a password for new user : isi mhs
Set up users & password -> Reenter password : mhs
Partition disks -> Pilih Guided Entire disk
Partition disks -> select disk to partition -> enter
Partition disks -> partitioning scheme -> separate /home partition -> enter
Partition disks -> Finish partitioning

Catatan :

25.
26.
27.
28.
29.

/ atau root : lokasi file system sama dengan drive C windows


Swap : memory virtual untuk membantu memory fisik
/home : lokasi penyimpanan data sama dengan MyDocuments windows

Partition disks -> write changes to disks -> yes


Configure the clock -> Jakarta
Configure the package manager -> Scan another CD or DVD -> No
Configure the package manager -> Use a network mirror -> no
Configuring popularity-contest -> participate -> No

2|L i n u x L A B

LAB SO
1 Agustus 2013
Rev 0.2
Nyoman S. ST. CCNP

30. Software selection -> Choose software to install -> continue (jangan centang apapun)

31. Install the GRUB boot loader -> Yes


32. Configuring man-db -> installation complete -> continue

33. Finish reboot


34. Login : mhs -> password : mhs
35. Setelah masuk sistem -> ambil snapshot -> untuk keperluan restore jika virtual OS mengalami kerusakan

3|L i n u x L A B

LAB SO
1 Agustus 2013
Rev 0.2
Nyoman S. ST. CCNP

LAB 4 : PERINTAH DASAR LINUX DEBIAN


1.

Jalankan Virtual OS Debian -> login : root password :debian

2. Melihat Lokasi/direktori

root@debian:~#

-> Lokasi awal

root@debian:~# cd /home

-> cd (change directory) menuju ke folder home

root@debian:/home#

-> Lokasi di folder home

root@debian:/home# cd /etc
root@debian:/etc# cd /..

-> berpindah lokasi ke folder etc

-> kembali 1 tingkat ke folder sebelumnya

3. Melihat isi sebuah folder

root@debian:/etc/squid# cd /var

-> masuk folder var

root@debian:/var# ls
-> melihat isi folder var
backups cache lib local lock log mail opt run spool tmp
-> isi folder var

root@debian:/var# ls l
total 44
drwxr-xr-x 2 root root 4096 Oct 3 2011 backups
drwxr-xr-x 6 root root 4096 Jun 12 15:59 cache
drwxr-xr-x 31 root root 4096 Jun 12 17:04 lib
drwxrwsr-x 2 root staff 4096 Oct 3 2011 local
drwxrwxrwt 2 root root 4096 Jul 15 11:44 lock
drwxr-xr-x 8 root root 4096 Jul 15 11:45 log
drwxrwsr-x 2 root mail 4096 Jun 12 15:58 mail
drwxr-xr-x 2 root root 4096 Jun 12 15:58 opt
drwxr-xr-x 4 root root 4096 Jul 15 11:45 run
drwxr-xr-x 5 root root 4096 Jul 14 15:54 spool
drwxrwxrwt 2 root root 4096 Oct 3 2011 tmp

4. Membuat folder baru

root@debian:/#cd /home

4|L i n u x L A B

-> melihat isi detil folder var


-> huruf d (menandakan sebuah folder)
root root adalah pemilih folder

LAB SO
1 Agustus 2013
Rev 0.2
Nyoman S. ST. CCNP

root@debian:/home# mkdir test

-> mkdir (make directory) didalam folder home

root@debian:/home# ls -l
total 24
drwx------ 2 root root 16384 Jun 12 15:57 lost+found
drwxr-xr-x 2 nyoman nyoman 4096 Jun 12 17:15 nyoman
drwxr-xr-x 2 root root 4096 Jul 15 12:49 test
-> folder yang baru dibuat

5. Hak akses sebuah file / folder


Hak akses dibagi 3 (Read,Write dan Execute)
Read 4
Write 2
Execute 1
Misal : drwxr-xr-x 2 root
d : direktori
rwx : ijin read+write+eksekusi untuk root (nilai 7)
r-x (kolom kedua) :ijin read+eksekusi untuk grup (nilai 5)
r-x (kolom ketiga) : ijin read+eksekusi untuk other (nilai 5)

root@debian:/home# ls l
-> melihat isi dan hak akses di dalam sebuah folder
total 24
drwx------ 2 root root 16384 Jun 12 15:57 lost+found
drwxr-xr-x 2 nyoman nyoman 4096 Jun 12 17:15 nyoman
drwxr-xr-x 2 root root 4096 Jul 15 12:49 test
root@debian:/home# chmod -R 777 test

-> ijin akses folder test read+write+execute user


root,grup & other), -R menandakan aturan tersebut
diterapkan ke subfolder dan semua file didlmnya

root@debian:/home# ls -l
total 24
drwx------ 2 root root 16384 Jun 12 15:57 lost+found
drwxr-xr-x 2 nyoman nyoman 4096 Jun 12 17:15 nyoman
drwxrwxrwx 2 root root 4096 Jul 15 12:49 test

6. Membuat file baru

root@debian:/home#nano latihan
Catatan :
5|L i n u x L A B

-> status folder test

LAB SO
1 Agustus 2013
Rev 0.2
Nyoman S. ST. CCNP

Keluar dan simpan : Ctrl + x -> Y -> Enter


Copy : Ctrl + K
Paste : Ctrl + U
Search keyword : ctrl + w

7. Copy Folder
Copy file test1 dari folder home ke folder etc dengan nama sama
# cp /home/test1 /etc/test1

Copy semua isi folder home ke folder etc


# cp /home/* /etc/

Copy folder1 beserta seluruh isinya ke folder etc


# cp -R /home/folder1 /etc/folder1

8. Move & Rename File/Folder

root@debian:/home# nano test


lost+found nyoman test
root@debian:/home# mv test cobacoba
root@debian:/home# ls
cobacoba lost+found nyoman

9. Hapus folder atau file

root@debian:#cd /home
root@debian:/home# mkdir test
root@debian:/home# ls
lost+found nyoman test
root@debian:/home# rm rf test

6|L i n u x L A B

-> rename folder test menjadi cobacoba

LAB SO
1 Agustus 2013
Rev 0.2
Nyoman S. ST. CCNP

root@debian:/home# ls
lost+found nyoman

LAB 5 : SETUP JARINGAN HOST VM


1.

Edit File IP Address

#nano /etc/network/interfaces

Kondisi default VM tidak mempunayi IP Statis tetapi menggunakan NAT (IP Dinamis/berubah-ubah)
Isi sesuai gambar berikut -> setelah selesai tekan ctrl + x -> Y -> Enter

Catatan : tanda pagar untuk menonaktifkan baris tertentu


2.

Ubah mode network Virtual OS Debian ke Host-only Adapter -> klik kanan icon komputer kanan bawah di
Virtual Box -> isi sesuai gbr dibawah -> OK

7|L i n u x L A B

LAB SO
1 Agustus 2013
Rev 0.2
Nyoman S. ST. CCNP

3.

Restart network adapter Debian

#/etc/init.d/networking restart

Catatan : pastikan tidak ada indikator failed, jika ada cek kembali file /etc/network/interfaces

LAB 6 : SETUP JARINGAN WINDOWS


1.

klik kanan icon network kanan bawah -> Open Network & Sharing Center

2.

Pilih change adapter setting

8|L i n u x L A B

LAB SO
1 Agustus 2013
Rev 0.2
Nyoman S. ST. CCNP

3.

Setup IP adapter VirtualBox Host-Only Network -> Klik kanan properties -> Pilih tab Networking ->
TCP/IPv4 -> Klik 2x -> ini adalah IP Host Windows anda -> OK

4.

Matikan Firewall Host -> Buka control panel -> System & Security -> Windows Firewall -> Pilih turn
windows firewall on or off -> OK

5.

Dari windows -> Buka DOS -> Ping ke IP server

9|L i n u x L A B

LAB SO
1 Agustus 2013
Rev 0.2
Nyoman S. ST. CCNP

LAB 7 : SETUP REPOSITORY


1. Repositori adalah kumpulan modul & aplikasi LINUX, instalasi bisa dilakukan secara ONLINE
(internet) atau OFFLINE (via DVD), untuk simulasi kali ini dilakukan secara offline agar proses instalasi
lebih cepat
2. Mounting DVD Debian -> klik icon CD kanan bawah -> Choose a virtual -> ambil file ISO di Drive
D/Linux/ -> pilih yang ukuran 4.5 GB

3. Mounting DVD

#apt-cdrom add

3. Ubah Referensi file update repo

#nano /etc/apt/sources.list

Beri tanda pagar semua kecuali deb cdrom -> save -> ctrl + x -> Y -> Enter

10 | L i n u x L A B

LAB SO
1 Agustus 2013
Rev 0.2
Nyoman S. ST. CCNP

4. Update Repo ke acuan DVD

#apt-get update

LAB 8 : SETUP SSH


1. Setup SSH

#apt-get install ssh

2. Install Win SCP


3. Siapkan tool Putty

LAB 9 : SETUP LAMP


LAMP merupakan paket dari Linux Apache (webserver), MySQL (database) dan PHP (Bahasa Pemrograman), dengan
instalasi LAMP maka kita sudah membuat sebuah server Web & Database

1.

Dari windows (client) remote ke server menggunakan tool Putty -> masukkan IP Server -> Setup modul LAMP nantinya
bisa copy-paste via Putty

2. Install Webserver

root@Debian:~# apt-get install apache2

3. Install PHP5

11 | L i n u x L A B

LAB SO
1 Agustus 2013
Rev 0.2
Nyoman S. ST. CCNP

root@Debian:~# apt-get install libapache2-mod-php5 php5-cli


php5-common php5-cgi

4. Install Database MySQL

root@Debian:~# apt-get install mysql-client mysql-common


mysql-server php5-mysql

5. Opsional Paket tambahan

root@Debian:~# apt-get install php5-sqlite php5-gd

6. Restart service

root@Debian:~# /etc/init.d/mysql restart


root@Debian:~# /etc/init.d/apache2 restart

LAB 10 : SETUP PHPMYADMIN


Dengan menggunakan tool pendukung phpmyadmin akan memudahkan anda sebagai database administrator dalam
mengelola database MySQL via Web dengan GUI yang user-friendly
1.

Install phpmyadmin

root@Debian:~# apt-get install phpmyadmin

2.

Pilih apache2 -> tekan spasi

3.

Test dari PC/Notebook client

Misal : http://ip server anda/phpmyadmin

12 | L i n u x L A B

LAB SO
1 Agustus 2013
Rev 0.2
Nyoman S. ST. CCNP

4.

Restart service

root@Debian:~# /etc/init.d/mysql restart


root@Debian:~# /etc/init.d/apache2 restart

LAB 11 : SQUID PROXY


1. Instal squid
root@debian:~# apt-get install squid

2. Copy file asli config squid sebelum dilakukan perubahan


root@debian:~# cd /etc/squid
root@debian:/etc/squid# cp squid.conf squid.conf.ori
root@debian:/etc/squid# ls
squid.conf squid.conf.ori

3. Edit squid.conf
root@debian:/etc/squid# nano squid.conf

Tekan CTRL + W -> search : http_port 3128


3128 adalah port default yang digunakan Squid, bisa kita rubah ke 8080 atau port lainnya
13 | L i n u x L A B

LAB SO
1 Agustus 2013
Rev 0.2
Nyoman S. ST. CCNP

Untuk mode squid transparent tinggal menambahkan kata transparent setelah 3128 tetapi
membutuhkan sebuah router atau PC Proxy terhubung langsung ke IP Public
Saat ini kita gunakan default

Tekan CTRL + W -> search : acl localnet


Sesuaikan dengan network jaringan kita, misal 192.168.137.0/24
Tambahkan acl (access list) terlarang untuk blok website tertentu

Tekan CTRL + W -> search : http_access allow localnet


Tambahkan http_access deny terlarang dari ACL yang sudah kita buat sebelumnya
Aktifkan http_access allow localnet dengan menghilangkan tanda pagar untuk mengijinkan akses
internet melalui squid

14 | L i n u x L A B

LAB SO
1 Agustus 2013
Rev 0.2
Nyoman S. ST. CCNP

Tekan CTRL + W -> search : cache_dir ufs


Aktifkan (hilangkan tanda pagar) -> rubah 100 menjadi 1000 (1000 MB kapasitas cache, 16 subfolder
cache dan 256 subfolder berikutnya)

Selesai -> Tekan CTRL + X -> Y -> Enter

4. Cek status folder cache SQUID -> pindah ke folder cache squid
root@debian:/etc/squid# cd /var/spool/squid
1000MB

-> folder cache size

root@debian:/var/spool/squid# ls
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F swap.state
Subfolder
root@debian:/var/spool/squid# cd 00
subfolder
root@debian:/var/spool/squid/00# ls
00
01
02
03
04
05
06
07
08
09
0A
0B
0C

-> masuk ke salah satu subfolder terdapat 256

0D 1A 27 34 41 4E 5B 68 75 82 8F 9C A9 B6 C3
0E 1B 28 35 42 4F 5C 69 76 83 90 9D AA B7 C4
0F 1C 29 36 43 50 5D 6A 77 84 91 9E AB B8 C5
10 1D 2A 37 44 51 5E 6B 78 85 92 9F AC B9 C6
11 1E 2B 38 45 52 5F 6C 79 86 93 A0 AD BA C7
12 1F 2C 39 46 53 60 6D 7A 87 94 A1 AE BB C8
13 20 2D 3A 47 54 61 6E 7B 88 95 A2 AF BC C9
14 21 2E 3B 48 55 62 6F 7C 89 96 A3 B0 BD CA
15 22 2F 3C 49 56 63 70 7D 8A 97 A4 B1 BE CB
16 23 30 3D 4A 57 64 71 7E 8B 98 A5 B2 BF CC
17 24 31 3E 4B 58 65 72 7F 8C 99 A6 B3 C0 CD
18 25 32 3F 4C 59 66 73 80 8D 9A A7 B4 C1 CE
19 26 33 40 4D 5A 67 74 81 8E 9B A8 B5 C2 CF

D0
D1
D2
D3
D4
D5
D6
D7
D8
D9
DA
DB
DC

DD EA F7
DE EB F8
DF EC F9
E0 ED FA
E1 EE FB
E2 EF FC
E3 F0 FD
E4 F1 FE
E5 F2 FF
E6 F3
E7 F4
E8 F5
E9 F6

5. Kembali ke folder squid -> Buat Filter terlarang.txt di folder /etc/squid


root@debian:/var/spool/squid/00# cd /etc/squid/
root@debian:/etc/squid# nano terlarang.txt

15 | L i n u x L A B

-> 16

LAB SO
1 Agustus 2013
Rev 0.2
Nyoman S. ST. CCNP

Selesai -> CTRL + X -> Y -> Enter

6. Restart squid
root@debian:/etc/squid# /etc/init.d/squid restart
Restarting Squid HTTP proxy: squid

7. Buka IE Client -> Internet Properties

8. Test buka web terlarang

16 | L i n u x L A B

LAB SO
1 Agustus 2013
Rev 0.2
Nyoman S. ST. CCNP

9. Monitoring status SQUID

Proses cache (penyimpanan) terlihat dari status TCP HIT dan tidak semua website mendukung cache,
proses HIT paling banyak di website statis, misal : www.debian.org

root@debian:/var/spool/squid# tail -f /var/log/squid/access.log

Dengan menggunakan proxy maka user kedua dst yang akan mengakses web yang sudah pernah
dibuka oleh user pertama akan jauh lebih cepat karena web request web akan diambil didalam
SQUID proxy server.

LAB 12 : SQUID - AUTENTIKASI NCSA


1. Install Webserver
root@debian:~# apt-get install apache2

2. Membuat username & password NCSA


root@debian:~# htpasswd -c /etc/squid/passwd budi
disimpan di

-> membuat user & password


folder /etc/squid/ nama file

passwd
New password:
17 | L i n u x L A B

LAB SO
1 Agustus 2013
Rev 0.2
Nyoman S. ST. CCNP

Re-type new password:


Adding password for user budi
root@debian:~# htpasswd /etc/squid/passwd doni
root@debian:~# htpasswd /etc/squid/passwd bobo
root@debian:/etc/squid# cat passwd

-> user berikutnya tanpa -c

-> melihat isi file passwd

budi:LuqQhciVOzYEU
doni:vUvCqjSqweTMY
bobo:wieg6wB4thUD6

3. Melihat lokasi ncsa_auth


root@debian:~# dpkg -L squid | grep ncsa_auth
/usr/lib/squid/ncsa_auth

4. Edit file squid.conf


root@debian:~# nano /etc/squid/squid.conf

Tekan CTRL + W -> search : auth_param basic program


Hilangkan tanda pagar 5 baris berikut & tambahkan command : /usr/lib/squid/ncsa_auth
/etc/squid/passwd (copy paste ke putty)

18 | L i n u x L A B

LAB SO
1 Agustus 2013
Rev 0.2
Nyoman S. ST. CCNP

Tekan CTRL + W -> search : acl localnet


Tambahkan baris berikut : acl ncsa_users proxy_auth REQUIRED

Tekan CTRL + W -> search : http_access allow localnet


Tambahkan baris berikut : http_access allow ncsa_users

Selesai -> CTRL + X -> Y -> Enter

5. Restart SQUID
root@debian:/etc/squid# /etc/init.d/squid restart
Restarting Squid HTTP proxy: squid

6. Test Browsing Client

19 | L i n u x L A B

LAB SO
1 Agustus 2013
Rev 0.2
Nyoman S. ST. CCNP

LAB 13 : SQUID - MODIFIKASI AKSES BLOCKING WEBSITE


1. Lokasi ERROR_ACCESS-DENIED
root@debian:~# cd /usr/share/squid/errors/en/
root@debian:/usr/share/squid/errors/en# ls
ERR_ACCESS_DENIED
ERR_FTP_NOT_FOUND
ERR_READ_ERROR
ERR_CACHE_ACCESS_DENIED ERR_FTP_PUT_CREATED ERR_READ_TIMEOUT
ERR_CACHE_MGR_ACCESS_DENIED ERR_FTP_PUT_ERROR
ERR_SECURE_CONNECT_FAIL
ERR_CANNOT_FORWARD
ERR_FTP_PUT_MODIFIED ERR_SHUTTING_DOWN
ERR_CONNECT_FAIL
ERR_FTP_UNAVAILABLE ERR_SOCKET_FAILURE
ERR_DIR_LISTING
ERR_ICAP_FAILURE
ERR_TOO_BIG
ERR_DNS_FAIL
ERR_INVALID_REQ
ERR_UNSUP_HTTPVERSION
ERR_ESI
ERR_INVALID_RESP
ERR_UNSUP_REQ
ERR_FORWARDING_DENIED
ERR_INVALID_URL
ERR_URN_RESOLVE
ERR_FTP_DISABLED
ERR_LIFETIME_EXP
ERR_WRITE_ERROR
ERR_FTP_FAILURE
ERR_NO_RELAY
ERR_ZERO_SIZE_OBJECT
ERR_FTP_FORBIDDEN
ERR_ONLY_IF_CACHED_MISS

2. Rename File Asli sebelum diedit


root@debian:/usr/share/squid/errors/en# mv ERR_ACCESS_DENIED ERR_ACCESS_DENIED.ORI

3. Buat File baru yang akan di edit


20 | L i n u x L A B

LAB SO
1 Agustus 2013
Rev 0.2
Nyoman S. ST. CCNP

root@debian:/usr/share/squid/errors/en# nano ERR_ACCESS_DENIED

Copy Paste via Putty baris berikut

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"


"http://www.w3.org/TR/html4/strict.dtd"> <html><head> <meta http-equiv="Content-Type"
content="text/html; charset=utf-8"> <title>ERROR: MOHON MAAF WEB SITE YANG ANDA TUJU
TIDAK DAPAT DITAMPILKAN</title> <style type="text/css"><!-- %l body :lang(fa) { direction: rtl;
font-size: 100%; font-family: Tahoma, Roya, sans-serif; float: right; } :lang(he) { direction: rtl; float:
right; } --></style> </head><body> <div id="titles"> <h1>ERROR</h1> <h2> MOHON MAAF WEB
SITE YANG ANDA TUJU TIDAK DAPAT DITAMPILKAN </h2> </div> <hr> <div id="content">
<p>WEBSITE YANG ANDA TUJU TIDAK SESUAI DENGAN KEBIJAKAN TI KAMI: <a
href="%U">%U</a></p> <blockquote id="error"> <p><b>AKSES DITOLAK</b></p> </blockquote>
<p>UNTUK INFORMASI LEBIH LANJUT BISA ANDA HUBUNGI ADMIN TI.</p> <p>ADMIN TI ANDA
ADALAH <a href="mailto:%w%W">%w</a>.</p> <br> </div> <hr> <div id="footer">
<p>Generated %T by %h (%s)</p> <!-- %c --> </div> </body></html>
CTRL + X -> Y -> Enter
4. Restart SQUID
root@debian:/etc/squid# /etc/init.d/squid restart
Restarting Squid HTTP proxy: squid

5. Test Client

21 | L i n u x L A B

LAB SO
1 Agustus 2013
Rev 0.2
Nyoman S. ST. CCNP

LAB 14 : DNS SERVER


Domain Name System adalah metode untuk konversi IP Address ke Nama Domain (alphabetic)
ataupun sebaliknya, karena secara umum Manusia lebih mudah mengingat Nama daripada angka
sedangkan Komputer saling berkomunikasi menggunakan alamat IP
Nama Domain di Indonesia diatur oleh PANDI sedangkan di Dunia diatur oleh APNIC, untuk DNS
Server yang bersifat Intranet (local) tidak perlu ijin dikedua lembaga tersebut.
DNS Server bersifat opsional karena biasanya sudah disedikan oleh ISP maupun DNS yang bersifat
Umum seperti milik Google 8.8.8.8 / 8.8.4.4.
Misal : Pada saat kita mengakses www.facebook.com maka DNS Server akan mengkonversi menjadi
alamat IP Address Public 173.252.110.27 yang merupakan sebuah webserver
DNS yang umum digunakan di keluarga Linux adalah Bind9 (Berkeley Internet Name Domain versi 9)
1. File yang akan diconfig

/etc/bind/named.conf
file forward
file reverse
/etc/resolv.conf

2. Instalasi bind9
root@debian:~# apt-get install bind9

3. Editing file named.conf untuk membuat domain master


root@debian:~# nano /etc/bind/named.conf

Copy Paste via Putty config berikut di bagian paling bawah config yang sudah ada

#. . .
zone "debian.edu" {
type master;
file "db.debian";
};
zone "192.in-addr.arpa" {
type master;
file "db.192";
22 | L i n u x L A B

//Zone Domain
//lokasi file FORWARD di /var/cache/bind/

// IP paling depan
// lokasi file REVERSE di /var/cache/bind/

LAB SO
1 Agustus 2013
Rev 0.2
Nyoman S. ST. CCNP

};
include "/etc/bind/named.conf.local";

//membuat file named.conf.local

CTRL + X -> Y -> Enter

4. Membuat file Forward, fungsi utama adalah untuk konversi Nama Domain menjadi IP Address
root@debian:~# cd /etc/bind/
root@debian:/etc/bind# nano /var/cache/bind/db.debian

Copy paste file berikut via putty

$TTL 604800
@ IN SOA debian.edu. root.debian.edu. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS debian.edu. ;tambahkan titik di akhir domain
@ IN A 192.168.137.2
www IN A 192.168.137.2
ftp IN A 192.168.137.2
sub-domain IN A 192.168.137.2 ;jika ingin membuat sub-domain
mail IN A 192.168.137.2
streaming IN A 192.168.137.2 ; misal alamat untuk streaming server
CTRL + X -> Y -> Enter
5. Membuat file Reverse : Untuk melakukan konversi kebalikan dari IP Address ke Nama Domain
(bersifat opsional)
root@debian:/var/cache/bind# nano /var/cache/bind/db.192

$TTL 604800
@ IN SOA debian.edu. root.debian.edu. (
1 ; Serial
604800 ; Refresh

23 | L i n u x L A B

LAB SO
1 Agustus 2013
Rev 0.2
Nyoman S. ST. CCNP

86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS debian.edu.
2.137.168 IN PTR debian.edu.

;ingat titik
;3 blok ip terakhir, dan dibalik

CTRL + X -> Y -> Enter


6. Menambah DNS Server
root@debian:/var/cache/bind# nano /etc/resolv.conf

Tambahkan baris berikut

search debian.edu
nameserver 192.168.10.1
nameserver 8.8.8.8
nameserver 8.8.4.4
CTRL + X -> Y -> Enter
7. Aktifkan DNS Forwarders
root@debian:~# nano /etc/bind/named.conf.options

24 | L i n u x L A B

LAB SO
1 Agustus 2013
Rev 0.2
Nyoman S. ST. CCNP

8. Restart BIND9
root@debian:/var/cache/bind# /etc/init.d/bind9 restart
Stopping domain name service...: bind9 waiting for pid 1618 to die.
Starting domain name service...: bind9.

9. Test
root@debian:/var/cache/bind# nslookup 192.168.137.2
Server:
192.168.137.2
Address:
192.168.137.2#53
2.137.168.192.in-addr.arpa

name = debian.edu.

root@debian:/var/cache/bind# nslookup debian.edu


Server:
192.168.137.2
Address:
192.168.137.2#53
Name: debian.edu
Address: 192.168.137.2

Atau

root@debian:/var/cache/bind# dig debian.edu


; <<>> DiG 9.7.3 <<>> debian.edu
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 63900
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION:
;debian.edu.
IN

;; ANSWER SECTION:
debian.edu.
604800 IN

192.168.137.2

;; AUTHORITY SECTION:
debian.edu.
604800 IN

NS

debian.edu.

;; Query time: 1 msec


;; SERVER: 192.168.137.2#53(192.168.137.2)
;; WHEN: Thu Jul 18 11:19:56 2013

25 | L i n u x L A B

LAB SO
1 Agustus 2013
Rev 0.2
Nyoman S. ST. CCNP

;; MSG SIZE rcvd: 58

LAB 15 : TEST DNS VIA WEBSITE


1. Arahkan DNS VHost adapter Client ke DNS Server

2. Test via Web

3. Test edit file index webserver


root@debian:~# cd /var/www
root@debian:/var/www# ls
index.html
26 | L i n u x L A B

LAB SO
1 Agustus 2013
Rev 0.2
Nyoman S. ST. CCNP

root@debian:/var/www# mv index.html index.html.ori

-> rename untuk backup file asli

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

Copy paste baris berikut

<html>
<head>
<title>Sub Domain Test</title>
</head>
<body bgcolor=black><center><font face=Calibri color=green><h1>
<blink>Halloooo semua</blink>
<br><br><br><br>
<font face=Calibri color=blue><h2>
<marquee>selamat datang di website saya<b>debian.edu</b></marquee>
</body>
</html>
CTRL + X -> Y -> ENTER
4. Test via Browser

27 | L i n u x L A B

You might also like