Anda di halaman 1dari 92

UBUNTU

1.1 Sekilas Tentang Ubuntu


Ubuntu adalah sistem operasi GNU/Linux lengkap yang didistribusikan sebagai sumber terbuka
(Open Source) berbasis Debian. Menggunakan Unity sebagai default desktop environtment (Desktop
Base), namun Ubuntu juga dikembangkan untuk keperluan Server (Command Line Interface Base).
Ubuntu (uu-buun-too) berasal dari bahasa afrika yang berarti rasa kemanusiaan terhadap sesama.
Ubuntu adalah distro yang populer oleh para pengguna GNU/Linux. Ubuntu dikembangkan dan
disponsori oleh perusahaan yang bernama Canonical Ltd, pendiri Canonical Ltd bernama Mark
Shuttleworth, seorang pengusaha di Afrika Selatan. Ubuntu tersedia secara bebas dan didukung oleh
berbagai kalangan di Komunitas Linux maupun tenaga ahli profesional dan telah dipakai secara luas
didunia.

1.2 Filosofi Ubuntu


Tujuan dari distribusi Ubuntu adalah membawa semangat yang terkandung dalam filosofi
Ubuntu ke dalam dunia perangkat lunak. Ubuntu mempunyai filosofi sebagai berikut :
Bahwa perangkat lunak harus tersedia dengan bebas biaya.
Bahwa perangkat lunak tersebut harus tersedia dan dapat digunakan dalam bahasa lokal
masing-masing.
Bahwa perangkat lunak juga dapat memberikan kesempatan bagi orang-orang yang mempunyai
keterbatasan fisik untuk menggunakan perangkat lunak tersebut.
Bahwa pengguna harus mempunyai kebebasan untuk mendapatkan, mengubah, mempelajari
dan mendistribusikan perangkat lunak, sesuai dengan apa yang mereka butuhkan dan harapkan
tanpa harus membayar lisensi.
Ubuntu dapat diunduh dialamat http://www.ubuntu.com/download.

1.3 Penggunaan Ubuntu


Ubuntu selain dapat digunakan untuk kalangan pengguna rumahan (workstation) di mana
aplikasi serta tampilannya yang sudah sangat ramah dengan pengguna, untuk skala pengguna yang
lebih khusus di server, dapat diklasifikasikan secara sederhana pengimplementasiannya, antara lain
sebagai berikut :
Sebagai server web, baik untuk eksternal (terhubung dalam jaringan Internet), maupun internal.
Sebagai server email. Contoh aplikasi : postfix.
Berbagai macam aplikasi server seperti FTP dan IRC (Internet Relay Chat).
Sebagai server DNS, yang digunakan untuk me-resolve nama domain dari LAN internal ataupun
komunikasi jaringan Internet.
Memiliki banyak aplikasi pendukung yang powerfull, dibuat dengan lisensi GNU.
Memiliki fasilitas Graphic User Interface yang disebut X, memiliki kesamaan dengan Microsoft
Windows, tapi lebih fleksibel, contoh : GNOME.

1.4 Dasar Sistem Operasi Ubuntu


Jika sistem Ubuntu di-install, sistem tersebut akan mengandung ratusan aplikasi. Aplikasi-aplikasi
tergolong sebagai sistem Ubuntu dasar.
Aplikasi yang ada di Ubuntu dapat dikategorikan menjadi dua golongan yaitu :
Sistem Ubuntu dasar (basic Linux system).
Produk pihak ketiga (third-party product).
Pada implementasinya, Ubuntu dirancang bersifat modular. Ada sejumlah modul aplikasi yang
menyusun sistem Ubuntu untuk tugas yang kompleks. Modul-modul yang tidak diperlukan dapat
dihapus sehingga memberikan ruang yang lebih besar bagi data.
Sistem Ubuntu dasar terbagi menjadi tiga bagian aplikasi, yaitu :
1. Utilitas (tool atau utility).
2. Shell.
3. Kernel.

1.4.1 Utilitas
Utilitas adalah aplikasi bantu di luar shell untuk melakukan tugas tertentu. Misalnya untuk
mengirim email, menyunting dokumen, atau memanipulasi file.
APLIKASI

FUNGSI

SSH (Secure Shell)

Aplikasi Jaringan (remote access)

Cat, more

Menampilkan isi dokumen

Vi, Nano, Pico

Editor teks file

Lynx

Browser situs berbasis teks

Talk, Write

Aplikasi percakapan antarpengguna

Gcc

Kompiler bahasa C

Passwd

Mengubah kata kunci dari pengguna

1.4.2 Shell dan Kernel


Kernel merupakan aplikasi inti dari sistem operasi GNU/Linux. Tugas yang dipegang oleh
Kernel antara lain adalah :

Mengendalikan akses terhadap komputer.


Mengatur memori komputer.
Memelihara sistem file.
Mengalokasikan sumber daya komputer di antara pemakai.
2

Bagian inilah yang melakukan koordinasi fungsi-fungsi internal dari komputer. Bagi pemakai (user),
kernel merupakan mitra kerja yang tidak tampak. Shell dan kernel merupakan dua komponen pada
sistem GNU/Linux yang bertindak sebagai perantara antara pemakai dan perangkat keras, yang dapat
dilihat pada gambar berikut.

PEMAKAI

SHELL

KERNEL

MESIN

Shell merupakan aplikasi yang memungkinkan pemakai dapat berkomunikasi dengan komputer. Tugas
Shell adalah membaca perintah yang diberikan pemakai dan menerjemahkan perintah (command
interpreter) tersebut ke kernel. Pada prompt shell, pemakai memberi perintah dan kemudian shell
memberikan respon. Setelah itu, shell akan menanti perintah lain dari pemakai.

1.4.3 Produk Pihak Ketiga (third party product)


Selain aplikasi yang tergolong sebagai sistem GNU/Linux dasar, banyak pula aplikasi yang
dibuat oleh pihak ketiga (bukan pembuat sistem GNU/Linux). Untuk kategori ini terdapat dua macam
aplikasi, yaitu aplikasi yang dikembangkan oleh komunitas dengan lisensi GNU, misalnya LibreOffice
dan Mozilla Firefox. Atau terdapat pula aplikasi komersial seperti ORACLE, Main Actor, dan
sebagainya.

1.4.4 File Sistem Ubuntu


File sistem merupakan kumpulan file-file pada suatu media penyimpanan di mana mekanisme file-file
tersebut diorganisasikan. File sistem Ubuntu tersusun dari sejumlah file dan directory yang ditampilkan
pada gambar sebagai berikut :

puncak dari hirarki diatas merupakan directory yang disebut root directory (directory /) yang memiliki
sejumlah cabang yang disebut dengan directory. Directory yang berada dibawah root directory
biasanya bersifat standar yaitu :

/bin
/dev
/tmp
/home

: berisi aplikasi executable Linux.


: berisi seluruh piranti sistem (device).
: berisi tempat untuk file-file yang bersifat sementara.
: directory kerja bagi pengguna (home directory).

Setiap directory yang berada di dalam directory yang lain (parent directory) disebut sebagai
subdirectory (child directory).

Konsol Teks Editor GNU/Linux


2.1 Editor Nano
Dalam setiap Sistem Operasi selalu tersedia text editor yang berguna untuk memodifikasi
konfigurasi ataupun hanya sekedar untuk menyimpan sebuah catatan penting. GNU/Linux memiliki
banyak text editor, namun yang paling mudah digunakan adalah Nano. Setiap fungsi penyuntingan
tertera di bagian bawah layar dengan disertai inisial shortcut untuk penggunaannya.

Penggunaan shortcut pada men yang ada di Nano digunakan kombinasi tombol Ctrl (disingkat dengan
tanda ^ ) diikuti dengan hurufnya. Berikut adalah perintah-perintah yang dapat digunakan pada editor
Nano. Berikut adalah perintah-perintah yang dapat digunakan pada editor Nano.
Untuk pergerakan cursor
^F
^B
^P
^N
^A
^E
^V
^Y

pindah ke karakter selanjutnya


pindah ke karakter sebelumnya
pindah ke baris sebelumnya
pindah ke baris sesudahnya
pindah ke awal baris
pindah ke kahir baris
menggulung layar ke bawah
menggulung layar ke atas

Untuk pengeditan
^K
menghapus baris (cut)
^U
menampilkan penghapusan (uncut)
^J
rata tengah paragraf (justify)
^I
menyisipkan tab (tabulasi)
^T
spelling checker
^C
mencetak posisi kursor
^W
pencarian text
^L
refresh layar
^G
fasilitas help NANO
Untuk pengaksesan file
^X
keluar dan simpan file
^O
simpan file
^R
membaca file dari posisi kursor

Ubuntu Server
3.1 Menginstall Ubuntu Server
1. Masukkan CD Instalasi Ubuntu 14.04 Server dan reboot komputer. Lalu, pilih bahasa yang akan
dipakai (untuk installasi) dan tekan enter.

2. Tekan enter untuk memulai installasi.

3. Pilih bahasa yang akan digunakan sebagai bahasa dalam melakukan instalasi sistem.

4. Pilih zona waktu negara

5. Pilih zona waktu (Locale).

6. Pilih No untuk pemilihan tipe keyboard secara manual.

7. Pilih tipe keyboard (default english US).

8. Pilih layout keyboard (default english US).

10

9. Sistem akan melakukan load component dari CD/DVD Instalasi Ubuntu Server.

10. Pilih Interface Card yang akan digunakan sebagai default konfigurasi (jika terdapat dua buah nic).

11

11. Isi nama Hostname server.

12. Masukkan nama akun (untuk keperluan non-administrative system).

12

13. Masukkan nama pengguna akun.

14. Masukkan Password pengguna.

13

15. Masukkan Password sekali lagi untuk verifikasi.

