Kamis, 17 Oktober 2013

Konfigurasi DHCP Server Debian

Sebelumnya, selamat bagi anda yang telah berhasil Mengkonfigurasi Proxy Server. Langkah terakhir yang akan kita lakukan adalah mengkonfigurasi DHCP Server.. 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 dhcp3-server

Non-authoritative version of DHCP server OK

2) Pico /etc/default/dhcp3-server

Pada bagian ini,anda harus memilih LAN Card yang akan anda jadikan DHCP
Pilih INTERFACE=” eth1” (interface yang menuju ke client)

3) pico /etc/dhcp3/dhcpd.conf

         # A slightly different configuration for an internal subnet.
         subnet 192.168.5.0 netmask 255.255.255.0 {
         range 192.168.5.10 192.168.5.50;
         option domain-name-servers 192.168.5.1;
         option domain-name "smkn1nganjuk.sch.id";
         option routers 192.168.5.0;
         option broadcast-address 192.168.5.255;
         default-lease-time 600;
         max-lease-time 7200;
         }



 * Untuk kata yang tidak saya cantumkan, jangan diubah/dihapus.

4) Pico /etc/init.d/dhcp3-server start

5) Reboot

6) Sambil menunggu komputer server hidup kembali. Ubah settingan TCP/IP di client windows menjadi:



5) Kemudian ping dari komp windows ke komp server.

C:\Users\tkj>ping 192.168.5.1
Pinging 192.1685.1with. 32 bytes of data:
Reply from
192.1685.1: bytes=32 time<1ms TTL=64
Reply from
192.1685.1: bytes=32 time<1ms TTL=64
Reply from
192.1685.1: bytes=32 time<1ms TTL=64
Reply from
192.1685.1: bytes=32 time=1ms TTL=64
Ping statistics for
192.1685.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 1ms, Average = 0ms



C:\Users\antoro>ping 192.168.1.5
Pinging 192.168.1.5 with 32 bytes of data:
Reply from 192.168.1.5: bytes=32 time=1ms TTL=64
Reply from 192.168.1.5: bytes=32 time<1ms TTL=64
Reply from 192.168.1.5: bytes=32 time<1ms TTL=64
Reply from 192.168.1.5: bytes=32 time<1ms TTL=64
Ping statistics for 192.168.1.5:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 1ms, Average = 0ms

6) Check mulai dari DNS, Web, Mail, Ftp, Proxy. Jika bisa, berarti konfigurasi anda berhasil.


Konfigurasi Proxy Server Debian

Setelah Mengkonfigurasi FTP Server, Sekarang kita akan belajar mengkonfigurasi Proxy Server. Menurut saya ini adalah konfigurasi yang sangat membutuhkan ketelitian. So, Becarefull with your step..!

*Kata2 bercetak tebal adalah perintah yang harus dijalankan.
*Kata2 berwarna merah adalah perubahan/sesuatu yang harus anda buat.

1) apt-get install squid

2) rm /etc/squid/squid.conf

3) pico /etc/squid/squid.conf

         acl all src all
         acl localnet src 192.168.1.0/24
         acl situs url_regex -i "/etc/squid/blokir.txt"
         http_access deny situs
         http_access allow localnet
         http_access allow all
         http_port 3128 transparent
         cache_mem 8 mb
         memory_replacement_policy heap GDSF
         cache_replacement_policy heap LFUDA
         store_dir_select_algorithm round-robin
         cache_dir aufs /cache 10000 24 256
         cache_store_log none
         cache_access_log /var/log/squid/access.log
         cache_effective_user proxy
         cache_effective_group proxy
         visible_hostname proxy.smkn1nganjuk.sch.id


3) pico /etc/squid/blokir.txt
sub. smkn1nganjuk.sch.id

4) mkdir /cache

5) chown –R proxy:proxy /etc/squid/blokir.txt

6) chown –R proxy:proxy /cache

7) /etc/init.d/squid stop

8) squid –z

2010/10/16 19:43:30| Creating Swap Directories

9) /etc/init.d/squid start

10) pico /etc/rc.local

iptables -A PREROUTING -t nat -p tcp --dport 80 -j REDIRECT --to-port 3128
#exit 0

11) /etc/init.d/squid restart

Restarting Squid HTTP proxy: squid Waiting.....................done.



12) Buka browser komp client dan buka http://sub.situstkj.co.cc anda akan melihat tampilan ini:


12) tail -f /var/log/squid/access.log
1287233395.322 6 192.168.5.1 TCP_DENIED/403 1454 GET http://sub.smkn1nganjuk.sch.id/ - NONE/- text/html * (ini adalah log dari website yang diakses oleh client)



