Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

Membangun DNS SERVER dan MAIL SERVER

Membangun DNS dan Web Mail Server

Opsi konfigurasi :
1. IP Address
a. smk.sch.id = 200.100.4.65/27
b. www.smk.sch.id = 200.100.4.66/27
c. mail.smk.sch.id = 200.100.4.67/27
2. DNS Server
a. Sistem Operasi = OS Linux
b. Domain = smk.sch.id
c. Email Admin = nama_peserta@smk.sch.id
d. Sub Domain = www.smk.sch.id
mail.smk.sch.id

1
Untuk Kalangan Sendiri
Membangun DNS SERVER dan MAIL SERVER
IP ADDRESS
# /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 primary network interface


auto eth0
iface eth0 inet static
address 200.100.4.65
netmask 255.255.255.224
network 200.100.4.64
broadcast 200.100.4.95
gateway 200.100.4.65
# dns-* options are implemented by the resolvconf package, if installed
dns-namesarvers 200.100.4.65
dns-search smk.sch.id

auto eth0:0
iface eth0:0 inet static
address 200.100.4.66
netmask 255.255.255.224
network 200.100.4.64
broadcast 200.100.4.95
gateway 200.100.4.65

auto eth0:1
iface eth0:1 inet static
address 200.100.4.67
netmask 255.255.255.224
network 200.100.4.64
broadcast 200.100.4.95
gateway 200.100.4.65

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

2
Untuk Kalangan Sendiri
Membangun DNS SERVER dan MAIL SERVER
DNS SERVER
ukk : /# apt-get install bind9
reading package list … Done
Building dependency tree
Do you want to continue [Y/N] Y

# /etc/bind/named.conf.local
zone “smk.sch.id” {
type master;
file “/etc/bind/db.forward”;
};
Zone “4.100.200.in-addr.arpa” {
Type master;
File “/etc/bind/db.reverse”;
};

# /var/chace/bind/db.forward
;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA smk.sch.id. suli.smk.sch.id. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative cache TTL
;
@ IN NS smk.sch.id.
IN A 200.100.4.65
www IN A 200.100.4.66
mail IN A 200.100.4.67

# /var/chace/bind/db.reverse
;
; BIND reverse file for local loopback interface
;
$TTL 604800
@ IN SOA smk.sch.id. suli.smk.sch.id. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative cache TTL
;
@ IN NS smk.sch.id.
65 IN PTR smk.sch.id.
66 IN PTR www.smk.sch.id.
67 IN PTR mail.smk.sch.id.

ukk: ~# /etc/init.d/bind9 restart

CEK DNS
ukk: /# nslookup
> 200.100.4.65
server : 200.100.4.65
addres : 200.100.4.65#53
65.4.100.200.in-addr.arpa name = smk.sch.id.
> smk.sch.id
server : 200.100.4.65
address: 200.100.4.65#53
name = smk.sch.id
addres: 200.100.4.65
> 200 .100.4.66
server : 200.100.4.65
address: 200.100.4.65#53
66.4.100.200.in-addr.arpa name = www.smk.sch.id.
3
Untuk Kalangan Sendiri
Membangun DNS SERVER dan MAIL SERVER
> www.smk.sch.id
server : 200.100.4.65
address: 200.100.4.65#53
name = www.smk.sch.id.
Address : 200.100.4.66
> 200.100.4.67
server : 200.100.4.65
address: 200.100.4.65#53
67.4.100.200.in-addr.arpa name =mail.smk.sch.id.
> mail.smk.sch.id
server : 200.100.4.65
address: 200.100.4.65#53
name : mail.smk.sch.id.
Address : 200.100.4.66

WEB SERVER
# apt-get install apache2 php5 links
Reading package list …. Done
Building dpendency tree
Do you want to continue [Y/N] y
# /etc/apache2/site-enabled/webmail
NameVirtualHost 200.100.4.66:80
<VirtualHost *:80>
ServerName www.smk.sch.id
DocumentRoot /home/suli/public_html
</VirtualHost>
ukk: ~# mkdir /etc/skel/public_html
ukk:~# adduser suli
adduser: the user ‘suli’ already exist
ukk:~# adduser suli2
adding user ‘suli2’ ….
Adding new group ‘suli2’ (1002) ….
Adding new user ‘suli2’ (1002) with group ‘suli1’ ….
Creating home directory ‘/home/suli2’ ……
Copying file from ‘/etc/skel’ …..
Enter new UNIX password :
Retype new UNIX password :
Passwd: password update successfully
Changing the user information for suli2
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
ukk:~# /etc/init.d/apache2 restart
ukk:~# links www.smk.sch.id

index of /
index of /

[ICO] name Last modified size description


------------------------------------------------------
------------------------------------------------------
Apache /2.2.9 (Debian) PHP/5.2.6-1+lenny3 with suhosin patch server at
www.smk.sch.id port 80
image http://www.smk.sch.id/icons/blanks.gif

MAIL SERVER + WEBMAIL


ukk : ~# apt-get install postfix courier-imap squirrelmail
reading package lists … Done
building dependency tree
reading state information … done
do you want to continue [Y/N] Y

# /etc/postfix/main.cf
# see /usr/share/postfix/main.cf.dist for a commented, more complete version
4
Untuk Kalangan Sendiri
Membangun DNS SERVER dan MAIL SERVER

# debian specific: specifying a file name will cause the first


