Download Artikel Debian Lenny
debian:~# mkdir /ftpserver
debian:~# chmod 755 –R /ftpserver
Buat sebuah user anonymous yang akan digunakan untuk mengakses FTP server.
debian:~# useradd –d /ftpserver barry
debian:~# passwd barry
1. Instalasi Paket
Intalasi paket pada debian cukup mudah dengan menggunakan apt-get.
a. apt-get install vsftpd
2. Konfigurasi FTP-Server
Konfigurasi yang dibutuhkan pada FTP-server dilakukan pada file vsftpd.conf
b. pico /etc/vsftpd.conf
#
#
local_enable=YES
# 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
c. ctrl+x y enter untuk menyimpan
d. Kemudian restart vsftpd dengan perintah berikut
debian:~# /etc/init.d/vsftpd restart
e. Menguji server ftp
debian:~# netstat -a | grep ftp
tcp 0 0 *:ftp *:* LISTEN
debian:~# telnet localhost
Kalau pesan yang muncul conected to localhost —> server sudah jalan
Kalau pesan conection refused ——> server tidak jalan
debian:~# ftp ftp.pgri109-tng.sch.id
Connected to ftp.pgri109-tng.sch.id.
220 Welcome to pgri109-tng.sch.id FTP service.
Name (ftp.pgri109-tng.sch.id): ftp
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX
Using binary mode to transfer files.
ftp> dir
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
226 Directory send OK.
Untuk dapat mengakses ftp server pada microsoft windows dengan menggunakan alamat URL ftp://ftp.pgri109-tng.sch.id bukan degan alamat IP
Untuk implementasi sistem EMail. Versi paket yang digunakan :
• postfix
• courier-imap
• courier-pop
• squirrelmail
1. Instalasi Paket
Intalasi paket pada debian cukup mudah dengan menggunakan apt-get.
debian:~# apt-get install postfix courier-imap courier-pop squirrelmail
debian:~# dpkg-reconfigure postfix
2. Konfigurasi EMail-Server
Seluruh konfigurasi postfix terletak di /etc/postfix/main.cf dan squirrelmail
a. pico /etc/posfix/main.cf
myhostname = mail.pgri109-tng.sch.id
mydomain = pgri109-tng.sch.id
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = mail.pgri109-tng.sch.id, server, localhost, localdomain, localhost
home_mailbox = Maildir/
relayhost =
mynetworks = 127.0.0.0/8 192.168.20.0/24
#mailbox_command = procmail -a “$EXTENSION”
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
b. ctrl+x y enter untuk save
c. pico /usr/sbin/squirrelmail-configure
server software : courier
d. copy source code squirrelmail ke server web
debian:~# cp /usr/share/squirrelmail /var/www –R
debian:~# squirrelmail-configure
e. buat virtualhost squirrelmail
debian:~# pico /etc/apache2/sites-enabled/000-defaultdefault
arahkan root direktori ke direktori squirrelmail (default:/usr/share/squirrelmail)
f. Restart semua konfigurasi
debian:~# /etc/init.d/courier-pop restart
debian:~# /etc/init.d/courier-imap restart
debian:~# /etc/init.d/postfix restart
3. Buka Browser
http://mail.pgri109-tng.sch.id/squirrelmail/
4. Membuat User / Account Email
a. Buat user dengan perintah useradd
debian:~# useradd barry –s /bin/false –m
b. Buat password untuk user barry
debian:~# passwd barry
DHCP (Dynamic Host Configuration Protocol) adalah protokol yang berbasis arsitektur client/server yang dipakai untuk memudahkan pengalokasian alamat IP dalam satu jaringan secara otomatis. Sebuah jaringan lokal yang tidak menggunakan DHCP harus memberikan alamat IP kepada semua komputer secara manual. Jika DHCP dipasang di jaringan lokal, maka semua komputer yang tersambung di jaringan akan mendapatkan alamat IP secara otomatis dari server DHCP. Selain alamat IP, banyak parameter jaringan yang dapat di berikan oleh DHCP, seperti default gateway dan DNS server maupun WINS server.
Untuk implementasi system DHCP Server.Versi paket yang di gunakan :
• dhcp3-server
Instalasi Paket
Intallasi paket pada debian 4 cukup mudah dengan menggunakan apt-get.
1. Installasi
a. apt-get install dhcp3-server
Konfigurasi dhcp3-server
Konfigurasi yang dibutuhkan pada dhcp3-server dilakukan pada file dhcpd.conf dan default/dhcp3-server
2. Konfigurasinya
a. pico /etc/dhcp3/dhcpd.conf
b. Hilangkan tanda pager ( # ) pada bagian di bawah ini :
# subnet 10.5.5.0 netmask 255.255.255.224 {
# range 10.5.5.26 10.5.5.30;
# option domain-name-servers ns1.internal.example.org;
# option domain-name “internal.example.org”;
# option routers 10.5.5.1;
# option broadcast-address 10.5.5.31;
# default-lease-time 600;
# max-lease-time 7200;
# }
c. Hingga menjadi seperti di bawah ini :
subnet 192.168.20.0 netmask 255.255.255.0 {
range 192.168.20.2 192.168.20.50;
option domain-name-servers ns.pgri109-tng.sch.id;
option domain-name “pgri109-tng.sch.id”;
option routers 192.168.20.1;
option broadcast-address 192.168.20.255;
default-lease-time 600;
max-lease-time 7200;
}
Keterangan :
subnet 192.168.20.0 netmask 255.255.255.0 = alamat network (subnet) yang digunakan
range 192.168.20.2 192.168.20.50; = range ip address yang diterima client dalam hal ini mulai 192.168.1.2 s/d 192.168.1.200
option domain-name-servers 192.168.100.1; = alamat DNS server pada network kita
option domain-name “pgri109-tng.sch.id”; = nama domain kita
option routers 192.168.1.1; = alamat ip server dhcp yang berperan juga sebagai router
option broadcast-address 192.168.1.255; = alamat broadcast
default-lease-time 600; = waktu peminjaman 600 detik = 10 menit
max-lease-time 7200; = maksimum waktu peminjaman 7200 detik = 2 jam
d. Setelah itu simpan dan konfigurasi pada file
pico /etc/default/dhcp3-server
Sebelum : INTERFACES=” ”
Sesudah : INTERFACES=”eth0”
e. Restart file dhcp3-server yang telah di konfigurasi
/etc/init.d/dhcp3-server restart
Untuk implementasi system Proxy Server. Versi paket yang di gunakan :
• squid
Instalasi Paket
Intallasi paket pada debian cukup mudah dengan menggunakan apt-get.
1. Installasi
a. debian:~# apt-get install squid
Konfigurasi proxy server
a) debian:~# cd /etc/squid/
b) debian:/etc/squid# pico squid.conf
c) Hilangkan ( # ) dan edit pada bagian di bawah ini :
d) Gunakan ctrl+w untuk mencari
e) Di bawah acl localhost src 127.0.0.1/32, tambahkan :
acl mynetwork src 192.168.1.0/28
acl domain-terlarang dstdomain “/etc/squid/domain.txt”
acl kata-terlarang url_regex –i “/etc/squid/kata.txt”
f) Di bawah http_access allow localhost, tambahkan :
http_access allow mynetwork
g) Di bawah http_access deny all
http_access deny domain-terlarang
http_access deny kata-terlarang
# http_port 3128 transparent -> http_port 3128 transparent
# cache_mem 8 mb -> cache_mem 16 mb
# cache_dir ufs /var/spool/squid 100 16 256 -> cache_dir ufs /cache 10000 24 256
# cache_mgr webmaster -> cache_mgr webmaster@lksx.sch.id
# cache_effective_user proxy -> cache_effective_user proxy
# cache_effective_group proxy -> cache_effective_group proxy
# visible_hostname -> visible_hostname proxy.lksx.sch.id
h) Simpan ctrl+x
i) debian:/etc/squid# pico domain.txt
www.debian.rog
www.redhat.org
www.google.com
www.susefaq.sourceforge.net
www.linux.or.id
Website di atas hanya sebagai Contoh
j) debian:/etc/squid# pico kata.txt
Ubuntu
Kata di Atas Hanya Sebagai Contoh
k) debian:/etc/squid# mkdir /cache
l) debian:/etc/squid# chown –R proxy:proxy /cache
m) debian:/etc/squid# chown –R proxy:proxy /etc/squid/domain.txt
n) debian:/etc/squid# chown –R proxy:proxy /etc/squid/kata.txt
o) debian:/etc/squid# /etc/init.d/squid stop
p) debian:/etc/squid# squid –z
2010/12/6 23:43:30| Creating Swap Directories
q) debian:/etc/squid# /etc/init.d/squid start
r) debian:~ # pico /etc/rc.local
iptables -A PREROUTING -t nat -p tcp --dport 80 -j REDIRECT --to-port 3128
# exit 0
s) debian:~ # /etc/init.d/squid restart
DNS Server Pada Linux Debian
Installasi DNS Server dengan Bind9 dan Konfigurasinya
Pendahuluan
DNS (Domain Name Server) merupakan sebuah sistem dalam jaringan yang memungkinkan untuk memberikan alamat IP dan nama domain pada
client secara otomatis. Fungsi utama dari sebuah system DNS adalah menerjemahkan nomor IP (IP Address) menjadi nama-nama host (hostname) ataupun sebaliknya, sehingga nama tersebut mudah untuk diingat oleh pengguna internet.
Untuk implementasi sistem DNS dibutuhkan paket BIND9. Versi paket yang
digunakan :
- bind9
Instalasi Paket
Intalasi paket pada debian cukup mudah dengan menggunakan apt-get.
1. Installasi
a) debian:~# apt-get install bind9
Konfigurasi DNS-Server
Konfigurasi yang dibutuhkan pada DNS-server dilakukan pada file named.conf dan file db yang menangani zone domain lksx.sch.id
- Konfigurasinya
a) debian:~# cd /etc/bind/
b) debian:/etc/bind# named.conf.local
c) lalu tambahkan file ini di baris zone yang paling bawah
zone “lksx.sch.id” {
type master;
file “/etc/bind/db.lksx”;
};
zone “1.168.192.in-addr.arpa” {
type master;
file “/etc/bind/db.192”;
};
- Kopi file db.local ke dalam file db.lksx jadi nanti kita mengkonfigurasi file db.lksx
debian:/etc/bind# cp db.local db.lksx
- Kopi file db.127 ke dalam file db.192, jadi nanti kita mengkonfigurasi file db.192
debian:/etc/bind# cp db.127 db.192
- Lalu buka file db.lksx
a) debian:/etc/bind# pico db.lksx
b) ganti setiap nama localhost menjadi lksx.sch.id
c) ganti juga IP 127.0.0.1 menjadi 192.168.1.1
d) kemudian tambahkan file ini di bawah ini :
;
@ IN A NS lksx.sch.id.
@ IN A MX 10 mail.lksx.sch.id.
www IN A 192.168.1.1
mail IN A 192.168.1.1
ftp IN A 192.168.1.1
proxy IN A 192.168.1.1
@ IN AAAA ::1
e) ctrl+x lalu y enter untuk save
- Buka file db.192
a) debian:/etc/bind# pico db.192
b) ganti setiap nama localhost menjadi lksx.sch.id
c) ganti juga 1.0.0 menjadi 1
d) kemudian tambahkan file di bawah ini :
;
@ IN NS lksx.sch.id.
1 IN PTR www.lksx.sch.id.
1 IN PTR mail.lksx.sch.id.
1 IN PTR ftp.lksx.sch.id.
1 IN PTR proxy.lksx.sch.id.
e) ctrl+x lalu y enter untuk save
- Buka file resolv.conf
a) debian:~# pico /etc/resolv.conf
b) tambahkan
nameserver 127.0.0.1
nameserver 192.168.1.1
- debian:~# pico /etc/hosts
127.0.0.1 localhost
127.0.0.1 Debian
Menjadi
127.0.0.1 localhost
192.168.1.1 www.lksx.sch.id
- Kemudian restart bind9
debian:~# /etc/init.d/bind9 restart
- Tes apakah DNS Server kita berhasil dengan perintah nslookup www.lksx.sch.id atau nslookup 192.168.1.1
Web Server Pada Linux Debian
Installasi Web Server dan Konfigurasinya
Pendahuluan
WebServer adalah merupakan salah satu layanan internet yang populer karena ke populerannya maka layanan ini menjadi media yang dapat di manfaatkan untuk mempromosikan lembaga ataupun perusahaan. Web Server menggunakan protokol HTTP yang menggunakan arsitektur client – server, yaitu ada sebuah web server yang dapat memberikan layanan HTTP yang di minta oleh aplikasi client.
Untuk implementasi system Web Server. Versi paket yang di gunakan :
- Apache dan PHP
Instalasi Paket
Intallasi paket pada debian cukup mudah dengan menggunakan apt-get.
1. Installasi
debian:~# apt-get install apache2 libapache-mod-php5 phpmyadmin
Konfigurasi web server
- debian:~# cd /etc/apache2
- debian:/etc/apache2# a2enmodphp5
- debian:/etc/apache2# pico /etc/php5/apache2/php.ini
Hilangkan tanda ( ; ) pada bagian di bawah ini :
; extension=mysql.dll
; extension=mysql.so
Menjadi
extension=mysql.dll
extension=mysql.so
- buat directory sekolah dengan perintah :
debian:/etc/apache2# mkdir /var/www/lks
- buat file index.php dengan perintah :
debian:/etc/apache2# pico /var/www/lks/info.php
tambahkan script berikut :
phpinfo();
?>
SIMPAN & KELUAR
- debian:/etc/apache2# pico /var/www/lksx/index.html
ganti script berikut menjadi di bawah ini :
SIMPAN & KELUAR
- menyalin file host default menjadi file host sekolah dengan perintah :
debian:/etc/apache2# cp sites-available/default sites-available/lksx
- buka file tersebut dengan perintah :
debian:/etc/apache2# pico sites-available/lksx
- edit huruf yang tercetak tebal seperti di bawah ini :
ServerAdmin webmaster@lksx.sch.id
Name www.lksx.sch.id
DocumentRoot /var/www/lks
Options FollowSymLinks
AllowOverride None
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
# RedirectMatch ^/$ /apache2-default/
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
AllowOverride None
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On
Alias /doc/ "/usr/share/doc/"
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
Mengaktifkan Virtual Host lksx dgn perintah :
- debian:/etc/apache2# a2ensite lks
Mendisable Host Default dengan perintah* :
debian:/etc/apache2# a2dissite 000-default atau
debian:/etc/apache2# default (*wajib di dilakukan)
Merestart Web Server dengan perintah* :
debian:/etc/apache2# /etc/init.d/apache2 restart (*wajib di resstart)
Konfigurasi Network Pada Linux Debian
• Konfigurasi pada Server
Konfigurasi yang dibutuhkan pada IP Server dilakukan pada file network/interfaces.
Konfigurasinya : debian:~# cd /etc/network
debian:/etc/network# pico interfaces
File ini memuat konfigurasi IP yang akan digunakan oleh Network Interface yang terpasang pada suatu komputer. Selain alamat IP, file ini juga menyimpan informasi tentang routing.
a) Ganti lo menjadi eth0 dan loopback menjadi static
# 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
Lalu tambahkan baris : address 192.168.1.1
netmask 255.255.255.254
network 192.168.1.0
broadcast 192.168.20.254
b) Hingga menjadi seperti di bawah ini :
# 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 eth0
iface eth0 inet static
address 192.168.1.1
netmask 255.255.255.254
network 192.168.1.0
broadcast 192.168.1.254
c) Kemudian restart : debian:/etc/network# /etc/init.d/network restart
• Konfigurasi pada Router
Menggunakan 2 buah Ethernet Card
Konfigurasi yang dibutuhkan pada IP Server dilakukan pada file network/interfaces.
Konfigurasinya : debian:~# cd /etc/network
debian:/etc/network# pico interfaces
a) Tambahkan baris di bawahnya eth0=Server dan eth1=Client hingga menjadi seperti ini :
# 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 eth0
iface eth0 inet static
address 192.168.1.2
netmask 255.255.255.254
network 192.168.1.0
broadcast 192.168.1.254
gateway 192.168.1.1
auto eth1
iface eth1 inet static
address 172.16.1.1
netmask 255.255.255.0
network 172.16.1.0
broadcast 172.16.0.255
Keterangan :
Kata auto yang mendahului nama suatu interface menandakan bahwa interface tersebut akan dinyalakan secara otomatis pada saat booting. Interface lo tidak memiliki konfigurasi IP karena lo digunakan sebagai loopback sehingga memiliki IP yang pasti yakni 127.0.0.1. Alamat IP ini digunakan oleh komputer untuk berkomunikasi dengan dirinya sendiri. Konfigurasi untuk eth0 harus diberikan karena interface ini dikonfigurasi menggunakan IP statis. Parameter-parameter yang harus disebutkan untuk jenis interface static adalah:
address : menentukan IP address yang digunakan suatu komputer.
network : menentukan Network Address komputer.
netmask : menentukan subnet mask network komputer.
broadcast : menentukan alamat broadcast yang digunakan komputer untuk memperkenalkan diri pada jaringan.
gateway : menentukan default gateway yang digunakan apabila komputer tersebut.
b) Kemudian restart : debian:/etc/network# /etc/init.d/networking restart
c) debian:~# pico /etc/sysctl.conf
Hilangkan tanda pagar ( # ) pada bagian :
# net/ip4/ip_forward=1
menjadi :
net/ip4/ip_forward=1
d) Simpan dan aktifkan konfigurasi sysctl
debian:~# sysctl -p
e) debian:~# iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
f) debian:~# iptables -t nat -n –L
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
MASQUERADE all -- 0.0.0.0/0 0.0.0.0/0
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
g) Lalu simpan iptables dgn perintah :
debian:~# iptables-save
debian:~# echo “1″>/proc/sys/net/ipv4/ip_forward
Kemudian simpan dan restart komputer : debian:~# reboot
i) debian:~# ifconfig | less
eth0 Link encap:Ethernet HWaddr 00:0c:29:32:97:44
inet addr:192.168.1.1 Bcast:192.168.1.63 Mask:255.255.255.192
inet6 addr: fe80::20c:29ff:fe32:9744/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5 errors:0 dropped:0 overruns:0 frame:0
TX packets:82 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:400 (400.0 B) TX bytes:3660 (3.5 KiB)
Interrupt:19 Base address:0x2000
eth1 Link encap:Ethernet HWaddr 00:0c:29:32:97:4e
inet addr:172.16.1.0 Bcast:172.16.1.254 Mask:255.255.255.192
inet6 addr: fe80::20c:29ff:fe32:974e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:148 errors:0 dropped:0 overruns:0 frame:0
TX packets:100 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:12617 (12.3 KiB) TX bytes:9610 (9.3 KiB)
Interrupt:16 Base address:0x2080
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
j) debian:~# iptables -t nat -n –L
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
MASQUERADE all -- 0.0.0.0/0 0.0.0.0/0
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
k) Jika terdapat kata Masquerade all berarti konfigurasi Anda Sudah Berhasil.