Sabtu, 9 Februari 2013

Konfigurasi Network, DNS, Web Server, & Mail Server


  1. SETTING NETWORK 
     Cara melihat Interface
 root@debian:~# ifconfig
     Cara konfigurasi network
 root@debian:~# nano /etc/network/interfaces

# The local network interface
auto eth0
iface eth0 inet static
            address 192.168.10.1
            netmask 255.255.255.0
            network 192.168.10.0
            gateway 192.168.10.254
            broadcast 192.168.10.255
            dns-nameservers 192.168.10.1
auto eth0:0
iface eth0:0 inet static
            address 192.168.10.2
            netmask 255.255.255.0
auto eth0:1
iface eth0:1 inet static
            address 192.168.10.3
            netmask 255.255.255.0

# Konfigurai skrip menjadi seperti ini, kemudian tekan Ctrl +  O, enter (untuk menyimpan) dan tekan Ctrl + X (untuk keluar)

root@debian:~# nano /etc/resolv.conf
search smkmuh2.sch.id
nameserver 192.168.10.1

Tambah skrip diatas ini, kemudian restart networknya
root@debian:~# /etc/init.d/networking restart


2. DNS SERVER
·   Install Bind9
root@debian:~# apt-get install bind9

·   Setting file bind9
root@debian:~# nano /etc/bind/named.conf

zone “smkmuh2.sch.id”{
            type master:
            file “db.smk”;
};

zone “192.in-addr.arpa”{
            type master;
            file “db.1”;
};

kemudian tekan Ctrl +  O, enter (untuk menyimpan) dan tekan Ctrl + X (untuk keluar)

·   Setting file forward dari DNS
root@debian:~# cd /etc/bind
root@debian:~# cp db.local /var/cache/bind/db.smk
root@debian:~# nano /var/cache/bind/db.smk

$TTL    604800
@         IN         A         smkmuh2.sch.id. root.smkmuh2.sch.id (       
                                                  2                    ; Serial
                                      604800                    ; Refresh
                                        86400                     ; Retry
                                    2419200                     ; Expire
                                      604800                    ; Negative Cache TTL
;
@                     IN         NS        smkmuh2.sch.id.
@                     IN         A          192.168.10.1
www                IN         A          192.168.10.2
mail                 IN         A          192.168.10.3

kemudian tekan Ctrl +  O, enter (untuk menyimpan) dan tekan Ctrl + X (untuk keluar)
root@debian:~# cp db.127 /var/cache/bind/db.192
root@debian:~# nano /var/cache/bind/db.192

$TTL    604800
@         IN         A       smkmuh2.sch.id. root.smkmuh2.sch.id. ( 
                                                1                         ; Serial
                                      604800                      ; Refresh
                                        86400                       ; Retry
                                    2419200                       ; Expire
                                      604800                      ; Negative Cache TTL
;
@                     IN         NS        smkmuh2.sch.id.
1.10.168          IN         PTR      smkmuh2.sch.id.
2.10.168          IN         PTR      www.smkmuh2.sch.id.
3.10.168          IN         PTR      mail.smkmuh2.sch.id.
           
kemudian tekan Ctrl +  O, enter (untuk menyimpan) dan tekan Ctrl + X (untuk keluar) lalu restart bind9

root@debian:~# /etc/init.d/bind9 restart
root@debian:~# nslookup smkmuh2.sch.id
root@debian:~# nslookup 192.168.10.1
root@debian:~# nslookup www.smkmuh2.sch.id
root@debian:~# nslookup 192.168.10.2
root@debian:~# nslookup mail.smkmuh2.sch.id
root@debian:~# nslookup 192.168.10.3

3. WEB SERVER
·   
    Install Paket Web server
root@debian:~# apt-get install apache2 links

·   Setting Virtual Host
root@debian:~# cd /etc/apache2/sites-enabled
root@debian:~# cp 000-default www
root@debian:~# nano www
<VirtualHost  192.168.10.2:80>                                 
ServerAdmin webmaster@localhost
ServerName www.smkmuh2.sch.id                                                   

kemudian tekan Ctrl +  O, enter (untuk menyimpan) dan tekan Ctrl + X (untuk keluar)

4. WEBMAIL SERVER
·   Install paket webmail server
debian-server:~# apt-get install squirrelmail (masukan dvd 1 - 3)
debian-server:~# nano /etc/apache2/apache2.conf
Include “/etc/squirrelmail/apache.conf”  #tambahkan di baris paling bawah     

debian-server:#nano /etc/squirrelmail/apache.conf
# users will prefer a simple URL like http://webmail.example.com
<VirtualHost  192.168.10.3:80>                                 
DocumentRoot /usr/share/squirrelmail                    
ServerName mail.smkmuh2.sch.id                                       
</VirtualHost>
#. . .

5. MAIL SERVER
·   Install paket mail server
root@debian:#apt-get install  postfix  courier-imap  courier-pop

·   Membuat directory mail server
debian-server:~# maildirmake /etc/skel/Maildir

Menambahkan user (buat 2 user)
debian-server:~# adduser ferry1
Adding user `nama_peserta' ...
Adding new group `debian' (1007) ...
Adding new user `debian' (1007)  
with group `debian' ...
Creating home directory `/home/' tkj...
Copying files from `/etc/skel' ...
Enter new UNIX password: ****
Changing the user information for tkj
Enter the new value, or press ENTER for the default
Full Name []:
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n] y

·   Konfigurasi Postfix

debian-server:~# nano  /etc/postfix/main.cf
myhostname = smkmuh2.sch.id                                            
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = smkmuh2.sch.id, smkmuh2, localhost.localdomain, localhost
relayhost =
mynetworks = 127.0.0.0/8 195.168.19.3/24
#mailbox_command = procmail -a “$EXTENSION”
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
home_mailbox = Maildir/                              #Tambahkan pada baris paling bawah

Selanjutnya, tinggal tambahkan sedikit konfigurasi pada postfix melalui dpkg. Ikuti langkahnya seperti dibawah ini.
debian-server:~# dpkg-reconfigure postfix
General Type of Mail Configuration   : Internet Site
System Mail Name                                 : smkmuh2.sch.id
Root and postmaster mail recipient   : (biarkan kosong)
Other destination to accept...               : (pilih ok)
Force synchronous updates...               : No
Local Networks                                       : (tambahkan IP address squirrelmail)
Use Procmail for local delivery            : No
Mailbox size limit (bytes)                       : 0
Local address extension character       : +
Internet protocols to use                       : ipv4
debian-server:~# /etc/init.d/postfix restart
debian-server:~# /etc/init.d/courier-imap restart
debian-server:~# /etc/init.d/courier-pop restart
debian-server:~# /etc/init.d/apache2 restart

Selanjutnya, tinggal mengecek apakah konfigurasi kita berhasil

·   Cek Web Server
debian-server:~# links www.smkmuh2.sch.id
debian-server:~# links 192.168.10.2

·   Cek Mail Server
debian-server:~# links mail.smkmuh2.sch.id
debian-server:~# links 192.168.10.3

Tiada ulasan:

Catat Ulasan

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPPb5kn5UVhoAbpcJtin912P4PZni4oTCOFkgseOGNFn1if39Nu28ZC_tLwUCOMbcrtjkpMoiLn3uNvG1dGciOZnwgv_3Zyk2SAQw74Q3t4LeRH6Cu8dSHazJL9bVWId0lNsM85KUalkk/s128/Teori%20Ngeblog%20CURSOR%2011.gif