# line of that file to be used as the name. the debian default
# is /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)


biff = no

# appending .domain is the MUA’s job.


appending_dot-mydomain = no

# uncomment the next line to generate “delayed mail” warnings


# delay_warning_time = 4 h

Redme_directory = no

# TLS parameters
smtpd_tls_cert_file =/etc/ssl/cert/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-sert-snakeoil.key
smpd_use_tls=yes
smtpd_tls_session_chace_database = btree:${data_directory}/smtpd_schace
smtp_tls_session_chace_database = btree:${data_directory}/smtp_schace

# see /usr/share/doc/postix/TLS_README.gz in the postfix_doc package for


# information on enabling SSL in the smtp client.

myhostname = ukk.smk.sch.id
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/alilases
myorigin = ukk.smk.sch.id
mydestination = smk.sch.id, ukk.smk.sch.id, localhost.smk.sch.id, localhost,
localhost.localdomain
relayhost =
mynetwork = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 200.100.4.64/27
# mailbox_command = procmail –a “SEXTENTION”
mailbox_size_limit = 0
recipient_dilimeter = +
inet_interfaces = all
home_mailbox = Maildir/

suli:~# /etc/squirrelmail/conf.pl
SquirrelMail Configuration : Read : config.php (1.4.0)
Main Menu - - -
1. Organizatian Preferences
2. Servers settings
Q Qiut

commad >> 2

SquirrelMail Configuration : Read : config.php (1.4.0)


Server Settings
General
1. Domain :
trims(implode('',file('/etc'.(file_exist('/etc/mailname')?'mail':'host').'name')))
2. Invert Time : False
3. Sendmail or SMTP : SMPT

A. Update IMAP Settings : localhost:143 (other)


B. Update SMTP Settings : localhost:25

R Return to Main Menu


C Turn color on
S save data
Q Quit
command >> 1

5
Untuk Kalangan Sendiri
Membangun DNS SERVER dan MAIL SERVER
The domain name is the suffix at the end of all email addresses. If for example, your email
addrss is jdoe@example.com, then your domain would be example.com
[ trim (implode ( ‘ ‘ ,
file (‘/etc/’. (file_exists(‘/etc/mailname’) ?’mail’ : ‘host’). ‘name’)))]: smk.sch.id

squirrelmail Configuration : Read : config.php (1.4.0)


Server Settings
General
Domain : smk.sch.id
Invert Time : false
Sendmail or SMTP : SMTP

Update IMAP setting : localhost:143 (other)


Update SMTP setting : localhost:25

R Return to main menu


C Turn color on
S Save data
Q Quit

Command >> r

SquirrelMail Configuration : Read : config.php (1.4.0)


Main Menu - - -
1. Organizatian Preferences

D. Set pre-defined settings for specific IMAP servers

C Turn color on
S Save data
Q Quit

Command >> d

Please select your iMAp server:


Bincimap = Binc IMAP Server
Courier = Courier IMAP server
Qiut = do not change anything
Command >> courier

Imap_server_type = courier
Default_folder-prefix = INBOX
Trash_folder = Trash
Sent_folder = Sent
Draft_folder = Drafts
Show_prefix_option = false
Default_sub_of_inbox = false
Show_contain-subfolders-option = false
Optional_delimeter =.
Delete_folder = true

Press any key to conyinue …

SquirrelMail Configuration : Read : config.php (1.4.0)


Main Menu - - -
1. Organizatian Preferences

D. Set pre-defined settings for specific IMAP servers

C Turn color on
S Save data
Q Quit
command >> s

data saved in config.php


Press eneter to continue …

SquirrelMail Configuration : Read : config.php (1.4.0)


6
Untuk Kalangan Sendiri
Membangun DNS SERVER dan MAIL SERVER
Main Menu - - -
D. Set pre-defined settings for specific IMAP servers

C Turn color on
S Save data
Q Quit
command >> q

ukk:~# maildirmake /etc/skel/Maildir


ukk:~#
ukk:~# ln –s /etc/squirrelmail/apache.conf /etc/apache2/conf.d/squirrelmail.conf

# /etc/apache2/conf.d/squirrelmail.conf

#Alias / squirrelmail /usr/share/squirrelmail


Alias /webmail /usr/share/squirrelmail
<directory / usr/share/squirrelmail>
Options Indexes FollowsSymLink
<Ifmodule mod_php4.c>
php_flag register_globals off
</ifmodule>
<Ifmodule mod_php5.c>
php_flag register_globals off
</ifmodule>
<ifmodule mod_dir.c>
DirectoryIndex index.php
</ifmodule>
# acces to configtest is limited by default toprevent information leak
< File configtest.php>
order deny,allow
deny from all
allow from 127.0.0.1
</File>
</Directory>

# users will prefer a simple URL like http://webmail.example.com


<VirtualHost 200.100.4.67>
DocumentRoot /usr/share/squirrelmail
ServerName mail.smk.sch.id
</VirtualHost>

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


Stopping Postfix Mail Transport Agent : postfix
Starting Postfix Mail Transport Agent : postfix
ukk:~# /etc/init.d/courier-imap restart
Stopping Courier UMAP server : IMAP
Starting Courier UMAP server : IMAP
ukk:~# /etc/init.d/apache2 restart

ukk:~# links mail.smk.sch.id

7
Untuk Kalangan Sendiri

You might also like