Konfigurasi FTP Debian

Setelah Mengkonfigurasi Webmail Server, Sekarang kita akan belajar mengkonfigurasi FTP Server. Hanya diperlukan beberapa Langkah untuk mengkonfigurasi FTB server tersebut. 


*Kata2 bercetak tebal adalah perintah yang harus dijalankan.
*Kata2 berwarna merah adalah perubahan/sesuatu yang harus anda buat.

1) apt-get install  proftpd

Run proftpd : standalone

2) pico  /etc/proftpd/proftpd.conf

# Includes DSO modules
Include /etc/proftpd/modules.conf

# Set off to disable IPv6 support which is annoying on IPv4 only boxes.
UseIPv6                       off

# If set on you can experience a longer connection delay in many cases.
IdentLookups off
ServerName                "ftp.smkn1nganjuk.sch.id"
ServerType                 standalone
DeferWelcome            off


3) /etc/init.d/proftpd  restart

Stopping ftp server: proftpd.
Starting ftp server: proftpd.

4) Buka browser komputer client dan buka url ftp://ftp.smkn1nganjuk.sch.id anda akan melihat tampilan ini:

Anda bisa login menggunakan username antok, ataupun username anisa, yang sudah anda buat pada saat
konfigurasi mail server tadi.


Konfigurasi WebMail Server Debian

Setelah berhasil Mengkonfigurasi Web Server Selanjutnya kita akan mengkonfigurasi Webmail Server. Pada setting kali ini akan sangat memerlukan ketelitian. 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 postfix squirrelmail courier-imap courier-pop

Create directories for web-based administration : NO
Local only                                                            : OK
General type of mail configuration                      : Internet Site
System mail name                                                : smkn1nganjuk.sch.id

2) pico /etc/apache2/apache2.conf

                  # Include the virtual host configurations:
                  Include /etc/apache2/sites-enabled/
                  Include /etc/squirrelmail/apache.conf

3) pico /etc/squirrelmail/apache.conf

# users will prefer a simple URL like http://webmail.example.com
#<virtualhost 1.2.3.4>
# DocumentRoot /usr/share/squirrelmail
# ServerName webmail.example.com
#</virtualhost>

<VirtualHost 192.168.1.7:80>
DocumentRoot /usr/share/squirrelmail
ServerName    mail.smkn1nganjuk.sch.id
</VirtualHost>

* Jangan ubah / hapus baris yang lainnya.

4) /etc/init.d/apache2  restart
Restarting web server: apache2 ... waiting .

5) Buka browser komputer client dan masukkan url mail.situstkj.co.cc anda akan melihat tampilan ini:


6) maildirmake  /etc/skel/Maildir

7) adduser antok
8) dpkg-reconfigure postfix

Local only                                                                    : OK
General type of mail configuration                              : Internet Site
System mail name                                                        : smkn1nganjuk.sch.id
Root and postmaster mail recipient                             : (kosongkan)
Other destinations to accept mail for (blank for none)    : 192.168.1.5/24 ( ganti localhost dengan ip tersebut,jangan rubah yang lain )
Force synchronous updates on mail queue                      : No
Local networks                                                                 : 192.168.5.1/24 ( tambahkan ip ini pada baris terakhir,jangan dihapus script lainya )
Use procmail for local delivery                                       : NO
Mailbox size limit (bytes)                                                : 0
Local address extension character                                   : +
Internet protocols to use                                                   : ipv4

10) pico /etc/postfix/main.cf

inet_interfaces = all
inet_protocols = ipv4
home_mailbox = Maildir/




* Jangan ubah / hapus baris lainnya.

11) /etc/init.d/postfix  restart

Stopping Postfix Mail Transport Agent : postfix.
Starting Postfix Mail Transport Agent   : postfix.

12) /etc/init.d/courier-imap  restart

Stopping Courier IMAP server : imapd.
Starting Courier IMAP server   : imapd.

14) /etc/init.d/courier-pop  restart

Stopping Courier POP3 server : pop3d.
Starting Courier POP3 server   : pop3d.

15)  Buka Browser PC client anda. Masukkan url "http://mail.smkn1nganjuk.sch.id" Setelah itu silahkan email2an Jika berhasil maka konfigurasi WebMailserver anda sukses.


Konfigurasi Web Server Debian

Setelah berhasil Mengkonfigurasi DNS 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

2) pico /etc/apache2/sites-available/default

    <VirtualHost 192.168.1.6:80> ( Tambahkan script ini pada baris paling bawah sendiri )          
    ServerAdmin       tkj@ smkn1nganjuk.sch.id
    ServerName       www.smkn1nganjuk.sch.id
    ServerAlias         smkn1nganjuk.sch.id
    DocumentRoot   /var/www/
    </VirtualHost>