16. Jika menginginkan folder home ter-enkripsi pilih yes, jika tidak pilih no.

14

17. Pilih zona waktu kota.

18. Pilih konfigurasi partisi secara manual.

15

19. Pilih harddisk (SDA).

20. Pilih yes untuk membuat partisi baru.

16

21. Pilih Free Space.

22. Pilih Create a New Partition.

17

23. Masukkan jumlah partisi (GB), contoh disini 15 GB yang digunakan untuk partisi ROOT (/).

24. Pilih tipe partisi primary (maksimum tipe partisi primary 3, selebihnya logical).

18

25. Pilih lokasi partisi Beginning.

26. pilih Done setting up the partition.

19

27. Akan terlihat satu partisi primary yang dibuat tadi (/), kemudian pilih lagi partisi free space untuk
membuat partisi boot.

28. Pilih Create a new partition.

20

29. Masukkan jumlah partisi (MB), contoh disini 500 MB yang digunakan untuk BOOT (/boot).

30. Pilih tipe partisi primary (maksimum tipe partisi primary 3, selebihnya logical).

21

31. Pilih lokasi partisi Beginning.

32. Ubah Mount point manjadi /boot dan Bootable flag manjadi on kemudian, pilih Done Setting up the
partition.

22

33. Akan terlihat dua partisi primary (/) dan (/boot), kemudian pilih lagi partisi free space untuk
membuat partisi swap (Virtual Memory).

34. Pilih create a new partition.

23

35. Masukkan jumlah partisi (GB), contoh disini 1 GB yang digunakan untuk swap (Virtual Memory).

36. Pilih tipe partisi primary (maksimum tipe partisi primary 3, selebihnya logical).

24

37. Pilih lokasi partisi Beginning.

38. Ubah Use as menjadi swap area dan pilih Done setting up the partition.

25

39. Akan terlihat tiga partisi primary (/), (/boot) dan swap, kemudian pilih Finish partitioning and
write changes to disk. Free space akan digunakan untuk partisi LVM (dibahas selanjutnya).

40. Konfirmasi partisi jika tidak ada perubahan pilih yes.

26

41. Proses instalasi sedang berjalan.

42. Masukkan alamat proxy server jika ada, jika tidak ada kosongkan dan lanjutkan.

Proxy server adalah perantara (sistem komputer atau aplikasi) yang mewakili client dalam melakukan
permintaan (request) kepada server lain.

27

43. pilih automatical update jika ingin server melakukan update system secara otomatis. Update
otomatis ini terkadang menyebabkan masalah. Pilihan terbaik adalah melakukan seleksi terhadap paket
dan update secara manual.

44. Pilih paket software yang dibutuhkan untuk di install secara otomatis.

28

45. Pilih yes untuk meng-install GRUB ke dalam MBR (Master Boot Record).

GRUB (Grand Unified Bootloader) adalah paket boot loader dari GNU Project. GRUB mereferensikan
implementasi dari Free Software Foundation's Multiboot Specification, yang menyediakan pilihan bagi
user satu boot operating system atau multiple operating system yang telah terinstal dikomputer.
46. Instalasi telah selesai keluarkan CD dan reboot.

29

47. Sistem akan menampilkan prompt login. Login menggunakan user yang sudah diset pada saat
instalasi.

3.2 Perintah Dasar Ubuntu Server


1. sudo su
Digunakan untuk login sebagai root/pengguna tertinggi.
Sintaks : sudo su
2. login
Digunakan untuk login sebagai user lain, namun harus menjadi root dulu untuk bisa menjalankan.
peirntah ini.
Sintaks : login namauser
Contoh : login bob
3. cd
Digunakan untuk berpindah direktori.
Sintaks : cd alamat_direktori
Contoh : cd /var/www
4. pwd
Digunakan untuk memperlihatkan di direktori mana posisi kita berada sekarang.
Sintaks : pwd
5. ls
Digunakan untuk melihat isi sebuah direktori.
Sintaks : ls
6. cp
Digunakan untuk melakukan copy file.
Sintaks : cp /direktori/file_yang_ingin_dicopy /direktori tujuan
Contoh : cp /etc/file1.txt /var/www
7. mv
Digunakan untuk melakukan memindahkan, cut atau rename file.
Sintaks :
mv /direktori/file_yang_ingin_dicut /direktori tujuan (cut)
mv /direktori/file_yang_ingin_direname /nama_baru_file (rename)
Contoh:
mv /etc/file1.txt /var/www
mv /etc/file1.txt file2.txt
8. mkdir
Digunakan untuk membuat folder baru.
Sintaks : mkdir nama_folder
30

Contoh : mkdir folder1


9. rmdir
Digunakan untuk menghapus folder.
Sintaks : rmdir nama_folder
Contoh : rmdir folder1
10. touch
Digunakan untuk membuat file baru.
Sintaks : touch nama_file
Contoh : touch file1.txt
11. rm
Digunakan untuk menghapus file.
Sintaks : rm nama_file
Contoh : rm file1.txt
12. more
Digunakan untuk menampilkan isi sebuah file.
Sintaks : more nama_fie
Contoh : more file1.txt
13. echo
Digunakan untuk menuliskan sesuatu kata atau kalimat ke sebuah file.
Sintaks : echo isi pesan nama_file
Contoh : echo Hai ini adalah contoh pesan >> file1.txt
14. adduser
Digunakan untuk menambah user baru.
Sintaks : adduser nama_user
Contoh : adduser sally
15. addgroup
Digunakan untuk menambah group baru.
Sintaks : addgroup nama_group
Contoh : addgroup grup1
16. lsusb
Digunakan untuk melihat perangkat usb yang sedang terkoneksi ke komputer.
Sintaks : lsusb
17. lspci
Digunakan untuk melihat perangkat pci yang sedang terkoneksi ke komputer.
Sintaks : lspci
18. lshw
Digunakan untuk melihat hardware komputer.
Sintaks : lshw
19. dmesg
Digunakan untuk melihat hardware yang sedang beraktifitas.
Sintaks : dmseg
20. top
Digunakan untuk melihat proses yang sedang berjalan, seperti Task Manager pada Windows.
Sintaks : top
21. cpuinfo
Digunakan untuk melihat spesifikasi komputer.
Sintaks : more /proc/cpuinfo
31

22. meminfo
Digunakan untuk melihat status RAM.
Sintaks : more /proc/meminfo
23. clear
Digunakan untuk membersihkan layar
Sintaks : clear
24. halt
Digunakan untuk mematikan komputer, namun harus sebagai root.
Sintaks : halt
25. reboot
Digunakan untuk merestart komputer, namun harus sebagai root.
Sintaks : reboot
26. exit
Digunakan untuk keluar dari terminal.
Sintaks : exit
27. wget
Digunakan untuk mendownload via terminal.
Sintaks : wget link_download
Contoh : wget www.insightcalendar.com/Insight_Calendar_1-1_Setup.exe
28. ifconfig
Digunakan untuk melihat konfigurasi ethernet/kartu jaringan.
Sintaks : ifconfig
29. apt-get
Digunakan untuk memperoleh paket/software dari repository ubuntu secara online.
Sintax : apt-get nama_paket
Contoh :
apt-get update (untuk melakukan update repository)
apt-get update wine (untuk mendapatkan paket wine)
30. tar
Digunakan untuk melakukan extract file.
Sintaks : tar [parameter] nama_file
Contoh : tar -xzvf komodo-edit-5.2.4-4343-linux-libcpp6-x86.tar.gz
31. nautilus
Digunakan untuk membuka tampilan GUI secara langsung.
Sintaks : nautilus
Contoh : sudo nautilus (menggunakan mode GUI dengan status root)
32. df -h
melihat sisa kapasitas harddisk.
Sintaks : df -h
33. who
digunakan untuk melihat nama login kita.
sintaks : who
34. cat
digunakan untuk membuka file.
sintaks : cat
contoh: cat test.txt
35. date
32

melihat tanggal
sintaks : date
36. hostname
Menampilkan nama komputer.
sintaks: hostname
37. free
Melihat Free memory.
sintaks: free
38. History
melihat perintah apa saja yang pernah diketik
sintaks : History
39. deluser
Menghapus user dari sistem.
sintaks : deluser [nama user]

3.3 Initial Settings


