. semoga apa yang
saya sharekan ini bisa bermanfaat bagi pembelajaran anda sekalian. langsung
saja ikuti langkah - langkah berikut :
1. Install paket dhcp server
# apt-get install dhcp3-server
2. Konfigurasi dhcp server
# vim /etc/dhcp3/dhcp.conf
Konfigurasi utama DHCP Server terletak pada /etc/dhcp3/dhcpd.conf.
ptiondomain-name-servers 192.168.254.1;
subnet 192.168.254.0 netmask 255.255.255.0 {
range 192.168.254.1 192.168.254.10;
optiondomain-name-servers 192.168.254.1;
option domain-name “testing.com”;
option routers 192.168.254.1;
option broadcast-address 192.168.252.15;
default-lease-time 3600;
max-lease-time 7200;
}
Keterangan:
Pada baris pertama merupakan subnet dan netmask, baris kedua adalah range ip address yang kita alokasikan untuk klien, baris ketiga pemberian DNS untuk klien, baris keempat adalah name buat klien, baris kelima merupakan router ip, baris keenam merupakan broadcast ip, baris ketujuh adalah default waktu sewa dan baris terakhir maksimum waktu sewa.
3. Konfigurasi interface default
# vim /etc/default/dhcp
Konfigurasi utama DHCP server terletak pada /etc/default/dhcp
INTERFACE=”eth0″
(interface yang digubakan sbg dhcp server)
Restart DHCP server
$ /etc/init.d/dhcp3-server restart jika tidak ada error, berarti konfigurasi telah benar
4. Konfigurasi interface card
auto eth0
iface eth0 inet static
address 192.168.254.1
netmask 255.255.255.0
network 192.168.254.0
broadcast 192.168.254.255
gateway 192.168.254.1
5. Client konfigurasi
Rubah file berikut
# nano /etc/network/interfaces
masukkan konfigurasi:
auto eth0
iface eth0 inet dhcp
kemudian restart service networking
# /etc/init.d/networking restart
kemudian cek IP address
# ifconfig
1. Install paket dhcp server
# apt-get install dhcp3-server
2. Konfigurasi dhcp server
# vim /etc/dhcp3/dhcp.conf
Konfigurasi utama DHCP Server terletak pada /etc/dhcp3/dhcpd.conf.
ptiondomain-name-servers 192.168.254.1;
subnet 192.168.254.0 netmask 255.255.255.0 {
range 192.168.254.1 192.168.254.10;
optiondomain-name-servers 192.168.254.1;
option domain-name “testing.com”;
option routers 192.168.254.1;
option broadcast-address 192.168.252.15;
default-lease-time 3600;
max-lease-time 7200;
}
Keterangan:
Pada baris pertama merupakan subnet dan netmask, baris kedua adalah range ip address yang kita alokasikan untuk klien, baris ketiga pemberian DNS untuk klien, baris keempat adalah name buat klien, baris kelima merupakan router ip, baris keenam merupakan broadcast ip, baris ketujuh adalah default waktu sewa dan baris terakhir maksimum waktu sewa.
3. Konfigurasi interface default
# vim /etc/default/dhcp
Konfigurasi utama DHCP server terletak pada /etc/default/dhcp
INTERFACE=”eth0″
(interface yang digubakan sbg dhcp server)
Restart DHCP server
$ /etc/init.d/dhcp3-server restart jika tidak ada error, berarti konfigurasi telah benar
4. Konfigurasi interface card
auto eth0
iface eth0 inet static
address 192.168.254.1
netmask 255.255.255.0
network 192.168.254.0
broadcast 192.168.254.255
gateway 192.168.254.1
5. Client konfigurasi
Rubah file berikut
# nano /etc/network/interfaces
masukkan konfigurasi:
auto eth0
iface eth0 inet dhcp
kemudian restart service networking
# /etc/init.d/networking restart
kemudian cek IP address
# ifconfig
konfigurasi Ftp server di Debian,
saya postingkan ini supaya bermanfaat bagi pembelajaran anda
sekalian. langsung saja ikuti langkah - langkah berikut :
Fungsi: Melayani client untuk proses upload dan download file
Langkah Membuat:
1. Memberikan ip untuk server FTP
#vim /etc/network/interfaces
address 192.168.1.1
netmask 255.255.255.0
broadcast 192.168.1.255
network 192.168.1.0
2. Menginstall packet (vsftpd /Very Secure FTP Daemond)
#apt-get install vsftpd
3. Mengkonfigurasi FTP Server
#vim /etc/vsftpd.conf
anonymous_enable=NO (mendisable user anonymous) /YES
#Uncomment this to enable any form of FTP write command.
local_enable=YES (mengaktifkan user lokal_
# Uncomment this to enable any form of FTP write command.
write_enable=YES
#
# 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
#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
#anon_upload_enable=YES
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#anon_mkdir_write_enable=YES
#
# Activate directory messages – messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES
#
# Activate logging of uploads/downloads.
xferlog_enable=YES
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES
#
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using “root” for uploaded files is not
# recommended!
#chown_uploads=YES
#chown_username=whoever
#
# You may override where the log file goes if you like. The default is shown
# below.
#xferlog_file=/var/log/vsftpd.log
#
# If you want, you can have your log file in standard ftpd xferlog format
#xferlog_std_format=YES
#
# You may change the default value for timing out an idle session.
#idle_session_timeout=600
#
# You may change the default value for timing out a data connection.
#data_connection_timeout=120
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
#nopriv_user=ftpsecure
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
#async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that on some FTP servers, ASCII support allows a denial of service
# attack (DoS) via the command “SIZE /big/file” in ASCII mode. vsftpd
# predicted this attack and has always been safe, reporting the size of the
# raw file.
# ASCII mangling is a horrible feature of the protocol.
#ascii_upload_enable=YES
#ascii_download_enable=YES
4. Menjalankan vsftpd
#/etc/init.d/vsftpd restart
5. Menguji server ftp
#telnet localhost 21
kelau pesan yang muncul conected to localhost —> server sudah jalan
Kalau pesan conection refused ——> server tidak jalan
6. Mencoba upload/download file
#ftp localhost atau #ftp nomor_ip komputer
masukkan user
masukkan password
untuk upload —>put atau mput
untuk download —>get atau mget
untuk pindah direktori —-> cd
untuk melihat isi direktor —>ls
Kalau di windows pakai filezilla atau wsftp
Letak file
login user system maka letak file di /home/user
login anonymous maka letak file di /home/ftp
Fungsi: Melayani client untuk proses upload dan download file
Langkah Membuat:
1. Memberikan ip untuk server FTP
#vim /etc/network/interfaces
address 192.168.1.1
netmask 255.255.255.0
broadcast 192.168.1.255
network 192.168.1.0
2. Menginstall packet (vsftpd /Very Secure FTP Daemond)
#apt-get install vsftpd
3. Mengkonfigurasi FTP Server
#vim /etc/vsftpd.conf
anonymous_enable=NO (mendisable user anonymous) /YES
#Uncomment this to enable any form of FTP write command.
local_enable=YES (mengaktifkan user lokal_
# Uncomment this to enable any form of FTP write command.
write_enable=YES
#
# 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
#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
#anon_upload_enable=YES
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#anon_mkdir_write_enable=YES
#
# Activate directory messages – messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES
#
# Activate logging of uploads/downloads.
xferlog_enable=YES
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES
#
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using “root” for uploaded files is not
# recommended!
#chown_uploads=YES
#chown_username=whoever
#
# You may override where the log file goes if you like. The default is shown
# below.
#xferlog_file=/var/log/vsftpd.log
#
# If you want, you can have your log file in standard ftpd xferlog format
#xferlog_std_format=YES
#
# You may change the default value for timing out an idle session.
#idle_session_timeout=600
#
# You may change the default value for timing out a data connection.
#data_connection_timeout=120
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
#nopriv_user=ftpsecure
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
#async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that on some FTP servers, ASCII support allows a denial of service
# attack (DoS) via the command “SIZE /big/file” in ASCII mode. vsftpd
# predicted this attack and has always been safe, reporting the size of the
# raw file.
# ASCII mangling is a horrible feature of the protocol.
#ascii_upload_enable=YES
#ascii_download_enable=YES
4. Menjalankan vsftpd
#/etc/init.d/vsftpd restart
5. Menguji server ftp
#telnet localhost 21
kelau pesan yang muncul conected to localhost —> server sudah jalan
Kalau pesan conection refused ——> server tidak jalan
6. Mencoba upload/download file
#ftp localhost atau #ftp nomor_ip komputer
masukkan user
masukkan password
untuk upload —>put atau mput
untuk download —>get atau mget
untuk pindah direktori —-> cd
untuk melihat isi direktor —>ls
Kalau di windows pakai filezilla atau wsftp
Letak file
login user system maka letak file di /home/user
login anonymous maka letak file di /home/ftp
Konfigurasi Proxy server
fungsinya (ni menurut newbie lho)
adalah men-cache halaman-halaman web yang pernah diakses oleh klien, jadi kalo
nanti ada klien lain mengakses halaman yang sama, maka objek-objeknya aka
diambil dari proxy. karena sudah dilokalkan maka akan terasa lebih cepat
aksesnya.CMIIW..
Untuk aplikasi web proxynya menggunakan squid, install dulu squid menggunakan apt-get. Bisa online atau mengambil paketnya dari DVD. Kalau online jangan lupa atur dulu source.list-nya. arahkan ke server IIX aja biar lebin kenceng.
Untuk aplikasi web proxynya menggunakan squid, install dulu squid menggunakan apt-get. Bisa online atau mengambil paketnya dari DVD. Kalau online jangan lupa atur dulu source.list-nya. arahkan ke server IIX aja biar lebin kenceng.
# nano /etc/apt/source.list
1
|
selanjutnya update database dan
install squid
# apt-get update
# apt-get install squid
# apt-get install squid
File konfigurasi squid adalah /etc/squid/squid.conf,
lakukan konfigurasi seseui keadaan dan kebutuhan. beberapa konfigutasi yang
utama diantaranya
1
|
############################
|
|
2
|
# Port
|
|
3
|
############################
|
|
4
|
http_port 3128
transparent
|
|
default port squid adalah 3128, bisa
diganti dengan 8080 atau sesuai selera yang belum terpakai oleh service lain.
1
|
########################################################################
|
|
2
|
# cache_dir type
Directory-Name Space in Mbytes Level1 Level2
|
|
3
|
########################################################################
|
|
4
|
cache_dir aufs
/cache 2500 8 256
|
|
Selanjutnya adalah cache
directory-nya. Pada pembagian pertasi sebelumnya telah dibuat partisi khusus
untuk proxy dengan FS ReiserFS dan mount point-nya /cache.
1
|
#################################
|
|
2
|
# ALLOWED ACCESS
|
|
3
|
#################################
|
4
|
acl rocketnet src
192.168.10.0/27
|
5
|
http_access allow
rocketnet
|
|
6
|
http_access deny all
|
|
Allowed acces berfungsi untuk
mengizinkan klien mana ya berhak untuk mengakses proxy. dari konfigurasi di
atas rocketnet dengan source dari network 192.168.10.0/27 atau range dari
192.168.10.1 – 192.168.10.30.
1
|
#####################################
|
|
2
|
# Cache &
Object
|
|
3
|
#####################################
|
|
4
|
cache_mem 6 MB
|
|
5
|
maximum_object_size
54 MB
|
|
6
|
minimum_object_size
0 KB
|
|
7
|
maximum_object_size_in_memory
2 KB
|
cache_mem adalah alokasi penyimpanan
objek di RAM, jika RAM anda besar (misal 1 GB), nilainya bisa di set misal 256.
banyak yang menyebutkan bahwa besar cache_mem adalah 1/3 dari kapasitas RAM.
maximum_object_size adalah ukuran maksimal objek yang diizinkan untuk dicache. objek dengan size lebih besar akan diabaikan. Kalau prinsip saya sendiri sebagai newbie lebih baik men-cache file kecil-kecil tapi banyak diakses klien daripada file besar tapi hanya diakses 1-2 klien.
maximum_object_size adalah ukuran maksimal objek yang diizinkan untuk dicache. objek dengan size lebih besar akan diabaikan. Kalau prinsip saya sendiri sebagai newbie lebih baik men-cache file kecil-kecil tapi banyak diakses klien daripada file besar tapi hanya diakses 1-2 klien.
Sepertinya hanya itu konfigurasi
yang utama, untuk yang konfigurasi yang lainnya bisa di set default atau diotak
atik sendiri sampai ketemu performa yang tebaik. Untuk konfigurasi squid.conf
saya sendiri bisa dilihat di sini
Langkah berikutnya adalah membuat
cache swapnya, yaitu direktory /cache. rubah kepemilikan folder menjadi
milik user dan group proxy
# chown -R proxy.proxy /cache
selanjutnya buat cache swapnya
dengan perintah squid -z (tapi sebelumnya matikan dulu service squidnya
# /etc/init.d/squid stop
# squid -z
# squid -z
jalankan kembali squid
/etc/init.d/squid start
kalau squid sudah berjalan dan tidak
ada error langkan selanjutnya adalah membelokan semua request http (port 80)
untuk diarahkan ke port proxy/squid (3128) dengan menggunakan iptables
# iptables -t nat -A PREROUTING -d !
192.168.10.0/27 -i eth1 -p tcp -m tcp –dport 80 -j REDIRECT –to-ports 3128
simpan konfigurasi iptables
# iptables > /etc/iptables.save
File Konfigurasi router debian 6.0 :
/etc/network/interfaces
/etc/dhcp/dhcpd.conf
/etc/default/isc-dhcp-server atau
/etc/default/dhcp3-server
/etc/sysctl.1
/etc/resolv.conf
/etc/rc.local
Paket router debian 6.0
dhcp3-server
bind9
Langkah – langkah dalam penginstalan
router debian 6.0 :
- Setting IP Address eth0 dan eth1
Baik sebelumnya mari kita asumsikan
bahwa eth0 terhubung ke modem ADSL ataupun WiFi atau ip
address yang telah diberikan oleh router sebelumnya.
Eth0 : 172.16.7.2
Sedangkan eth1
terhubung ke dalam LAN /client local dengan
menggunakan IP address :
Eth0 : 192.168.50.1
Caranya:
/etc/network/interfaces
• Masuk ke directory
/etc/network/interfaces
nano /etc/network/interfaces “Nano
merupakan editor seperti vi/vim”
auto eth0
allow-hotplug eth0
iface eth0 inet dhcp
auto eth1
iface eth1 inet static
address 192.168.50.1
netmask 255.255.255.0
network 192.168.50.0
broadcast 192.168.50.255
gateway 192.168.50.1
NB: kenapa eth1 di set iface dan
eth0 inet dhcp ?? karena eth0 dah diset oleh router sebelumnya.
setelan selesai tekan ESC kemudian
ketikkan perintah :wq untuk menyimpannya.
/etc/default/isc-dhcp-server
atau /etc/default/dhcp3-server
interfaces =”eth1″
medefinisikan eth berapa yg akan
dijadikan interfaces router / melayani pewrmintaan dhcp client.
Konfigurasi
BIND9
• Install paket DNS
server yaitu Bind9
Masukkan perintah:
#apt-get install bind9
Setelah proses instalasi selesai
mari lakukan setting DNS dengan memasukkan perintah:
#vim /etc/bind/named.conf
Kemudian akan muncul :
//add entries for other zone below
here
zone “(nama domain yang diinginkan)”
IN {
type master;
file “db.domain”;
};
zone “50.168.192.in-addr.arpa” IN {
type master;
file “db.1”;
};
Setelah selesai save konfigurasi
tadi dengan tekan ESC kemudian ketiikkan perintah
:wq untuk menyimpannya
Setelah itu marilah kita buat file
db.domain dan db.ip pada direktori /var/cache/bind
1. Membuat db.domain
Masukkan perintah :
vim /var/cache/bind/db.domain
Kemudian masukkan konfigurasi
seperti di bawah ini:
;
; Bind data file for local loopback
interfaces
;
$TTL 604800
@ IN
SOA admin.armagedon.com. root.admin.armagedon.com. (
1 ; Serial
60480 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ; Negative Cache TTL
;
@ IN
NS armagedon.com
@ IN
A 192.168.50.1
IN MX
10 admin.armagedon.com
Debian IN A
192.168.50.1
www
IN
admin CNAME
setelah selesai save konfigurasi
tadi dengan tekan ESC kemudian ketikkan :wq untuk
menyimpannya
2. Membuat db.1
Masukkan perintah:
vim /var/cache/bind/db.1
Kemudian masukkan konfigurasi
seperti di bawah ini:
;
; BIND reverse data file for
broadcast zone
;
$TTL 604800
@ IN
SOA admin.armagedon.com. root.admin.armagedon.com. (
1
; Serial
60480 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ; Negative Cache TTL
;
@ IN
NS armagedon.com
1 IN A
armagedon.com
setelah selesai save konfigurasi
tadi dengan tekan ESC kemudian ketikkan
:wq untuk
menyimpannya
/etc/resolv.conf
• Konfigurasi file
resolv.conf (vim /etc/resolv.conf)
Nameserver 192.168.50.1
Domain armagedon.com (biasanya sudah
auto mengikuti settingan router diatasnya)
search armagedon.com (biasanya
sudah auto mengikuti settingan router diatasnya)
• Restart bind9 (
/etc/init.d/bind9 restart)
/etc/dhcp/dhcpd.conf
subnet 192.168.50.0 netmask
255.255.255.0 {
range 192.168.50.0 192.168.50.200;
option domain-name-servers
172.16.3.28, dns_isp, dns_isp;
option domain-name “boleh.net.id”;
option routers 192.168.50.1;
option broadcast-address
192.168.50.255;
default-lease-time 600;
max-lease-time 7200;
}
/etc/sysctl.conf
hilangkan tanda # pada baris ipv4
/etc/rc.local
• Masukkan rule iptables
untuk share internet dari eth0 ke eth1
Masukikan perintah
#iptables –t nat –A POSTROUTING –o
eth0 –j MASQUERADE
perintah iptables
diatas digunakan untuk menshare koneksi internet dr eth0 ke eth1.
Untuk mempermanenkannya
jangan lupa save konfigurasi tadi dengan
memasukkan
perintah:
$ sudo sh -c "iptables-save > /etc/iptables.rules" atau
$ sudo bash -c "iptables-save > /etc/iptables.rules"
dan
tambahkan 2 baris script ini di /etc/network/interfaces
pada
eth WAN
auto eth0
allow-hotplug eth0
iface eth0 inet dhcp
pre-up iptables-restore <
/etc/iptables.rules
post-down iptables-restore <
/etc/iptables.rules
• Langkah terakhir yaitu
dengan merestart settingan network anda
Masukkan perintah:
#/etc/init.d/networking restart
atau #reboot agar hasil rubahan
lebih maknyusss
untuk melihat apakah settingan
iptables telah terpasang setelah reboot, coba ketikan perintah
#iptables -t nat -n -L atau #iptables -nl -t nat atau #iptables -t nat -nL
Konfigurasi web server
Setelah berhasil Mengkonfigurasi DNS Server Selanjutnya kita akan mengkonfigurasi Web Server. Pada
setting kali ini akan sangat mudah, karna hanya membutuhkan beberapa langkah
saja. Silahkan ikuti langkah berikut:
* Kata2 yang bercetak tebal adalah perintah yang dijalankan pada komputer server.
* Kata2 yang berwarna merah adalah yang harus anda ubah atau buat.
1) apt-get install apache2 php5
2) pico /etc/apache2/sites-available/default (Tambahkan pada baris terakhir)
ServerAdmin yudhi@situstkj.co.cc
ServerName www.situstkj.co.cc
ServerAlias situstkj.co.cc
DocumentRoot /var/www/
3) /etc/init.d/apache2 restart
Restarting web server: apache2 ... waiting .
4) pico /var/www/index.html
5) Buka browser komputer client dan masukkan url www.situstkj.co.cc anda akan melihat
melihat
tampilan ini:
|

0 komentar:
Posting Komentar