3) /etc/init.d/apache2 restart

Restarting web server: apache2 ... waiting .

4) pico /var/www/index.html





<html><body><h1>www. smkn1nganjuk.sch.id berhasil</h1></body></html>


5) Buka browser komputer client dan masukkan url www.situstkj.co.cc anda akan melihat tampilan ini:


Selasa, 15 Oktober 2013

Konfigurasi DNS (Domain Name Server) pada OS Debian

Setelah berhasil konfigurasi router Selanjutnya kita akan mengkonfigurasi DNS Server. pada setting kali ini anda harus teliti salah satu karakter saja maka konfigurasi tidak akan berjalan. 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 bind9

2) cd /etc/bind

3) pico named.conf.local

                  zone   "smkn1nganjuk.sch.id" {
                  type master;
                  file      "/etc/bind/db.smkn";
                  };

                  zone  "sub.smkn1nganjuk.sch.id" {
                  type master;
                  file     "/etc/bind/db.sub";
                  };

                  zone  "1.168.192.in-addr.arpa" {
                  type master;
                  file     "/etc/bind/db.192";
                  };


4) pico named.conf.options

                  options {
                                    directory "/var/cache/bind";
                                   forwarders {                    ( hilangkan tanda // didepanya ,yang lain tidak )
                                                     192.168.1.1;  ( hilangkan tanda // didepanya ,yang lain tidak )
                                    };                                    ( hilangkan tanda // didepanya ,yang lain tidak )
                                    allow-query { any; };
                                    auth-nxdomain no; # conform to RFC1035
                                   listen-on-v6 { any; };
                  };
* Jangan ubah/hapus baris yang lain.

5) cp db.local db.smkn1nganjuk

6) cp db.local db.sub

7) cp db.127 db.192










8) pico db.smkn1nganjuk

 ;
 ; BIND data file for local loopback interface
 ;
 $TTL 604800
@ IN SOA        smkn1nganjuk.sch.id. root.smkn1nganjuk.sch.id. (
                                       2                    ; Serial
                                       604800          ; Refresh
                                       86400            ; Retry
                                       2419200        ; Expire
                                       604800 )        ; Negative Cache TTL
 ;
@           IN       NS                   smkn1nganjuk.sch.id.
@           IN       A                     192.168.1.5
www      IN       A                     192.168.1.6 ( sesuaikan dengan ip alias yang anda buat )
mail        IN       A                     192.168.1.7 ( sesuaikan dengan ip alias yang anda buat )

9) pico db.sub

;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA sub.smkn1nganjuk.sch.id. root.sub.smkn1nganjuk.sch.id.  (
                                  2              ; Serial
                                  604800    ; Refresh
                                  86400      ; Retry
                                  2419200  ; Expire
                                  604800 )  ; Negative Cache TTL
;
@           IN       NS                   sub.smkn1nganjuk.sch.id.
@           IN       A                     192.168.1.5
www      IN       A                     192.168.1.6 ( sesuaikan dengan ip alias yang anda buat )
mail        IN       A                     192.168.1.7 ( sesuaikan dengan ip alias yang anda buat )



10) pico db.192

; BIND reverse data file for local loopback interface
;
$TTL 604800
@ IN SOA     smkn1nganjuk.sch.id. root.smkn1nganjuk.sch.id. (
                                  1               ; Serial
                                  604800     ; Refresh
                                  86400       ; Retry
                                  2419200   ; Expire
                                  604800 )   ; Negative Cache TTL
;
@      IN         NS      smkn1nganjuk.sch.id.
 5       IN         PTR    smkn1nganjuk.sch.id.
 6       IN         PTR    www.smkn1nganjuk.sch.id. ( sesuaikan dengan ip alias yang anda buat )
 7       IN         PTR    mail.smkn1nganjuk.sch.id.   (
sesuaikan dengan ip alias yang anda buat )


* 5 berasal dari : 192.168.1.5

11) pico /etc/resolv.conf
search smkn1nganjuk.sch.id
nameserver 192.168.1.5
nameserver 192.168.1.1
12) /etc/init.d/bind9  restart
Stopping domain name service...: bind9.
Starting domain name service.....: bind9.

13) Sekarang kita check DNS Server kita melalui windows, masuk CMD dan ketikkan :
C:\Users\tkj>nslookup smkn1nganjuk.sch.id
Server: tkj.smkn1nganjuk.sch.id
Address:
192.168.1.5
Name: smkn1nganjuk.sch.id
Address: 192.168.1.5


