You are on page 1of 11

SERVER GATEWAY

edit file untuk interface (masukkan ip dengan perintah berikut)


~#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 static address 118.98.215.234 netmask 255.255.255.248 network 118.98.215.232 broadcast 118.98.215.239 gateway 118.98.215.233 auto eth1 iface eth1 inet static address 192.168.1.100 netmask 255.255.255.0 network 192.168.1.0 broadcast 192.168.1.255

Restart service untuk interfaces Jaringan


~#/etc/init.d/networking restart

kemudian edit file sysctl.conf


~#nano /etc/sysctl.conf cari baris berikut : # Uncomment the next line to enable packet forwarding for IPv4 # net.ipv4.ip_forward=1

edit Menjadi : # Uncomment the next line to enable packet forwarding for IPv4 net.ipv4.ip_forward=1

kemudian edit file rc.local


~#nano /etc/rc.local #!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # # In order to enable or disable this script just change the execution # bits. # # By default this script does nothing. exit 0

tambahkan baris Menjadi : #!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # # In order to enable or disable this script just change the execution # bits. # # By default this script does nothing. iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -d 0/0 -j MASQUERADE exit 0

Tambahkan pada file resolv.conf DNS untuk service Internet :


~# nano /etc/resolv.conf nameserver 118.98.166.11 nameserver 202.134.1.10

Restart computer dengan perintah :


~# reboot

Atau
~#init 6

Kemudian ketik perintah untuk menampilkan firewall


~# iptables L t nat

Jika firewall yang anda masukkan benar maka akan tampil spt gbr dibawah ini :
root@ubuntu:~# iptables -L -t nat Chain PREROUTING (policy ACCEPT) target prot opt source destination

Chain POSTROUTING (policy ACCEPT) target prot opt source destination anywhere

MASQUERADE all -- 192.168.1.0/24 Chain OUTPUT (policy ACCEPT) target prot opt source

destination

DNS SERVER
Install paket bind9 untuk kebutuhan DNS Server dengan perintah
~# apt-get install bind9

Kemudian edit fle name.conf


~#nano /etc/bind/named.conf // This is the primary configuration file for the BIND DNS server named. // // Please read /usr/share/doc/bind9/README.Debian.gz for information on the // structure of BIND configuration files in Debian, *BEFORE* you customize // this configuration file. // // If you are just adding zones, please do that in /etc/bind/named.conf.local include "/etc/bind/named.conf.options"; // prime the server with knowledge of the root servers zone "." { type hint; file "/etc/bind/db.root"; }; // be authoritative for the localhost forward and reverse zones, and for // broadcast zones as per RFC 1912 zone "localhost" { type master; file "/etc/bind/db.local"; }; zone "127.in-addr.arpa" { type master; file "/etc/bind/db.127"; }; zone "0.in-addr.arpa" { type master; file "/etc/bind/db.0"; }; zone "255.in-addr.arpa" { type master; file "/etc/bind/db.255"; };

Kemudian tambahkan script pada baris akhir sebagai berikut :


zone "teknik08.org" { type master; file "/etc/bind/db.forward"; }; zone "1.168.192.in-addr.arpa" { type master; file "/etc/bind/db.reverse"; };

Copy file untuk kebutuhan forward


~#cd /etc/bind/ ~#cp db.local db.forward

Copy file untuk reversnya


~#cp db.local db.forward

Kemudian edit script untuk forward


~#nano /etc/bind/db.forward

; ; BIND data file for local loopback interface ; $TTL 604800 @ IN SOA localhost. root.localhost. ( 2 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800 ) ; Negative Cache TTL ; @ IN NS localhost. @ IN A 127.0.0.1 @ IN AAAA ::1

Menjadi ;

; ; BIND data file for local loopback interface ; $TTL 604800 @ IN SOA ns.teknik08.org. root.teknik08.org. ( 2 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800 ) ; Negative Cache TTL ; IN NS ns.teknik08.org. ns IN A 192.168.1.100 www in cname mail in cname ftp in cname proxy in cname

Kemudian edit script untuk reverse


~#nano /etc/bind/db.reverse ; ; BIND reverse data file for broadcast zone ; $TTL 604800 @ IN SOA localhost. root.localhost. ( 1 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800 ) ; Negative Cache TTL ; @ IN NS localhost.

Menjadi;
; ; BIND reverse data file for broadcast zone ; $TTL 604800 @ IN SOA ns.teknik08.org. root.teknik08.org. ( 1 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800 ) ; Negative Cache TTL ; IN NS ns.teknik08.org. 100 in ptr ns.teknik08.org.

Tambahkan pada file resolv.conf DNS yang sebelumnya :


~# nano /etc/resolv.conf nameserver 118.98.166.11 nameserver 202.134.1.10

menjadi;
domain ns.teknik08.org nameserver 118.98.166.11 nameserver 202.134.1.10

