Jumat, 08 Februari 2013

Konfigurasi DNS,Web Server,dan Mail Server



Hai sobat, kali ini ane akan sedikit membahas tentang konfigurasi DNS,WEB Server, dan Mail Server
Langsung mulai aja gan 
Pertama setting network dulu gan biar asiik :D

Adi:~# 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

auto eth0
iface eth0 inet static
        address 192.168.2.1
        netmask 255.255.255.0
        network 192.168.2.0
        broadcast 192.168.2.255
        gateway 192.168.2.254
        dns-nameservers 192.168.2.1

auto eth0:0
iface eth0:0 inet static
        address 192.168.2.2
        netmask 255.255.255.0

auto eth0:1
iface eth0:1 inet static
        address 192.168.2.3
        netmask 255.255.255.0

Save dengan menekan (CTRL+O)Tekan ENTER lalu (CTRL+X) ENTER untuk keluar

Adi:~# nano /etc/resolv.conf

search adi.com
nameserver 192.168.2.1

Save dengan menekan (CTRL+O)Tekan ENTER lalu (CTRL+X) ENTER untuk keluar

Setelah itu restart network nya

Adi:~# /etc/init.d/networking restart

konfigurasi DNS

v  Install bind9

Adi:~# apt-get install bind9
v Konfigurasi named.conf

Adi:~# nano/etc/bind/named.conf

//
// Do any local configuration here
//

// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";

zone    "adi.com" {
        type master;
        file "db.adi";
};

zone    "192.in-addr.arpa" {
        type master;
        file " db.192";
};

Save dengan menekan (CTRL+O)Tekan ENTER lalu (CTRL+X) ENTER untuk keluar

v Edit file Forward

Adi:~# cd /etc/bind/
Adi:~# cp db.local /var/cache/bind/db.adi
Adi:~#nano /var/cache/bind/db.adi
;
; 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

Edit file forward menjadi seperti yang di bawah ini

;
; BIND data file for local loopback interface
;
$TTL    604800
@       IN      SOA                   adi.com.  root.adicom. (
                              2                            ; Serial
                         604800                       ; Refresh
                          86400                        ; Retry
                        2419200                      ; Expire
                         604800 )                     ; Negative Cache TTL
;
@       IN      NS      adi.com.
@       IN      A           192.168.2.1
www   IN      A           192.168.2.2
mail    IN      A           192.168.2.3

Save dengan menekan (CTRL+O)Tekan ENTER lalu (CTRL+X) ENTER untuk keluar


v Edit File Reverse

adi:~# cp db.127 /var/cache/bind/db.192
adi:~# nano /var/cache/bind/db.192
;
; BIND reverse data file for local loopback interface
;
$TTL    604800
@       IN      SOA                   localhost. root.localhost. (
                              1                            ; Serial
                         604800                       ; Refresh
                          86400                        ; Retry
                        2419200                      ; Expire
                         604800 )                     ; Negative Cache TTL
;
@       IN      NS      localhost.
1.0.0    IN      PTR     localhost.

maka menjadi
;
; BIND reverse data file for local loopback interface
;
$TTL    604800
@       IN      SOA                   adi.com.  root.adi.com. (
                              1                            ; Serial
                         604800                       ; Refresh
                          86400                        ; Retry
                        2419200                      ; Expire
                         604800 )                     ; Negative Cache TTL
;
@                   IN      NS     adi.com.
1.0.168            IN      PTR   adi.com.
2.0.168            IN      PTR    www.adicom.
3.0.168            IN      PTR    mail.adi.com.

v Restart bind9
Adi:~# /etc/init.d/bind9 restart

Stopping domain name service...: bind9 waiting for pid 3538 to die.
Starting domain name service...: bind9.

v  Pengecekan IP dan Domain

adi:~# nslookup 192.168.2.1

Server:             192.168.2.1
Address:          192.168.2.1#53

1.1.168.192.in-addr.arpa         name = adi.com.

adi:~# nslookup 192.168.2.2

Server:             192.168.2.1
Address:          192.168.2.1#53