C:\Users\tkj>nslookup www.smkn1nganjuk.sch.id
Server: tkj.smkn1nganjuk.sch.id
Address:
192.168.1.6
Name: tkj.smkn1nganjuk.sch.id
Address: 192.168.1.6


C:\Users\antoro>nslookup mail.smkn1nganjuk.sch.id
Server: tkj.smkn1nganjuk.sch.id
Address:
192.168.1.7
Name: tkj.smkn1nganjuk.sch.id
Address: 192.168.1.7
Aliases: mail. smkn1nganjuk.sch.id


C:\Users\antoro> nslookup sub.smkn1nganjuk.sch.id
Server: tkj.smkn1nganjuk.sch.id
Address: 192.168.1.5
Name: sub. smkn1nganjuk.sch.id
Address: 192.168.1.5

Jika tampil tulisan berikut. Berarti konfigurasi Domain Name Service / DNS Server sudah berhasil.



Konfigurasi IP Alias & Router pada OS Debian

Setelah berhasil menginstal debian. Selanjutnya kita akan mengkonfigurasi Router. 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) pico  /etc/network/interfaces
                   # The primary network interface
                  allow-hotplug eth0
                  iface eth0 inet static
                  address 192.168.1.5
                  netmask 255.255.255.0
                  network 192.168.1.0
                  broadcast 192.168.1.255
                  gateway 192.168.1.1
                  # dns-* options are implemented by the resolvconf package, if installed
                  dns-nameservers 192.168.1.1
                  dns-search smkn1nganjuk.sch.id

                  # The local alias network interface ( Perintah untuk menambahkan ip alias )
                  auto eth0:1
                  iface eth0:1 inet static
                  address 192.168.1.6
                  netmask 255.255.255.0

                  auto eth0:2
                  iface eth0:2 inet static
                  address 192.168.1.7
                  netmask 255.255.255.0

                  # The secondary network interface  ( Perintah untuk menambahkan ip secondary )
                  auto eth1
                  iface eth1 inet static
                  address                   192.168.5.1
                  netmask                  255.255.255.0
                  network                  192.168.5.0
                  broadcast                192.168.5.255

2) /etc/init.d/networking  restart

3) pico /etc/sysctl.conf

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

4) iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
5) 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




6) iptables-save  >  /etc/network/iptables.conf

7) echo "iptables-restore  <  /etc/network/iptables.conf"  >>  /etc/network/if-up.d/iptables

8) pico /etc/network/if-up.d/iptables
#!/bin/sh ( tambahkan script ini )
iptables-restore < /etc/network/iptables.conf ( jangan dihapus,ini file defaultnya )


9) chmod  +x  /etc/network/if-up.d/iptables

10) reboot


11) ifconfig | less

                 eth0 Link encap:Ethernet HWaddr 00:0c:29:32:97:44
                 inet addr:192.168.1.5 Bcast:192.192.168.1.255 Mask:255.255.255.0
                 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:192.168.5.1 Bcast:192.168.5.255Mask:255.255.255.0
                 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

12) 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


 (Jika terdapat kata Masquerade all berarti konfigurasi Anda Sudah Berhasil)

13) Kita check koneksinya. Pada windows ubah Settingan TCP/IP Menjadi Seperti ini:
                 IP Address                   : 192.168.5.2
                 Subnet Mask                : 255.255.255.0
                 Default Gateway           : 192.168.5.1
                 Preferred DNS Server  : 192.168.5.1

14) Setelah settingan diubah, Bukalah Command Prompt computer client dan cek koneksi ke server.


C:\Users\tkj>ping 192.168.5.1
Pinging 192.1685.1with. 32 bytes of data:
Reply from
192.1685.1: bytes=32 time<1ms TTL=64
Reply from
192.1685.1: bytes=32 time<1ms TTL=64
Reply from
192.1685.1: bytes=32 time<1ms TTL=64
Reply from
192.1685.1: bytes=32 time=1ms TTL=64
Ping statistics for
192.1685.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 1ms, Average = 0ms






C:\Users\tkj>ping 192.168.1.5
Pinging 192.168.1.5 with 32 bytes of data:
Reply from 192.168.1.5: bytes=32 time=1ms TTL=64
Reply from 192.168.1.5: bytes=32 time<1ms TTL=64
Reply from 192.168.1.5: bytes=32 time<1ms TTL=64
Reply from 192.168.1.5: bytes=32 time<1ms TTL=64
Ping statistics for 192.168.1.5:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 1ms, Average = 0ms
 

15) Jika Reply, Maka konfurasi router anda bisa dikatakan berhasil.