kemudian restart service untuk bind9;


~# /etc/init.d/bind9 restart

kemudian test DNS yang telah dibuat dengan perintah nslookup;


~# nslookup

Kemudian ketik baris berikut;


>set type=any >ns.teknik08.org

FTP SERVER
Install paket vsftpd untuk kebutuhan FTP Server dengan perintah
~# apt-get install vsftpd

Kemudian edit fle vsftpd.conf


~#nano /etc/vsftpd.conf # Allow anonymous FTP? (Beware - allowed by default if you comment this out). anonymous_enable=YES # Uncomment this to allow local users to log in. local_enable=YES (hilangkan tanda pagar pada baris ini)

# Uncomment this to enable any form of FTP write command. write_enable=YES (hilangkan tanda pagar pada baris ini) # Default umask for local users is 077. You may wish to change this to 022, # if your users expect that (022 is used by most other ftpd's) #local_umask=022

Kemudian Pada baris akhir tambahkan script untuk mengarahkan direktori ftp
anon_root =/home/teknik08

Ubah atribut pada direktori ftp


~#cd /home/teknik08 ~#chmod R 755 *

Restart service untuk ftp


~#/etc/init.d/vsftpd restart

Test service untuk ftp dengan perintah


~#ftp ftp.teknik08.org ~#ftp 192.168.1.100 atau

Web SERVER
Install paket apache2 dan php5 untuk kebutuhan web Server dengan perintah
~# apt-get install apache2 php5

Kemudian edit fle default di apache


~#nano /etc/apache2/sites-avalaible/default <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www <Directory /> Options FollowSymLinks AllowOverride None </Directory>

menjadi;
<VirtualHost *:80> ServerAdmin webmaster@localhost www.teknik08.org DocumentRoot /var/www <Directory /> Options FollowSymLinks AllowOverride None </Directory>

Kemudian script yg ditulis tebal menyatakan bahwa direktori web berada pada direktori /var/www/ sehingga nantinya halaman web yg akan dihosting/disimpan diserver berada pada direktori /var/www

Ubah atribut pada direktori /var/www


~#cd /var/www ~#chmod R 755 *

Restart service untuk apache


~#/etc/init.d/apache2 restart

Untuk menginstall squid di server kita, gunakan perintah:


~# apt-get install squid Untuk mengkonfigurasi squid sebagai proxy caching server, ikuti langkah-langkah berikut:

1. Edit file /etc/squid/squid.conf


~#nano /etc/squid/squid.conf 2. Bagian-bagian yang harus di edit adalah: http_port # http_port 3128 menjadi : http_port 3128  cache_effective_user # cache_effective_user proxy menjadi : cache_effective_user proxy  cache_effective_group # cache_effective_group proxy menjadi : cache_effective_group proxy  Memori yang dialokasikan untuk menjalankan squid server. # cache_mem 8 MB menjadi cache_mem 16 MB  cache_mgr #cache_mgr webmaster Menjadi : cache_mgr webmaster@teknik08.org  cache dir, arahkan sesuai direktori tempat cache di simpan dan atur space alokasinya sesuai besar cache yang diperlukan. Mis: direktori cache /var/spool/squid, dan alokasi nya 5000 Mb. # cache_dir ufs /var/spool/squid 100 16 256 menjadi cache_dir ufs /cache 2000 16 256  Sekarang tambahkan network yang diperbolehkan untuk access proxy server, cari bagian : #Recommended minimum configuration: acl all src 0.0.0.0/0.0.0.0 acl manager proto cache_object acl localhost src 127.0.0.1/255.255.255.255 acl to_localhost dst 127.0.0.0/8 acl SSL_ports port 443 563 acl Safe_ports port 80 # http acl Safe_ports port 21 # ftp acl Safe_ports port 443 563 # https, snews acl Safe_ports port 70 # gopher acl Safe_ports port 210 # wais acl Safe_ports port 1025-65535 # unregistered ports acl Safe_ports port 280 # http-mgmt acl Safe_ports port 488 # gss-http acl Safe_ports port 591 # filemaker acl Safe_ports port 777 # multiling http acl CONNECT method CONNECT dibawah acl localhost src 127.0.0.1/255.255.255.255, tambahkan network yang akan di allowed acl lan src 192.168.1.0/255.255.255.0

setelah itu cari baris : http_access allow localhost # And finally deny all other access to this proxy http_access deny all lalu tambahkan: http_access allow lan menjadi: http_access allow localhost http_access allow lan # And finally deny all other access to this proxy http_access deny all Selanjutnya tambahkan baris visible_hostname visible_hostname proxy.skull.net 3. Buat folder cache dir, sesuai konfigurasi. Mis: /cache ~# mkdir -p /cache ~#chown proxy.proxy /cache 4. Buat cache, dengan perintah: ~# sudo squid z

You might also like