2.1.168.192.in-addr.arpa         name = www.adi.com.

adi:~# nslookup 192.168.2.3

Server:             192.168.2.1
Address:          192.168.2.1#53

3.1.168.192.in-addr.arpa         name = mail.adi.com.

adi:~# nslookup adi.com

Server:             192.168.2.1
Address:          192.168.2.1#53

Name:  adi.com
Address: 192.168.2.1

adi:~# nslookup www.adi.com

Server:             192.168.2.1
Address:          192.168.2.1#53

Name:  www.adi.com
Address: 192.168.1.2

adi:~# nslookup mail.adi.com

Server:             192.168.2.1
Address:          192.168.2.1#53

Name:  mail.adi.com
Address: 192.168.2.3

Instalasi web server

adi:~# apt-get  install apache2 elinks
adi:~# nano /var/www/index.html

<html><body><h1>ADI</h1></body></html>

Save dengan menekan (CTRL+O) untuk Menyimpan Tekan ENTER lalu (CTRL+X) ENTER untuk keluar

adi:~# /etc/init.d/apache2 restart

Restarting web server: apache2 ... waiting ..

adi:~# elinks www.adi.com

Installasi Postfix dan mail servernya, disini ane langsung install semua gan J

adi:~# apt-get install postfix courier-imap courier-pop squirrelmail
adi:~# nano /etc/apache2/apache2.conf

l  Include /etc/squirrelmail/apache.conf#TAMBAHKAN DI BARIS PALING BAWAH

adi:~# nano /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>

maka diubah

# users will prefer a simple URL like http://webmail.example.com
<VirtualHost 192.168.2.3:80>
  DocumentRoot /usr/share/squirrelmail
  ServerName mail.adi.com
</VirtualHost>
Save dengan menekan (CTRL+O)untuk Menyimpan Tekan ENTER lalu (CTRL+X) ENTER untuk keluar

adi:~# /etc/init.d/apache2 restart

Restarting web server: apache2.

adi:~# maildirmake /etc/skel/Maildir
adi:~# adduser aku (terserah anda juga sii :D)

Adding user `aku' ...
Adding new group `aku' (1001) ...
Adding new user `aku' (1001) with group `aku' ...
Creating home directory `/home/aku' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: kata sandi diperbaharui dengan sukses
Mengubah informasi pengguna dari aku
Masukkan nilai baru atau tekan ENTER untuk nilai bawaan
            Nama Lengkap []:
            Nomor Ruangan []:
            Telepon Kantor []:
            Telepon Rumah []:
            Lain-lain []:
Is the information correct? [Y/n] y

adi:~# adduser kamu (ini juga terserah anda :p)

Adding user `kamu' ...
Adding new group `kamu' (1002) ...
Adding new user `kamu' (1002) with group `kamu' ...
Creating home directory `/home/kamu' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: kata sandi diperbaharui dengan sukses
Mengubah informasi pengguna dari kamu
Masukkan nilai baru atau tekan ENTER untuk nilai bawaan
            Nama Lengkap []:
            Nomor Ruangan []:
            Telepon Kantor []:
            Telepon Rumah []:
            Lain-lain []:
Is the information correct? [Y/n] y

adi:~# nano /etc/postfix/main.cf
myhostname = adi.com                                       
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = adi, adi.com, 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/ #Tambah di baris paling bawah

Save dengan menekan (CTRL+O)Tekan ENTER lalu (CTRL+X) ENTER untuk keluar

adi:~# dpkg-reconfigure postfix
karna sebelumnya kita sudah mengedit dibagian “postfix main cf” disini kita hanya tinggal tekan enter,, dibagian “local delivery” kita pilih no

adi :~# /etc/init.d/apache2 restart

Restarting web server: apache2 ... waiting .

adi:~# /etc/init.d/postfix restart

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

adi:~# /etc/init.d/courier-imap restart

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

adi:~# /etc/init.d/courier-pop restart

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

adi:~# elinks mail.adi.com

0 komentar:

Posting Komentar

Diberdayakan oleh Blogger.

Template by:

Free Blog Templates