3.3.1 add a user
a. Untuk menambahkan user, ikuti langkah berikut :
lucid@server:~$ sudo adduser ubuntu
<====menambahkan user ubuntu
[sudo] password for lucid:
<====masukkan password user
Adding user `ubuntu' ...
Adding new group `ubuntu' (1003) ...
Adding new user `ubuntu' (1002) with group `ubuntu' ...
Creating home directory `/home/ubuntu' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
<====masukkan password user ubuntu
Retype new UNIX password:
<====konfirmasi password
passwd: password updated successfully
Changing the user information for ubuntu
Enter the new value, or press ENTER for the default
Full Name []:
<====kosongkan jika tidak perlu
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n] y
lucid@addserver:~$
b. Untuk menambahkan hak istimewa kepada pengguna baru, caranya seperti berikut :
lucid@server:~$ sudo usermod -G sudo ubuntu
lucid@server:~$ su - ubuntu
Password:
<====masukkan password user ubuntu
ubuntu@server:~$ sudo reboot
<====coba eksekusi perintah
[sudo] password for ubuntu:
Broadcast message from ubuntu@server
(/dev/pts/0) at 19:59 ...
The system is going down for reboot NOW!
33

3.3.2 Enable root password


a. Menambahkan password root.
lucid@server:~$ sudo passwd root
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
lucid@server:~$ su Password:
root@server:~#

<====masukkan password root


<====konfirmasi password
<====masukkan password root
<====user terganti

b. Jika user root diijinkan (enable), batasi jumlah user untuk berganti ke root.
root@server:~# nano /etc/pam.d/su
# line 15: uncomment and add a group that can switch to root
auth
required
pam_wheel.so group=adm
root@server:~# usermod -G adm ubuntu
3.3.3 Network Settings (Wired Connection)
a. Menambahkan IP address statis kedalam server.
root@ubuntu:~# nano /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo iface lo inet loopback
# The primary network interface
auto eth0
# Comment out
# iface eth0 inet dhcp
# add these lines

<====jika ingin menggunakan ip dhcp

iface eth0 inet static


address 10.0.0.30
network 10.0.0.0
netmask 255.255.255.0
broadcast 10.0.0.255
gateway 10.0.0.1
dns-nameservers 10.0.0.10

#
#
#
#
#
#

defenisi
defenisi
defenisi
defenisi
defenisi
defenisi

IP address
network address
subnet mask
broadcast address
default gateway
name server

root@ubuntu:~# ifdown eth0 && ifup eth0

34

b. Jika tidak ingin mengaktifkan (disable) IPv6.


Setelah.
root@server:~# echo "net.ipv6.conf.all.disable_ipv6 = 1" >> /etc/sysctl.conf
root@server:~# sysctl -p
root@server:~# ifconfig
eth0
Link encap:Ethernet HWaddr 20:6a:8a:95:ff:36
inet addr:10.1.101.23 Bcast:10.1.101.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:49 Base address:0x6000
lo

Link encap:Local Loopback


inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:90148 errors:0 dropped:0 overruns:0 frame:0
TX packets:90148 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:19767112 (19.7 MB) TX bytes:19767112 (19.7 MB)

Sebelum.
eth0

Link encap:Ethernet HWaddr f4:b7:e2:00:e9:f6


inet addr:10.1.101.23 Bcast:10.1.101.255 Mask:255.255.255.0
inet6 addr: fe80::f6b7:e2ff:fe00:e9f6/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:44578 errors:0 dropped:0 overruns:0 frame:0
TX packets:28619 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:51755716 (51.7 MB) TX bytes:3359361 (3.3 MB)

lo

Link encap:Local Loopback


inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:94737 errors:0 dropped:0 overruns:0 frame:0
TX packets:94737 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:20599312 (20.5 MB) TX bytes:20599312 (20.5 MB)

35

3.3.4 Network Settings (Wireless Connection).


a. Install wireless tools.
# apt-get install wireless-tools
b. Install wpasupplicant untuk keperluan otentikasi password wpa-psk.
# apt-get install wpasupplicant
c. Cek informasi wireless card.
root@server:/home/ubuntu# lspci | grep Network
03:02.0 Network controller: Broadcom Corporation BCM4301 802.11b Wireless LAN
Controller (rev 02)
root@server:/home/ubuntu# ifconfig wlan0
wlan0 Link encap:Ethernet HWaddr 00:06:25:1d:c7:05
inet6 addr: fe80::206:25ff:fe1d:c705/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1224 errors:0 dropped:0 overruns:0 frame:0
TX packets:36 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:155950 (155.9 KB) TX bytes:5836 (5.8 KB)
d. Scan network ssid yang tersedia.
root@server:/home/ubuntu# iwlist scan
eth0
Interface doesn't support scanning.
lo

Interface doesn't support scanning.

wlan0

Scan completed :
Cell 01 - Address: D4:CA:6D:12:47:E6
Channel:6
Frequency:2.437 GHz (Channel 6)
Quality=41/70 Signal level=-69 dBm
Encryption key:on
ESSID:"INSTRUCTOR"
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
9 Mb/s; 12 Mb/s; 18 Mb/s
Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s
Mode:Master
Extra:tsf=00000017075c4c4c
Extra: Last beacon: 2840ms ago
IE: Unknown: 000A494E5354525543544F52
IE: Unknown: 010882848B960C121824
IE: Unknown: 030106
IE: Unknown: 2A0100
IE: Unknown: 32043048606C
IE: Unknown: DD2A000C42000011E032343745362D4C54330000005028509

36

IE: WPA Version 1


Group Cipher : TKIP
Pairwise Ciphers (1) : TKIP
Authentication Suites (1) : PSK
Cell 02 - Address: D4:CA:6D:12:47:E5
Channel:11
Frequency:2.462 GHz (Channel 11)
Quality=47/70 Signal level=-63 dBm
Encryption key:on
ESSID:"PUBLIC"
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
9 Mb/s; 12 Mb/s; 18 Mb/s
Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s
Mode:Master
Extra:tsf=00000017387cbcbe
Extra: Last beacon: 20ms ago
IE: Unknown: 00065055424C4943
IE: Unknown: 010882848B960C121824
IE: Unknown: 03010B
IE: Unknown: 2A0100
IE: Unknown: 32043048606C
IE: Unknown: DD2A000C42000003132343742D4C5433000000000005029E09
IE: WPA Version 1
Group Cipher : TKIP
Pairwise Ciphers (1) : TKIP
Authentication Suites (1) : PSK
dari contoh diatas tersedia dua infomasi essid yang dapat digunakan, dan yang akan digunakan essid
PUBLIC dengan password Learning.
e. edit file konfigurasi interfaces.
root@server:/home/ubuntu# nano /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet dhcp
#tambahkan baris
auto wlan0
iface wlan0 inet dhcp
wpa-ssid PUBLIC
wpa-psk Learning
wpa-driver wext

<===essid yang digunakan


<===password essid

37

f. restart service network.


root@server:/home/ubuntu# /etc/init.d/networking restart
* Running /etc/init.d/networking restart is deprecated because it may not enable again some
interfaces

* Reconfiguring network interfaces...

[ OK ]

atau
root@server:/home/ubuntu# service network-interface restart INTERFACE=wlan0
network-interface stop/waiting
network-interface (wlan0) start/running
g. Cek informasi wireless.
root@server:/home/ubuntu# ifconfig wlan0
wlan0
Link encap:Ethernet HWaddr 00:06:25:1d:c7:05
inet addr:10.1.103.37 Bcast:10.1.103.255 Mask:255.255.255.0
inet6 addr: fe80::206:25ff:fe1d:c705/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3795 errors:0 dropped:0 overruns:0 frame:0
TX packets:43 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:421052 (421.0 KB) TX bytes:6753 (6.7 KB)
root@server:/home/ubuntu# iwconfig
eth0
no wireless extensions.
lo
wlan0

no wireless extensions.
IEEE 802.11b ESSID:"PUBLIC"
Mode:Managed Frequency:2.462 GHz Access Point: D4:CA:6D:12:47:E5
Bit Rate=5.5 Mb/s
Tx-Power=20 dBm
Retry long limit:7
RTS thr:off
Fragment thr:off
Encryption key:off
Power Management:off
Link Quality=47/70 Signal level=-63 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:15 Invalid misc:58
Missed beacon:0

dari informasi diatas, komputer server sudah terhubung dengan jaringan PUBLIC (essid PUBLIC).

38

3.3.5 Update system


a. Repository Ubuntu (main, restricted, universe, multiverse)
Repository adalah sekumpulan paket-paket aplikasi (jumlahnya bisa ratusan bahkan ribuan paket) yang
dikumpulkan di suatu tempat dalam hal ini bisa media DVD, Harddisk, LAN atau di Internet.
Repository digunakan untuk memudahkan untuk mencari dan meng-install perangkat lunak. Di dalam
repository Ubuntu terdapat empat komponen yaitu :

Main Perangkat lunak yang didukung penuh oleh Ubuntu.


Restricted Perangkat lunak yang didukung oleh Ubuntu tapi tidak free licence.
Universe Perangkat lunak yang dikembangkan oleh komunitas.
Multiverse Perangkat lunak yang bersifat closed source.

b. Ubah source list repository ke server lokal terdekat (kambing.ui.ac.id).


root@server:~# cp /etc/apt/sources.list /etc/apt/sources.list.old
root@server:~# nano /etc/apt/sources.list
#hapus semua isinya dan ganti dengan
deb
deb
deb
deb
deb

http://kambing.ui.ac.id/ubuntu/
http://kambing.ui.ac.id/ubuntu/
http://kambing.ui.ac.id/ubuntu/
http://kambing.ui.ac.id/ubuntu/
http://kambing.ui.ac.id/ubuntu/

trusty main restricted universe multiverse


trusty-updates main restricted universe multiverse
trusty-security main restricted universe multiverse
trusty-backports main restricted universe multiverse
trusty-proposed main restricted universe multiverse

c. Update system & upgrade system


root@server:~# aptitude update
Ign
Ign
Ign
Hit
Hit
Hit
Hit
Hit
Hit
Hit
Hit
Hit
Hit
Hit
Hit
Ign
Hit
Hit
Hit
Hit
Hit
Hit
Hit

http://kambing.ui.ac.id/ubuntu
http://kambing.ui.ac.id/ubuntu
http://kambing.ui.ac.id/ubuntu
http://kambing.ui.ac.id/ubuntu
http://kambing.ui.ac.id/ubuntu
http://kambing.ui.ac.id/ubuntu
http://kambing.ui.ac.id/ubuntu
http://kambing.ui.ac.id/ubuntu
http://kambing.ui.ac.id/ubuntu
http://kambing.ui.ac.id/ubuntu
http://kambing.ui.ac.id/ubuntu
http://kambing.ui.ac.id/ubuntu
http://kambing.ui.ac.id/ubuntu
http://kambing.ui.ac.id/ubuntu
http://kambing.ui.ac.id/ubuntu
http://kambing.ui.ac.id/ubuntu
http://kambing.ui.ac.id/ubuntu
http://kambing.ui.ac.id/ubuntu
http://kambing.ui.ac.id/ubuntu
http://kambing.ui.ac.id/ubuntu
http://kambing.ui.ac.id/ubuntu
http://kambing.ui.ac.id/ubuntu
http://kambing.ui.ac.id/ubuntu

trusty InRelease
trusty-updates InRelease
trusty-backports InRelease
trusty Release.gpg
trusty-updates Release.gpg
trusty-backports Release.gpg
trusty Release
trusty-updates Release
trusty-backports Release
trusty/main Sources
trusty/restricted Sources
trusty/universe Sources
trusty/multiverse Sources
trusty/main amd64 Packages
trusty/restricted amd64 Packages
trusty-security InRelease
trusty/universe amd64 Packages
trusty/multiverse amd64 Packages
trusty/main i386 Packages
trusty/restricted i386 Packages
trusty-security Release.gpg
trusty/universe i386 Packages
trusty/multiverse i386 Packages
39

Hit http://kambing.ui.ac.id/ubuntu
Hit http://kambing.ui.ac.id/ubuntu
Hit http://kambing.ui.ac.id/ubuntu
Hit http://kambing.ui.ac.id/ubuntu
Hit http://kambing.ui.ac.id/ubuntu
Hit http://kambing.ui.ac.id/ubuntu
Hit http://kambing.ui.ac.id/ubuntu
Hit http://kambing.ui.ac.id/ubuntu
.....
.....
root@server:~# aptitude -y upgrade

trusty/main Translation-en
trusty/multiverse Translation-en
trusty-security Release
trusty/restricted Translation-en
trusty/universe Translation-en
trusty-updates/main Sources
trusty-updates/restricted Sources
trusty-updates/universe Sources

====perintah upgrade====

40

KONFIGURASI SERVER
4.1 NTP Server
NTP (Network Time Protocol) adalah protokol untuk melakukan sinkronisasi waktu terhadap
petunjuk waktu yang ada didalam jaringan komputer lokal maupun Internet. Cara kerja NTP ini adalah
dengan cara membandingkan waktu yang ada pada server itu sendiri dengan NTP server lain yang
dianggap paling akurat. Hal ini digunakan untuk menjamin waktu yang digunakan pada server akurat.
4.1.1 Konfigurasi NTP untuk menyesuaikan waktu. NTP menggunakan port 123/UDP.
a. Konfigurasi NTP server.
root@server:~# apt-get install ntp
root@server:~# nano /etc/ntp.conf
# Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board
# on 2011-02-08 (LP: #104525). See http://www.pool.ntp.org/join.html for more
information.
#server 0.ubuntu.pool.ntp.org
#server 1.ubuntu.pool.ntp.org
#server 2.ubuntu.pool.ntp.org
#server 3.ubuntu.pool.ntp.org
# rubah server sinkronisasi
server 0.id.pool.ntp.org
server 1.id.pool.ntp.org
server 2.id.pool.ntp.org
server 3.id.pool.ntp.org
# line 48: tambahkan jaringan (network) yang dapat memberikan permintaan
restrict 10.0.0.0 mask 255.255.255.0 nomodify notrap
root@server:~# /etc/init.d/ntp restart
* Stopping NTP server ntpd
* Starting NTP server ntpd

[ OK ]
[ OK ]

root@server:~# ntpq -p
remote
refid
st
t
when poll
reach delay offset jitter
============================================================================== ====
ip-164-224-stat
195.43.74.123
2
u
23
64
1
32.178 6.508 0.000
tiesto.cyberplu
.INIT.
16
u
64
0
0.000 0.000 0.000
valhalla.intila
235.219.102.111
2
u
21
64
1
30.312 7.382 0.000
ntp.uii.net.id
103.1.106.69
2
u
21
64
1
24.134 33.690 0.000
golem.canonical
192.93.2.20
2
u
19
64
1
206.782 35.096 0.000

Alamat server NTP dapat dilihat di http://www.pool.ntp.org/zone/id.


41

b. Konfigurasi NTP client, contoh : ubuntu & Windows 7.


Ubuntu
root@kandanglucid:~# ntpdate 2.id.pool.ntp.org
12 May 20:33:22 ntpdate[1904]: adjust time server 210.173.160.27 offset 0.013672 sec

Windows 7
a. Klik waktu dibagian bawah kanan desktop dan buka "Change the date and time settings".

42

b. pilih "Internet Time" dan klik tombol "Change settings".

c. Masukkan Hostname NTP server atau IP address dan klik tombol "Update now".

43

d. Jika semua sudah OK, akan muncul pesan sinkronisasi waktu telah selesai.

4.2 SSH Server


SSH (Secure Shell) adalah sebuah protokol jaringan yang digunakan untuk komunikasi atau pertukaran
data secara aman antara dua perangkat jaringan (client-server). SSH banyak digunakan pada sistem
berbasis Linux dan Unix untuk mengakses akun shell. SSH dirancang untuk menggantikan peran Telnet
dan Remote Shell yang tidak aman (username dan password tidak terenkripsi (plain text)). SSH
menggunakan port 22/TCP.
4.2.1 Konfigurasi SSH server agar memungkinkan server dapat diakses melalui remote
1. Konfigurasi menggunakan Password Authentication (no permit root login).
root@server:~# apt-get install openssh-server
root@server:~# nano /etc/ssh/sshd_config
# line 28: hilangkan tanda pagar dan ganti menjadi 'no'
PermitRootLogin no
root@server:~# initctl restart ssh
ssh start/running, process 9313

44

2. Konfigurasi SSH client. Contoh menggunakan Windows 7.


a. Jalankan aplikasi putty, masukkan IP address server dan pilih koneksi SSH.

b. Jika koneksi normal, maka akan muncul login prompt, masukkan username dan password.
Login as : ubuntu
ubuntu@10.1.102.23's password :

<====masukkan password

Welcome to Ubuntu 14.04 LTS (GNU/Linux 3.13.0-24-generic x86_64)


* Documentation:

https://help.ubuntu.com/

System information as of Thu Jun 12 11:52:46 WIB 2014


System load:
Usage of /:
Memory usage:
Swap usage:

0.03
11.7% of 8.78GB
3%
0%

Processes:
86
Users logged in:
1
IP address for eth0: 10.1.102.23

Graph this data and manage this system at:


https://landscape.canonical.com/
Last login: Thu Jun 12 11:51:36 2014 from 10.1.102.15
ubuntu@server:~$

45

3. File Transfer With SFTP


SFTP (Secure File Transfer Protol) adalah protokol jaringan yang menyediakan akses file, transfer file,
dan manajemen file secara aman (data terenkripsi), SFTP ini berfungsi secara relieable (terpercaya).
SFTP ini merupakan ekstensi tambahan dari Secure Shell Access version 2.
a. Install dan jalankan WinSCP, dan masukkan alamat server (hostname) beserta username dan
password, lalu klik tombol login..

46

b. jika semua sudah benar maka, akan dilakukan proses autentikasi username dan password.

c. Jika telah sukses, transfer file antar client server bisa dilaksanakan.

47

4.3 DNS (Domain Name System) Server


DNS (Domain Name System) adalah distribusi nama sistem komputer, layanan, atau sumber daya
lainnya yang terkoneksi dengan Internet maupun Private Network. Tujuan dari DNS adalah
menyimpan informasi tentang nama komputer (hostname) atau nama domain dalam bentuk basis data
tersebar (distributed database). DNS berguna untuk mentranslasikan IP address kedalam suatu nama
yang unik (tidak mungkin sama). contoh alamat Internet Protocol Google adalah 74.125.200.139,
sedangkan nama domainnya adalah www.google.com, ketika kita ingin menuju kesuatu website
(anggaplah www.google.com) maka yang kita ketikkan di url webbrowser adalah www.google.com,
bukan nomor IP address 74.125.200.139, tapi yang sebenarnya terjadi adalah server (mesin) hanya
mengenali nomor IP address tersebut bukan nama domainnya. Nah, disinilah peran dari DNS itu (DNS
berkerja berdasarkan sudut pandang manusia, dan bukan berdasarkan sudut pandang mesin).
Sederhananya, DNS mempermudah manusia untuk mengingat alamat dari suatu sumber daya di
Internet (lebih mudah mengingat nama, daripada nomor), bayangkan jika kita harus memasukkan
nomor IP address untuk setiap tujuan sumber daya di Internet
4.3.1 Konfigurasi DNS server yang merupakan translasi nama domain atau IP address. BIND bekerja
pada port 53/UDP, TCP
a. Install BIND 9
root@server:~# aptitude -y install bind9 bind9utils
b. Konfigurasi BIND9
Contoh ini diatur dengan alamat IP [10.1.102.0/24], nama Domain [server.lan]. Namun, Silahkan
gunakan IP kita sendiri dan nama domain ketika kita mengatur konfigurasi pada server (alamat IP
address DNS server [10.1.102.23] & alamat IP address server.lan adalah [10.1.102.15]).
root@server:~# nano /etc/bind/named.conf.local
#tambahkan baris
zone "server.lan" {
type master;
file "/etc/bind/db.server.lan";
};
zone "102.1.10.in-addr.arpa" {
type master;
notify no;
file "/etc/bind/db.15";
};
#penulisan IP pada baris zone "102.1.10.in-addr.arpa" { ditulis terbalik
root@server:~# cp /etc/bind/db.255 /etc/bind/db.15
root@server:~# cp /etc/bind/db.local /etc/bind/db.server.lan

48

root@server:~# nano /etc/bind/db.15


#edit script menjadi
;
; BIND reverse data file for broadcast zone
;
$TTL
604800
@
IN
SOA
dnsserver.lan. root.dnsserver.lan. (
1
; Serial
604800
; Refresh
86400
; Retry
2419200
; Expire
604800 )
; Negative Cache TTL
;
@
IN
NS
dnsserver.lan.
15
IN
PTR
dnsserver.lan.
ns
IN
PTR
10.1.102.15
www
IN
PTR
10.1.102.15
root@server:~# nano /etc/bind/db.server.lan
#edit script menjadi
;
; BIND data file for local loopback interface
;
$TTL
604800
@
IN
SOA
server.lan. root.server.lan. (
2
; Serial
604800
; Refresh
86400
; Retry
2419200
; Expire
604800 )
; Negative Cache TTL
;
@
IN
NS
server.lan.
@
IN
A
10.1.102.15
ns
IN
A
10.1.102.15
www
IN
CNAME
server.lan.
root@server:~# service bind9 restart
* aktifkan opsi forward dan proteksi spoof pada file /etc/sysctl.conf, sehingga sistem dapat berfungsi
sebagai mesin gateway ketikan difungsikan sebagai server proxy ataupun firewall.
# Uncomment the next two lines to enable Spoof protection (reverse-path filter)
#Turn on Source #Address Verification in all interfaces to prevent some spoofing
#attacks
net.ipv4.conf.default.rp_filter=1
net.ipv4.conf.all.rp_filter=1
# Uncomment the next line to enable packet forwarding for IPv4
net.ipv4.ip_forward=1

49

c. Konfigurasi nameserver pada interface.

d. Pengujian DNS
lucid@kandanglucid:~$ nslookup server.lan
Server:
10.1.102.23
Address:
10.1.102.23#53
Name: server.lan
Address: 10.1.102.15
lucid@kandanglucid:~$ dig server.lan
; <<>> DiG 9.8.1-P1 <<>> server.lan
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 46203
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION:
;server.lan.
;; ANSWER SECTION:

IN

A
50

server.lan.

604800

IN

10.1.102.15

;; AUTHORITY SECTION:
server.lan.
604800

IN

NS

server.lan.

;;
;;
;;
;;

Query time: 1 msec


SERVER: 10.1.102.23#53(10.1.102.23)
WHEN: Fri Jun 13 12:28:47 2014
MSG SIZE rcvd: 58

atau ketik ping www.server.lan di cmd.

4.4 DHCP (Dynamic Host Configuration Protocol) Server


DHCP (Dynamic Host Configuration Protocol) Server adalah standarisasi protokol jaringan yang
digunakan oleh Internet Protocol (IP) untuk mendistribusikan parameter (default gateway dan alamat
DNS server) konfigurasi jaringan secara dinamis (seperti permintaan IP address pada interfaces).
Dengan menggunakan DHCP, komputer (host) akan melakukan request IP address dan parameter
jaringan secara otomatis dari DHCP server, namun hal ini tetap akan melibatkan seorang network
administrator untuk melakukan konfigurasi secara manual pada DHCP server, DHCP server
menggunakan port 67/UDP.

51

4.4.1 Install dan konfigurasi DHCP Server.


root@server:~# aptitude -y install isc-dhcp-server
root@server:~# nano /etc/dhcp/dhcpd.conf
# line 16: specify
option domain-name"server.lan";
# line 17: specify nameserver's hostname or IP address
option domain-name-servers ns.server.lan;
# line 24: uncomment
authoritative;
# add at the last
# specify network address and subnet-mask
subnet 10.1.102.0 netmask 255.255.255.0 {
# specify default gateway
option routers 10.1.102.15;
# specify subnet-mask
option subnet-mask 255.255.255.0;
# specify the range of leased IP address
range dynamic-bootp 10.1.102.150 10.1.102.254;
}
root@server:~# initctl start isc-dhcp-server
isc-dhcp-server start/running, process 1852
4.4.2 Konfigurasi DHCP client Ubuntu
root@server:~# nano /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
# uncomment
iface eth0 inet dhcp
# comment out
#
#iface eth0 inet static
root@server:~# ifdown eth0 && ifup eth0

52

4.5 NETWORK STORAGE (NFS (Network File System))


Network File System (NFS), adalah protokol yang digunakan untuk mendistribusikan file system lewat
jaringan yang dikembangkan pertamakali oleh sun microsystem pada tahun 1984, NFS melakukan
pendekatan client-server dan mengijinkan user klien untuk mengakses file (sharing file) pada media
penyimpanan lokal (local storage) yang telah didistribusikan ke komputer klien melalui jaringan
komputer. NFS server berfungsi menampung file-file yang akan disharing dalam suatu jaringan.
4.5.1 Konfigurasi NFS (Network File System) server
root@server:~# apt-get install nfs-server
root@server:~# nano /etc/exports
# write like below *note
/home 10.1.103.0/24(rw,sync,fsid=0,no_root_squash,no_subtree_check)
# *note /home

shared directory

#10.1.103.0/24
#rw
#sync
#no_root_squash
#no_subtree_check

range of networks NFS permits accesses


possible to read and write
synchronize
enable root privilege
disable subtree check

root@server:~# /etc/init.d/nfs-kernel-server restart


*
*
*
*

Stopping NFS kernel daemon


Unexporting directories for NFS kernel daemon...
Exporting directories for NFS kernel daemon...
Starting NFS kernel daemon

[
[
[
[

OK
OK
OK
OK

]
]
]
]

4.5.2 Konfigurasi NFS (Network File System) client


root@kandanglucid:/home/lucid# apt-get install nfs-common
root@kandanglucid:/home/lucid# mount server.lan:/home /mnt/
root@kandanglucid:/mnt# df -h
Filesystem
Size
Used
Avail
Use%
/dev/sda1
29G
22G
6.0G
79%
udev
3.7G
4.0K
3.7G
1%
tmpfs
744M
1.3M
742M
1%
none
5.0M
0
5.0M
0%
none
3.7G
560K
3.7G
1%
/dev/sda2
06G
64G
37G
64%
server.lan:/home
8.8G
1.4G
7.0G
17%

Mounted on
/
/dev
/run
/run/lock
/run/shm
/home/lucid
/mnt

#untuk melakukan unmount gunakan perintah : # umount -f /nama_titik_kait

53

4.6 WEB SERVER


Web Server atau peladen WEB adalah suatu layanan baik perangkat keras maupun perangkat lunak
(aplikasi komputer) yang menyediakan layanan akses data (berkas-berkas yang terdapat pada situs
web)) kepada pengguna melalui protokol komunikasi HTTP (Hyper Text Transfer Protocol) maupun
HTTPS (Hyper Text Transfer Protocol Secure). Fungsi utama WEB Server adalah untuk menyimpan,
memproses dan mengirimkan halaman web kepada klien.
4.6.1 Konfigurasi WEB Server
a. Install Apache2
root@server:~# apt-get install apache2
b. Konfigurasi Apache2
root@server:~# nano /etc/apache2/conf-enabled/security.conf
# line 26: change
ServerTokens Prod
# line 37: change
ServerSignature Off
# line 2: add file name that it can access only with directory's name
DirectoryIndex index.html index.htm
root@server :~# nano /etc/apache2/apache2.conf
# line 70: add to specify server name
ServerName www.server.lan
root@server:~# nano /etc/apache2/sites-enabled/000-default.conf
# line 11: change to webmaster's email
ServerAdmin webmaster@server.lan
root@server:~# /etc/init.d/apache2 restart
* Restarting web server apache2
...done.

54

c. jika telah selesai akses Web Server (menggunakan hostname atau IP Address) melalui webbrowser.

4.6.2 Konfigurasi Apache untuk mengijinkan (eksekusi) Perl Script.


a. Install Perl
root@server:~# apt-get install perl
b. Konfigurasi Apache2. Contoh ini mengijinkan eksekusi file CGI disemua directory.
root@server:~# nano /etc/apache2/mods-enabled/dir.conf
# line 2: add file name that it can access only with directory's name
DirectoryIndex index.html index.cgi
root@server:~# nano /etc/apache2/mods-enabled/mime.conf
# line 219: uncomment and add extensions for CGI
AddHandler cgi-script .cgi .pl

55

root@serevr:~# nano /etc/apache2/sites-enabled/000-default.conf


ServerAdmin webmaster@server.lan
DocumentRoot /var/www/html
# line 13: add
<Directory "/var/www/html">
AllowOverride All
Options +ExecCGI
Require all granted
</Directory>
root@server:~# a2enmod cgi
Enabling module cgi.
To activate the new configuration, you need to run: service apache2 restart
root@server:~# /etc/init.d/apache2 restart
* Restarting web server apache2
...done.
c. Buat halaman pengujian untuk eksekusi CGI dan akses halaman via webbrowser.
root@server:~# nano /var/www/html/index.cgi
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "<html>\n<body>\n";
print "<div style=\"width: 100%; font-size: 40px; font-weight: bold; text-align: center;\">\n";
print "CGI Test Page";
print "\n</div>\n";
print "</body>\n</html>\n";
root@server:~# chmod 705 /var/www/html/index.cgi

56

4.6.3 Konfigurasi Apache2 untuk mengijinkan (eksekusi) PHP Script.


a. Install dan konfigurasi PHP.
root@server:~# apt-get install php5
root@server:~# nano /etc/apache2/mods-enabled/mime.conf
# near line 220: add extension for PHP
AddHandler php5-script .php
root@server:~# nano /etc/php5/apache2/php.ini
# line 879: uncomment and add your timezone
date.timezone = "Asia/Jakarta"
root@server:~# /etc/init.d/apache2 restart
* Restarting web server apache2
...done.
b. Jika sudah selesai buat halaman pengujian PHP dan akses menggunakan webbrowser.
root@server:~# nano /var/www/html/index.php
<html>
<body>
<div style="width: 100%; font-size: 40px; font-weight: bold; text-align:center;">
<?php
print Date("Y/m/d");
?>
</div>
</body>
</html>

57

4.6.4 Userdir Modul.


Modul userdir Apache2 digunakan untuk membuat webroot didalam direktori home user. Dengan
menggunakan modul userdir setiap user yang ada di sistem akan memiliki direktori webroot Apache2
dengan nama folder public_html di direktori home, Jika menggunakan browser web untuk mengakses
folder webroot di direktori user, harus menggunakan "~" setelah itu nama user. Jadi, alamat url
menjadi http:// [hostname] /~ username /. Secara default modul userdir sudah tersedia ketika kita
menginstall Apache2, jadi kita hanya perlu mengaktifkannya saja.
a. aktifkan dan konfigurasi userdir.
root@server:~# a2enmod userdir
Enabling module userdir.
To activate the new configuration, you need to run:
service apache2 restart
root@server:~# nano /etc/apache2/mods-enabled/userdir.conf
# line 6,7: change
AllowOverride All
Options ExecCGI
root@server:~# nano /etc/apache2/mods-enabled/php5.conf
# line 25: comment out
#php_admin_flag engine Off
root@server:~# /etc/init.d/apache2 restart
* Restarting web server apache2
...done.
b. Buat folder public_html dan file index.cgi didalamnya, kemudian akses melalui webbrowser.
lucid@server:~$ mkdir public_html
lucid@server:~$ cd public_html/
lucid@server:~/public_html$ nano index.cgi
#!/usr/bin/perl
print"Contenttype:text/html\n\n";
print"<html>\n<body>\n";
print"<divstyle=\"width:100%;fontsize:40px;fontweight:bold;
textalign:center;\">\n";
print"UserdirTestPage";
print"\n</div>\n";
print"</body>\n</html>\n";
lucid@server:~/public_html$ chmod 705 index.cgi
58

c. Buat halaman pengujian PHP didalam folder yang sama.


lucid@server:~/public_html$ nano index.php
<html>
<body>
<div style="width: 100%; font-size: 40px; font-weight: bold; text-align:center;">
User's Home<br />
<?php
print Date("Y/m/d");
?>
</div>
</body>
</html>

59

4.6.5 Virtual Hostings


Virtual Hostings adalah metode hosting yang memungkinkan banyak nama domain (penanganan
terpisah untuk setiap nama domain) dalam satu server. Virtual Hostings mengijijnkan server untuk
saling berbagi sumber daya (resource) bersama, seperti memory dan processor cycles tanpa perlu
menyediakan semua layanan yang diberikan untuk mengakses nama domain yang sama. Virtual
hostings juga dikenal dengan istilah One IP Address, Multiple Domain Name.
contoh : nama domain server.lan, nama domain virtual inixindo.lan.
a. Konfigurasi Virtual Hostings.
root@server:~# nano /etc/apache2/sites-available/virtual.host.conf
# create a file for virtual.host
<VirtualHost *:80>
ServerName www.inixindo.lan
ServerAdmin webmaster@inixindo.lan
DocumentRoot /var/www/www.inixindo.lan/public_html
ErrorLog /var/log/apache2/virtual.host.error.log
CustomLog /var/log/apache2/virtual.host.access.log combined
LogLevel warn
</VirtualHost>
root@server:~# a2ensite virtual.host
Enabling site virtual.host.
To activate the new configuration, you need to run:
service apache2 reload
root@server:~# /etc/init.d/apache2 restart
* Restarting web server apache2
...done.
b. Buat halaman pengujian index.php dan akses via webbrowser.
root@server:/var/www/www.inixindo.lan$ cd public_html
root@server:~/public_html$ nano index.php
<html>
<body>
<div style="width: 100%; font-size: 40px; font-weight: bold; text-align:center;">
Virtual Host Test Page<br />
</div>
</body>
</html>

60

4.6.6 Konfigurasi SSL (Secure Socket Layer)


SSL adalah sebuah protokol yang digunakan untuk mengirim dan menerima informasi secara aman
melalui jaringan komputer. SSL akan meng-enkripsi data sehingga, pihak ketiga tidak bisa melakukan
sniffing (data yang lewat akan susah terbaca). SSL ditandai dengan huruf s setelah HTTP (HTTPS).
SSL bekerja pada port 443/TCP.
a. Pertama-tama buat sertifikat.
root@server:~# cd /etc/ssl/private/
root@server:/etc/ssl/private# openssl genrsa -des3 -out server.key 2048
Generating RSA private key, 2048 bit long modulus
..........+++
........+++
e is 65537 (0x10001)
Enter pass phrase for server.key:
#set passphrase
Verifying - Enter pass phrase for server.key:
#confirm
root@server:/etc/ssl/private# openssl rsa -in server.key -out server.key
Enter pass phrase for server.key:
writing RSA key
root@server:/etc/ssl/private# openssl req -new -days 3650 -key server.key -out
server.csr
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
----Country Name (2 letter code) [AU]:IN
State or Province Name (full name) [Some-State]:Jakarta
Locality Name (eg, city) []:Jakarta
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Inixindo
Organizational Unit Name (eg, section) []:Instructor
Common Name (e.g. server FQDN or YOUR name) []:server.lan
Email Address []:echo.repos@gmail.com
Please enter the following 'extra' attributes
to be sent with your certificate request
61

A challenge password []:


An optional company name []:
root@server:/etc/ssl/private# openssl x509 -in server.csr -out server.crt -req
-signkey server.key -days 3650
Signature ok
subject=/C=IN/ST=Jakarta/L=Jakarta/O=Inixindo/OU=Instructor/CN=server.lan/emailAddr
ess=echo.repos@gmail.com
Getting Private key
root@server:/etc/ssl/private# ls
server.crt server.csr server.key ssl-cert-snakeoil.key
root@server:/etc/ssl/private# chmod 400 server.*
b. Konfigurasi SSL.
root@server:~# nano /etc/apache2/sites-available/default-ssl.conf
# line 3: change to webmaster's email
ServerAdmin webmaster@server.lan
# line 11: change
Options FollowSymLinks ExecCGI
# line 32,33: change to the one created in [1]
SSLCertificateFile /etc/ssl/private/server.crt
SSLCertificateKeyFile /etc/ssl/private/server.key
root@server:~# a2ensite default-ssl
Enabling site default-ssl.
To activate the new configuration, you need to run:
service apache2 reload
root@server:~# a2enmod ssl
Considering dependency setenvif for ssl:
Module setenvif already enabled
Considering dependency mime for ssl:
Module mime already enabled
Considering dependency socache_shmcb for ssl:
Enabling module socache_shmcb.
Enabling module ssl.
See /usr/share/doc/apache2/README.Debian.gz on how to configure SSL and create
self-signed certificates.
To activate the new configuration, you need to run:
service apache2 restart

62

c. Restart apache2
root@server:/etc/ssl/private# /etc/init.d/apache2 restart
* Restarting web server apache2
d. Akses halaman pengujian menggunakan webbrowser melalui HTTPS. Klik I Understand the Risks.

e. Klik Add Exception.

63

f. Kemudian klik Confirm Security Exception.

g. Setelah itu akan tampil halaman HTTPS.

64

4.6.7 Setting multiple SSL certificates virtual hostings


a. Tambahkan script berikut di /etc/apache2/sites-available/virtual.host.conf
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin webmaster@inixindo.lan
ServerName inixindo.lan
DocumentRoot /home/lucid/public_html
#
SSL Engine Switch:
#
Enable/Disable SSL for this virtual host.
SSLEngine on
#
A self-signed (snakeoil) certificate can be created by installing
#
the ssl-cert package. See
#
/usr/share/doc/apache2.2-common/README.Debian.gz for more info.
#
If both key and certificate are stored in the same file, only the
#
SSLCertificateFile directive is needed.
#
A self-signed (snakeoil) certificate can be created by installing
#
the ssl-cert package. See
#
/usr/share/doc/apache2.2-common/README.Debian.gz for more info.
#
If both key and certificate are stored in the same file, only the
#
SSLCertificateFile directive is needed.
# SSLCertificateFile /etc/apache2/ssl/example.com/apache.crt
#SSLCertificateKeyFile /etc/apache2/ssl/example.com/apache.key
SSLCertificateFile /etc/ssl/private/server.crt
SSLCertificateKeyFile /etc/ssl/private/server.key
</VirtualHost>
</IfModule>
b. Restart apache2
root@server:/home/ubuntu# /etc/init.d/apache2 restart
* Restarting web server apache2

[ OK ]

65

4.7 Database Server (MySQL)


Database Server adalah sebuah layanan (service) yang menyediakan penyimpanan basis data
secara terpusat yang cara kerjanya mendekati model client-server.
a. Install dan konfigurasi MySQL.
root@server:~# apt-get install mysql-server
# set MySQL's root password.

root@server:~# mysql -u root -p


<====koneksi ke MySQL
Enter password:
<====masukkan password MySQL
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 42
Server version: 5.5.37-0ubuntu0.14.04.1 (Ubuntu)
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
66

affiliates. Other names may be trademarks of their respective


owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
#untuk melihat informasi pengguna
mysql> select user,host,password from mysql.user;
+------------------+-----------+---------------------------------------------------------------------------------+
| user
| host
| password
|
+------------------------ +----------------+---------------------------------------------------------------------+
| root
| localhost
| *A4B6157319038724E3560894F7F932C8886EBFCF |
| root
| server
| *A4B6157319038724E3560894F7F932C8886EBFCF |
| root
| 127.0.0.1
| *A4B6157319038724E3560894F7F932C8886EBFCF |
| root
| ::1
| *A4B6157319038724E3560894F7F932C8886EBFCF |
| debian-sys-maint
| localhost
| *27D394E762A2BFD425B7F5CED3D19DBE95059A |
+------------------+-----------+---------------------------------------------------------------------------------+
5 rows in set (0.00 sec)
mysql> exit
Bye
b. Install phpmyadmin untuk mengoperasikan MySQL dari webbrowser.
root@server:~# apt-get install phpmyadmin
# pilih apache2.

67

# tekan enter

# pilih no, jika Database Server telah terinstall.

68

c. Akses ke "http://(hostname atau IP address)/phpmyadmin/" dan login dengan nama pengguna


MySQL.

4. Setelah login, MySQL dapat dioperasikan disini.

69

4.8 FTP (File Transfer Protocol)


FTP (File Transfer Protocol) adalah standar protokol dalam jaringan komputer yang digunakan
untuk bertukar (transfer) berkas (file) dari suatu komputer ke komputer lain menggunakan layer ke
empat (transport layer) lapisan OSI (Open Standart Internetworking), yaitu TCP. FTP dibangun
berdasarkan arsitektur client-server (port 21/TCP).
a. Install ProFTPD
root@server:~# apt-get install proftpd
# pilih standalone

b. Konfigurasi Proftpd
root@server:~# nano /etc/proftpd/proftpd.conf
# line 11: turn off if not needed
UseIPv6 off
# line 15: change to your hostname
70

ServerName "server.lan"
# line 34: uncomment ( specify root directory for chroot )
DefaultRoot ~
root@server:~# nano /etc/ftpusers
# add users you prohibit FTP connection
test
root@server:~# /etc/init.d/proftpd restart
* Stopping ftp server proftpd
...done.
* Starting ftp server proftpd
...done.
c. dari sisi client install Filezilla sebagai FTP client. Masukkan FTP hostname, username, dan
password.

71

d. Jika semuanya sudah benar, maka transfer file sudah bisa dilakukan.

4.8.1 SFTP (Secure File Transfer Protocol)


a. Konfigurasi SFTP (Filezilla), klik file => Site Manager.

72

b. klik new site, isi nama sites misalnya inixindo.lan, kemudian isi alamat host (IP address atau
hostname), lalu pilih protocol SFTP-SSH File Transfer Protocol, Logon Type Interactive, dan isi
nama user. Setelah itu klik tombol connect.

c. akan muncul kotak dialog, klik OK.

73

d. Isi password. Kemudian klik OK.

e. jika koneksi telah sukses, maka transfer file dapat dilakukan.

74

4.9 Mounting Eksternal Drive (USB Flash Disk)


Mounting dilakukan agar perangkat penyimpanan eksternal dapat dikaitkan dengan sistem operasi
(terbaca disistem operasi).
a. Setelah menancapkan/mencolokkan USB Flash Disk, jalankan perintah :
root@server:~# lsusb
maka akan muncul informasi perangkat apa saja yang terkait dengan USB dimesin server.
Bus
Bus
Bus
Bus
Bus
Bus
Bus
Bus
Bus

001
002
003
004
005
006
001
004
003

Device
Device
Device
Device
Device
Device
Device
Device
Device

001:
001:
001:
001:
001:
001:
002:
002:
002:

ID
ID
ID
ID
ID
ID
ID
ID
ID

1d6b:0002
1d6b:0002
1d6b:0001
1d6b:0001
1d6b:0002
1d6b:0003
04f2:b335
1d57:ffa8
0951:1643

Linux Foundation 2.0 root hub


Linux Foundation 2.0 root hub
Linux Foundation 1.1 root hub
Linux Foundation 1.1 root hub
Linux Foundation 2.0 root hub
Linux Foundation 3.0 root hub
Chicony Electronics Co., Ltd
Kingston Technology DataTraveler G3 4GB

informasi diatas menampilkan informasi bahwa perangkat penyimpanan eksternal sukses dikenali (Bus
003 Device 002: ID 0951:1643 Kingston Technology DataTraveler G3 4GB ).
b. ketikkan fdisk -l untuk mengetahui informasi dimana letak USB flash disk itu dikenali.
root@server:~# fdisk -l
WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't
support GPT. Use GNU Parted.
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x1fa76074
Device Boot
Start
End
Blocks
/dev/sda1
*
690282496
751722495
30720000
/dev/sda2
751722496
976773119
112525312
/dev/sda3
104497152
411695103
153598976
/dev/sda4
411697150
690282495
139292673
Partition 4 does not start on physical sector boundary.
/dev/sda5
411697152
413794303
1048576
/dev/sda6
413796352
464996351
25600000
/dev/sda7
464998400
567398399
51200000
/dev/sda8
567400448
628839901
30719727
/dev/sda9
628842496
690282495
30720000

Id
83
83
83
5

System
Linux
Linux
Linux
Extended

82
83
83
83
83

Linux swap/Solaris
Linux
Linux
Linux
Linux

75

Partition table entries are not in disk order


Disk /dev/sdb: 3874 MB, 3874488320 bytes
255 heads, 63 sectors/track, 471 cylinders, total 7567360 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
{letak usb di /dev/sdb1}
Disk identifier: 0x00000000
Device Boot
/dev/sdb1
*

Start
128

End
7567359

Blocks
3783616

Id
b

System
W95 FAT32

c. buat folder baru dengan nama usb di /mnt/.


root@server:~# mkdir /mnt/usb/
d. Mounting USB Flash Disk.
root@server:~# mount /dev/sdb1 /mnt/usb/
e. cek isi flash disk.
root@server:~# ls

/mnt/usb/

f. setelah selesai bekerja menggunakan penyimpanan eksternal, jangan lupa untuk melakukan unmount
untuk melepaskan titik kait perangkat dengan sistem operasi (safely remove).
root@server:~# umount /mnt/usb/
*berlaku untuk media penyimpanan Harddisk Eksternal.

76

4.10 LVM (Linux Volume Manager)


LVM (Linux Volume Manager) adalah pilihan manajemen disk yang hampir ada disetiap distro Linux.
LVM dapat mengatur partisi dari satu buah atau beberapa harddisk menjadi partisi baru yang mudah
direzise (dinamis). LVM digunakan untuk membuat partisi yang lebih fleksibel, dengan LVM beberapa
harddisk dapat digabungkan dengan harddisk lain menjadi sebuah partisi baru. Partisi baru ini akan
dipecah lagi menjadi partisi-partisi baru yang mudah untuk diresize. Didalam LVM terdapat beberapa
level volume, yaitu Physical Volume, Volume Group, dan Logical Volume.
Physical disks
Disk1 (/dev/sda):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|Partition1 50GB (Physical volume)
|/dev/sda1
|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|Partition2 80GB (Physical volume)
|
|/dev/sda2
|
|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |

Disk2 (/dev/sdb):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|Partition1 120GB (Physical volume)
|
|/dev/sdb1
|
| _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ _ _|

LVM logical volumes


Volume Group1 (/dev/MyStorage/ = /dev/sda1 + /dev/sda2 + /dev/sdb1):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|Logical volume1 15GB |Logical volume2 35GB
|Logical volume3 200GB
|
|/dev/MyStorage/rootvol|/dev/MyStorage/homevol
|/dev/MyStorage/mediavol
|
|_ _ _ _ _ _ _ _ _ _ _ |_ _ _ _ _ _ _ _ _ _ _ _ _ |_ _ _ _ _ _ _ _ _ _ _ _ _ _

1. Install LVM2
root@server:/# apt-get install lvm2
2. Buat partisi LVM menggunakan utilitas cfdisk, diasumsikan terdapat ruang bebas (free space) dalam
harddisk yang bertipe logical partition.
root@server:/# cfdisk
maka akan muncul menu utilitas cfdisk, pilih free space lalu tekan new. Gunakan tombol tab dan panah
pada keyboard untuk memilih.

77

3. Setelah menekan new, pilih logical (tiga partisi primary suda terpakai).

78

4. Masukkan ukuran partisi yang akan dibuat, contoh 100000 MB (100 GB), lalu tekan enter.

5. Pilih Beginning untuk menentukan letak partisi.

79

6. akan terbentuk satu partisi logical (sda5). Pilih menu Type untuk menentukan tipe partisi (LVM).

7. isi Enter filesystem type dengan 8e (Linux LVM).

80

8. Filesystem type logical (sda5), berubah menjadi Linux LVM.

9. Pilih lagi partisi free space, kemudian tekan new.

81

10. Masukkan ukuran partisi yang akan dibuat, contoh 880000 MB (88 GB), lalu tekan enter.

11. akan terbentuk dua partisi logical (sda5) dan (sda6). Pilih menu Type untuk menentukan tipe
filesystem (LVM) partisi logical (sda6).

82

12. isi Enter filesystem type dengan 8e (Linux LVM).

13. Filesystem type logical (sda6), berubah menjadi Linux LVM. Tekan Write untuk menulis tabel
partisi kedalam harddisk.

83

14. ketik yes dan tekan enter, jika sudah tidak ada perubahan.

15. jika telah selesai quit, lalu reboot mesin server.


root@server:/# reboot
root@server:/#
Broadcast message from ubuntu@server
(/dev/pts/0) at 14:51 ...
The system is going down for reboot NOW!
16. lihat daftar devices yang dapat digunakan sebagai physical volume :
root@server:/home/ubuntu# lvmdiskscan
/dev/ram0
[64.00 MiB]
/dev/ram1
[64.00 MiB]
/dev/sda1
[46.57 GiB]
/dev/ram2
[64.00 MiB]
/dev/sda2
[9.31 GiB]
/dev/ram3
[64.00 MiB]
/dev/sda3
[1.91 GiB]
/dev/ram4
[64.00 MiB]
/dev/ram5
[64.00 MiB]
/dev/sda5
[93.13 GiB] LVM physical volume
/dev/ram6
[64.00 MiB]
/dev/sda6
[81.96 GiB] LVM physical volume
/dev/ram7
[64.00 MiB]
/dev/ram8
[64.00 MiB]
/dev/ram9
[64.00 MiB]
84

/dev/ram10
[64.00 MiB]
/dev/ram11
[64.00 MiB]
/dev/ram12
[64.00 MiB]
/dev/ram13
[64.00 MiB]
/dev/ram14
[64.00 MiB]
/dev/ram15
[64.00 MiB]
0 disks
19 partitions
0 LVM physical volume whole disks
2 LVM physical volumes
dari daftar devices diatas terdapat dua physical volume yang dapat digunakan.
17. Buat physical volume, contoh pada /dev/sda5.
root@server:/home/ubuntu# pvcreate /dev/sda5
Physical volume "/dev/sda5" successfully created
18. lihat physical volume yang terbentuk.
root@server:/home/ubuntu# pvdisplay
"/dev/sda5" is a new physical volume of "93.13 GiB"
--- NEW Physical volume --PV Name
/dev/sda5
VG Name
PV Size
93.13 GiB
Allocatable
NO
PE Size
0
Total PE
0
Free PE
0
Allocated PE
0
PV UUID
xi3F2J-Cafq-BwzN-gxfa-r7LY-l6mx-gSAlg3
19. Buat volume group disalah satu physical volume.
root@server:/home/ubuntu# vgcreate vol1 /dev/sda5
Volume group "vol1" successfully created
*# vgcreate <volume_group> <physical_volume>
20. Tambahkan physical volume (bisa satu atau lebih tergantung kebutuhan) kedalam volume group
yang baru terbentuk.
root@server:/home/ubuntu# vgextend vol1 /dev/sda6
No physical volume label read from /dev/sda6
Physical volume "/dev/sda6" successfully created
Volume group "vol1" successfully extended
*# vgextend <volume_group> <physical_volume>
*# vgextend <volume_group> <another_physical_volume>

85

21. Lihat volume group yang terbentuk.


root@server:/home/ubuntu# vgdisplay
--- Volume group --VG Name
vol1
System ID
Format
lvm2
Metadata Areas
2
Metadata Sequence
No 2
VG Access
read/write
VG Status
resizable
MAX LV
0
Cur LV
0
Open LV
0
Max PV
0
Cur PV
2
Act PV
2
VG Size
175.09 GiB
PE Size
4.00 MiB
Total PE
44824
Alloc PE / Size
0 / 0
Free PE / Size
44824 / 175.09 GiB
VG UUID
9s62NF-gFV5-neZ1-tdeV-bvwl-JOCn-rguhzd
lihat VG Size menjadi 175.09 GB, ini terjadi karena /dev/sda5 (100 GB) dengan /dev/sda6 (88 GB)
digabung menjadi sebuah volume group.
22. Buat logical volume didalam volume group untuk keperluan tambahan partisi. Contoh kita akan
buat dua buah paritisi baru masing-masing partisi berukuran 50 GB.
root@server:/home/ubuntu# lvcreate -L 50GB vol1 -n data1
Logical volume "data1" created
root@server:/home/ubuntu# lvcreate -L 50GB vol1 -n data2
Logical volume "data2" created
23. lihat logical volume yang terbentuk
root@server:/home/ubuntu# lvdisplay
--- Logical volume --LV Path
/dev/vol1/data1
LV Name
data1
VG Name
vol1
LV UUID
FlF7aH-8XTm-mEjw-0OYv-uQWc-Z3J8-rV2hqH
LV Write Access
read/write
LV Creation host,
time server, 2014-07-04 15:29:59 +0700
LV Status
available
# open
0
LV Size
50.00 GiB
Current LE
12800
Segments
1
Allocation
Inherit
Read ahead sectors
auto
- currently set to
256
Block device
252:0
86

--- Logical volume --LV Path


/dev/vol1/data2
LV Name
data2
VG Name
vol1
LV UUID
T2FEOB-XLdf-DC3t-0tlL-QbPT-kRjA-fmCIF8
LV Write Access
read/write
LV Creation host, time server, 2014-07-04 15:30:43 +0700
LV Status
available
# open
0
LV Size
50.00 GiB
Current LE
12800
Segments
1
Allocation
inherit
Read ahead sectors
auto
- currently set to
256
Block device
252:1
root@server:/home/ubuntu# lvs
LV
VG
Attr
LSize Pool Origin Data%
data1 vol1 -wi-ao--- 50.00g
data2 vol1 -wi-ao--- 50.00g

Move Log Copy%

Convert

Dari informasi diatas terdapat dua logical volume /dev/vol1/data1 dan /dev/vol1/data2.
24. buat filesystem logical volume.
root@server:/home/ubuntu# mkfs.ext4 /dev/vol1/data1
mke2fs 1.42.9 (4-Feb-2014)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
3276800 inodes, 13107200 blocks
655360 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
400 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

87

root@server:/home/ubuntu# mkfs.ext4 /dev/vol1/data2


mke2fs 1.42.9 (4-Feb-2014)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
3276800 inodes, 13107200 blocks
655360 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
400 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
25. buat direktori (data1 dan data2) di /mnt untuk mounting logical volume.
root@server:/home/ubuntu# mkdir /mnt/data1 /mnt/data2
root@server:/home/ubuntu# ls /mnt/
data1 data2
26. Mounting logical volume.
root@server:/home/ubuntu# mount /dev/vol1/data1 /mnt/data1
root@server:/home/ubuntu# mount /dev/vol1/data2 /mnt/data2
root@server:/home/ubuntu# df -h
Filesystem
Size
Used Avail
Use%
/dev/sda1
46G
1.8G
42G
4%
none
4.0K
0
4.0K
0%
udev
1.8G
4.0K 1.8G
1%
tmpfs
370M
616K
369M
1%
none
5.0M
0
5.0M
0%
none
1.9G
0
1.9G
0%
none
100M
0
100M
0%
/dev/sda2
9.1G
84M
8.5G
1%
/dev/mapper/vol1-data1 50G
52M
47G
1%
/dev/mapper/vol1-data2 50G
52M
47G
1%

Mounted on
/
/sys/fs/cgroup
/dev
/run
/run/lock
/run/shm
/run/user
/boot
/mnt/data1
/mnt/data2

Informasi diatas menampilkan logical volume telah sukses dimounting, partisi yang baru siap
digunakan.

88

4.9.1 Reduce Logical Volume.


Karena sesuatu hal, Logical Volume yang telah dibuat terasa sangat besar kapasitasnya, untuk
memperkecil kapasitas bisa menggunakan perintah lvreduce (jika logical volume sudah terdapat
data-data, maka harus dilakukan pemindahan data terlebih dahulu (backup). Contoh kita akan
mereduksi kapasitas dari /dev/vol1/data1 menjadi 30 GB.
a. Lepaskan titik kait (unmount) /dev/vol1/data1
root@server:/home/ubuntu# umount /mnt/data1
b. Reduksi /dev/vol1/data1
root@server:/home/ubuntu# lvreduce -L 30Gb /dev/vol1/data1
WARNING: Reducing active logical volume to 30.00 GiB
THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce data1? [y/n]: y
Reducing logical volume data1 to 30.00 GiB
Logical volume data1 successfully resized
c. Lihat Logical Volume /dev/vol1/data1 yang sudah direduksi.
root@server:/home/ubuntu# lvdisplay
--- Logical volume --LV Path
/dev/vol1/data1
LV Name
data1
VG Name
vol1
LV UUID
kyyLjT-lQ1Y-7nc5-lS9A-XQIu-v5xV-HIoXnG
LV Write Access
read/write
LV Creation host,
time server, 2014-07-08 11:48:42 +0700
LV Status
available
# open
0
LV Size
30.00 GiB
Current LE
7680
Segments
1
Allocation
inherit
Read ahead sectors
auto
- currently set to
256
Block device
252:0
--- Logical volume --LV Path
LV Name
VG Name
LV UUID
LV Write Access
LV Creation host,
LV Status
# open
LV Size
Current LE
Segments
Allocation

/dev/vol1/data2
data2
vol1
JVZr9W-1N9u-MRiL-Qkmd-Vzr9-pocl-L2NzVr
read/write
time server, 2014-07-08 11:48:46 +0700
available
0
50.00 GiB
12800
1
inherit
89

Read ahead sectors


auto
- currently set to
Block device

256
252:1

d. Karena reduksi kapasitas ini menghapus type filesystem dari /dev/vol1/data1, maka harus membuat
ulang type filesystem-nya.
root@server:/home/ubuntu# mkfs.ext4 /dev/vol1/data1
mke2fs 1.42.9 (4-Feb-2014)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
1966080 inodes, 7864320 blocks
393216 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
240 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
e. Mounting Logical Volume /dev/vol1/data1
root@server:/home/ubuntu# mount /dev/vol1/data1 /mnt/data1
root@server:/home/ubuntu# df -h
Filesystem
Size
Used
Avail Use%
Mounted on
/dev/sda1
92G
1.6G
86G
2%
/
none
4.0K
0
4.0K
0%
/sys/fs/cgroup
udev
3.8G
4.0K
3.8G
1%
/dev
tmpfs
779M
628K
779M
1%
/run
none
5.0M
0
5.0M
0%
/run/lock
none
3.9G
0
3.9G
0%
/run/shm
none
100M
0
100M
0%
/run/user
/dev/sda2
454M
65M
362M
16%
/boot
/dev/mapper/vol1-data1 30G
44M
28G
1%
/mnt/data1
/dev/mapper/vol1-data2 50G
52M
47G
1%
/mnt/data2
Informasi diatas menampilkan logical volume telah sukses dimounting, partisi yang baru siap
digunakan.

90

4.11 Install GNOME Dekstop Environtment


a. Install GNOME Desktop Environtment.
root@server:~#

apt-get install gnome

#pilih Gdm atau Lightdm


root@server:~# reboot
b. Pilih login user.

91

c. Klik ikon tombol yang terletak di dekat "Sign In" seperti berikut, untuk memilih Lingkungan
Desktop. Contoh, memilih "GNOME Flashback (Metacity)".

d. Lingkungan Desktop siap digunakan.

92

Anda mungkin juga menyukai