Membuat Server Debian 6 Squeeze Disusun Oleh Faizal Hamung N (14) Daftar Isi: 1. Instalasi Debian Squeeze 6 2. Konfigurasi Router Debian Squeeze 3. Konfigurasi DNS (Domain Name Service) Debian Squeeze 4. Konfigurasi Proxy Server Debian Lenny
Membuat
Server
Debian 6 Squeeze
Disusun Oleh
Faizal Hamung N (14)
Daftar Isi:
1. Instalasi Debian Squeeze 6
2. Konfigurasi Router Debian Squeeze
3. Konfigurasi DNS (Domain Name Service) Debian Squeeze
4. Konfigurasi Proxy Server Debian Lenny
5. Konfigurasi Web Server Debian Squeeze
6. Konfigurasi FTP (File Transfer Protocol) Debian Squeeze
SOALInstall Debian 6.02
System : 75% harddisk
Swap : 10% Harddisk
Proxy Server
IP : 192.168.10.62/26
Port : 3700
Mode : NSCA User
Ip client bebas blokir 192.168.10.1/26
Blokir site : yahoo.com | google.com | google.co.id
DNS Server
www.unpk.net : 192.168.10.62/26
ns.unpk.net : 172.16.0.1/25
www.smkn2-solo.net : 10.10.10.10/24
ns.smkn2-solo.net : 11.11.13.1/24
Setting FTP Server
Port : default
Mode : User /non anonymous
Buat user :
- ujian > direktori /home/ujian
- subujian > direktori /home/subujian
- smkn2 > direktori /home/smkn2
- siswa > direktori /home/siswa
Web Server
Support : PHP5
www.unpk.net > /home/ujian
ns.unpk.net > /home/subujian
www.smkn2-solo.net > /home/smkn2
ns.smkn2-solo.net > /home/siswa
Buat Web Design dengan Ketentuan
- www.unpk.net > isi : jadwal kegiatan UNPK
- ns.unpk.net > isi : soal UNPK
- www.smkn2-solo.net > isi : Profil SMKN 2
- ns.smkn2-solo.net > isi : Peserta Ujian
PENYELESAIAN
Routing Debian
Edit file interfaces
root@debian:~# pico /etc/network/interfaces
# The loopback network interface
auto lo
iface lo inet loopback
# server
auto eth0
iface eth0 inet static
address 192.168.12.73
netmask 255.255.255.192
gateway 192.168.12.126
dns-nameservers 8.8.8.8
# client
auto eth1
iface eth1 inet static
address 192.168.10.62
netmask 255.255.255.192
auto eth1:1
iface eth1:1 inet static
address 172.16.0.1
netmask 255.255.255.128
auto eth1:2
iface eth1:2 inet static
address 10.10.10.10
netmask 255.255.255.0
auto eth1:3
iface eth1:3 inet static
address 11.11.13.1
netmask 255.255.255.0
Setelah mensetting interfaces kemudian setting sysctl.conf dengan cara menghapus tanda (#) pada net.ipv4.ip_forward=1 seperti gambar dibawah
Buka dahulu Pico /etc/sysctl.conf
Setelah menyetting sysctl kemudian menyetting rc.local seperti gambar dibawah
Buka dahulu pico /etc/rc.local
Setelah itu mengaktifkan eth0 dan eth1 dengan cara
Ifconfig et0 up
Ifconfig eth1 up
Cek apakah sudah aktif semua
Ifconfig | less
Setelah itu restart network dengan cara
/etc/init.d/networking restart
Setelah merestart kemudian cek routing, pertama tama setting dahulu ipv4 dengan cara seperti gambar dibawah
Setelah itu cek routing client dengan membuka cmd
Cek ip 192.168.10.62 melalui client
Cek ip 172.16.0.1 melalui client
Cek ip 10.10.10.10 melali client
Cek ip 11.11.13.1 melalui client
Cek ip 192.168.12.89 (eth0) melalui client
Cek ip client melalui server
Routing berhasil
Setting DNS Debian
Menginstall bind9
root@debian:~# apt-get install bind9
Membuka folder bind untuk mengkonfigurasi dns
root@debian:~# cd /etc/bind/
Mengcopy file zones.rfc1918 ke named.conf.local
root@debian:~# cp zones.rfc1918 named.conf.local
Mengedit file named.conf.local menjadi
zone "unpk.net" { type master; file "/etc/bind/db.unpk"; };
zone "10.168.192.in-addr.arpa" { type master; file "/etc/bind/db.192"; };
zone "0.16.172.in-addr.arpa" { type master; file "/etc/bind/db.172"; };
zone "smkn2-solo.net" { type master; file "/etc/bind/db.smkn2"; };
zone "10.10.10.in-addr.arpa" { type master; file "/etc/bind/db.10"; };
zone "13.11.11.in-addr.arpa" { type master; file "/etc/bind/db.11"; };
Mengcopy db.local ke db.unpk dan db.smkn2 lalu mengcopy db.127 ke db.192 , db.172, db.10, db.11
root@debian:~# cp db.local db.unpk
root@debian:~# cp db.local db.smkn2
root@debian:~# cp db.127 db.192
root@debian:~# cp db.127 db.172
root@debian:~# cp db.127 db.10
root@debian:~# cp db.127 db.11
Mengedit db.unpk menjadi
;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA unpk.net. root.unpk.net. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS unpk.net.
@ IN A 192.168.10.62
www IN A 192.168.10.62
ns IN A 172.16.0.1
Mengedit db.192 menjadi
;
; BIND reverse data file for local loopback interface
;
$TTL 604800
@ IN SOA unpk.net. root.unpk.net. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS unpk.net.
62 IN PTR unpk.net.
62 IN PTR www.unpk.net.
Mengedit db.172 menjadi
;
; BIND reverse data file for local loopback interface
;
$TTL 604800
@ IN SOA ns.unpk.net. root.ns.unpk.net. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns.unpk.net.
1 IN PTR ns.unpk.net.
Mengedit db.smkn2 menjadi
;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA smkn2-solo.net. root.smkn2-solo.net. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS smkn2-solo.net.
@ IN A 10.10.10.10
www IN A 10.10.10.10
ns IN A 11.11.13.1
Mengedit db.10 menjadi
;
; BIND reverse data file for local loopback interface
;
$TTL 604800
@ IN SOA smkn2-solo.net. root.smkn2-solo.net. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS smkn2-solo.net.
10 IN PTR smkn2-solo.net.
10 IN PTR www.smkn2-solo.net.
Mengedit db.11 menjadi
;
; BIND reverse data file for local loopback interface
;
$TTL 604800
@ IN SOA ns.smkn2-solo.net. root.ns.smkn2-solo.net. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns.smkn2-solo.net.
1 IN PTR ns.smkn2-solo.net.
Merestart bind9
root@debian:/etc/bind# service bind9 restart
Stopping domain name service...: bind9 waiting for pid 1087 to die.
Starting domain name service...: bind9.
root@debian:/etc/bind#
Cek konfigurasi DNS di Server
root@debian:/etc/bind# nslookup www.unpk.net
Server: 192.168.10.62
Address: 192.168.10.62#53
Name: www.unpk.net
Address: 192.168.10.62
root@debian:/etc/bind# nslookup ns.unpk.net
Server: 192.168.10.62
Address: 192.168.10.62#53
Name: ns.unpk.net
Address: 172.16.0.1
root@debian:/etc/bind# nslookup www.smkn2-solo.net
Server: 192.168.10.62
Address: 192.168.10.62#53
Name: www.smkn2-solo.net
Address: 10.10.10.10
root@debian:/etc/bind# nslookup ns.smkn2-solo.net
Server: 192.168.10.62
Address: 192.168.10.62#53
Name: ns.smkn2-solo.net
Address: 11.11.13.1
Setting Proxy
/etc/rc.local
apt-get install squid apache2
pico /etc/squid/squid.confauth_param basic program /usr/lib/squid/ncsa_auth /home/passwd
acl localnet src 192.168.10.0/26 #RFC1918 possible internal network
acl blokir url regex –I “/home/blokir.txt”
acl user proxy_auth REQUIRED
acl bebas src 192.168.10.1
http access deny blokir !bebas
http access allow user
http port 3700
service squid restart
touch /home/passwdchmod o+x /home/passwdhtpasswd /home/passwd tkjcName password:Re-Type new password:Adding password for user tkjcservice squid restartSetting browser
Cek access log file squidtail -f /var/log/squid/access.log
Setting browser seperti dibawah:
12) Lalu akan muncul seperti ini di Browser:
Jika berhasil akan muncul seperti ini:
Setting FTP
Mount DVD drive dengan perintah
root@debian:~# apt-cdrom add
Install ftp server dengan perintah
root@debian:~# apt-get install proftpd
Pilih opsi stand alone
Edit file poftpd.conf
root@debian:~# nano /etc/proftpd/proftpd.conf
Hilangkan tanda komentar (#) pada script dibawah iniDefultRoot ~
DirFakeUser on ftp
DirFakeGroup on ftp
MaxClients 10
DisplayLogin welcome.msg
DisplayChdir .massage
Simpan file konfigurasi tsb
Kemudian buatlah user ujian pada direktori /home/ujian
root@debian:~# mkdir /home/ujian
root@debian:~# chmod 777 –R /home/ujian/
root@debian:~# useradd –d /home/ujian ujian
root@debian:~# passwd ujian
Enter new UNIX password:
Retype new UNIX password:
Passwd: password updated successfully
Kemudian buatlah user subujian pada direktori /home/subujian
root@debian:~# mkdir /home/subujian
root@debian:~# chmod 777 –R /home/ujian/
root@debian:~# useradd –d /home/subujian subujian
root@debian:~# passwd subujian
Enter new UNIX password:
Retype new UNIX password:
Passwd: password updated successfully
Kemudian buatlah user smkn2 pada direktori /home/smkn2
root@debian:~# mkdir /home/smkn2
root@debian:~# chmod 777 –R /home/smkn2/
root@debian:~# useradd –d /home/smkn2 smkn2
root@debian:~# passwd smkn2
Enter new UNIX password:
Retype new UNIX password:
Passwd: password updated successfully
Kemudian buatlah user ujian pada direktori /home/siswa
root@debian:~# mkdir /home/siswa
root@debian:~# chmod 777 –R /home/siswa/
root@debian:~# useradd –d /home/siswa siswa
root@debian:~# passwd siswa
Enter new UNIX password:
Retype new UNIX password:
Passwd: password updated successfully
Restart ftp server
root@debian:~# service proftpd restart
Stopping ftp server: proftpd
Starting ftp server: proftpd
Uji ftp server pada web browser klien
Untuk
Bila Berhasil akan muncul
Mengupload File ke FTP Server via Filezilla
Setting WebServer
Mount DVD drive dengan perintah
root@debian:~# apt-cdrom add
Install web server dengan perintah
root@debian:~# apt-get install apache2 php5
Edit file berikut ini di folder /etc/apache2
root@debian:~# nano /etc/apache2/sites-available/default
Ubah pada baris 1-4 menjadi seperti dibawah ini
<VirtualHost*:80>ServerAdmin [email protected] /home/ujian
Kemudian tambahkan script ini pada baris paling bawah :
<VirtualHost*:80>ServerAdmin webmaster@localhostServerName ns.unpk.netDocumentroot /home/subujian
</VirtualHost><VirtualHost*:80>
ServerAdmin webmaster@localhostServerName www.smkn2-solo.netDocumentroot /home/smkn2
</VirtualHost><VirtualHost*:80>
ServerAdmin webmaster@localhostServerName ns.smkn2-solo.netDocumentroot /home/siswa
</VirtualHost>
Restart web server :
root@debian:~# service apache2 restartRestarting web server: apache2 .. Waiting
Buatlah tampilan web untuk setiap domain pada direktori yang ditentukan:
root@debian:~# nano /home/ujian/index.htmlroot@debian:~# nano /home/subujian/index.htmlroot@debian:~# nano /home/smkn2/index.html
root@debian:~# nano /home/siswa/index.html
Tampilan web setelah diupload melalui filezilla: