Rabu, 22 Mei 2013

Konfigurasi Webmail Server dan Mail Server

  WEBMAIL SERVER

      Install paket webmail server

# apt-get install squirrelmail (masukan dvd 1 - 3)
# nano /etc/apache2/apache2.conf

Include “/etc/squirrelmail/apache.conf”   (tambahkan di baris paling bawah)  
    
#nano /etc/squirrelmail/apache.conf

# users will prefer a simple URL like http://webmail.example.com
<VirtualHost192.168.1.1:80>                                 
DocumentRoot /usr/share/squirrelmail                    
ServerName mail.tkj.com                                       
#. . .

MAIL SERVER

      Install paket mail server

#apt-get install  postfix  courier-imap courier-pop

      Membuat directory mail server

#maildirmake /etc/skel/Maildir

Menambahkan user (buat 2 user)

#adduser mz

Adding user `manshurin' ...
Adding new group `manshurin' (1007) ...
Adding new user `manshurin' (1007) with group `manshurin' ...
Creating home directory `/home/manshurin' ...
Copying files from `/etc/skel' ...
Enter new UNIX password: ****
Changing the user information for manshurin
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  

#adduser r

Adding user `manshurin' ...
Adding new group `manshurin' (1007) ...
Adding new user `manshurin' (1007) with group `manshurin' ...
Creating home directory `/home/manshurin' ...
Copying files from `/etc/skel' ...
Enter new UNIX password: ****
Changing the user information for manshurin
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

# nano  /etc/postfix/main.cf

myhostname = tkj.com                                         
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = tkj.com, tkj, localhost.localdomain, localhost
relayhost =
mynetworks = 127.0.0.0/8 192.168.9.3/29 

#mailbox_command = procmail -a “$EXTENSION”
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
home_mailbox = Maildir/                               #Tambahkan pada baris paling bawah

Selanjutnya tambahkan sedikit konfigurasi pada postfix melalui dpkg.

# dpkg-reconfigure postfix

General Type of Mail Configuration   : Internet Site
System Mail Name                             : tkj.com
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

 Cek Web Server

      # links www.tkj.com
# links 192.168.9.2

 Cek Mail Server

# links mail.tkj.com
# links 192.168.9.3

Instalasi dan Konfigurasi DNS Pada Debian

Pertama install bind9

# apt-get install bind9

Setelah itu edit file named.conf.

# nano /etc/bind/named.conf

Tambahkan zone-zone nya pada bagian yang paling bawah.

zone "tkj.com"{
type master;
file "db.a";
};

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

Masuk ke dalam direktori bind

# cd /etc/bind

Kemudian kopikan isi file db.local dan db.127 ke file db.a dan db.1

# cp db.local /var/cache/bind/db.a
# cp db.127 /var/cache/bind/db.1

Setelah dikopi, edit file tersebut

# nano /var/cache/bind/db.a

Ubah script menjadi :

$TTL    604800
@       IN      SOA     tkj.com. root.tkj.com. (
                                   2         ; Serial
                         604800         ; Refresh
                           86400         ; Retry
                       2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@        IN      NS     tkj.com.                                                                                     @        IN      A        192.168.1.1                                                                               www   IN      A        192.168.1.1
Save dan tutup filenya, lalu edit file yang satunya lagi, db.1

# nano /var/cache/bind/db.1

Ubah script menjadi :

$TTL    604800
@       IN      SOA     tkj.com. root.tkj.com. (
                                   1         ; Serial
                         604800         ; Refresh
                           86400         ; Retry
                       2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@                 IN      NS      tkj.com.   
1.1.168         IN     PTR     tkj.com.
Save dan tutup filenya.

Restart untuk bind 

# service bind9 restart

Lihat apakah konfigurasi telah berhasil atau tidak dengan perintah nslookup  

# nslookup tkj.com
Server:        192.168.1.1
Address:     192.168.1.1#53

Name:          tkj.com                                                                                                 Address:      192.168.1.1