Professional Documents
Culture Documents
Fundamental Class
Yaniko Dimas Yogo Prasetyo - @okinay
DNS Server
Web Server
Mail Server
Proxy
Server
Objective
At the end of this course, the student will:
Be familiar with Linux Debian OS and basic command of
Linux
Be able to configure, manage, do basic troubleshooting
of Linux Debian OS
Be able to build basic server services, such as DNS
Server, Web Server, DHCP Server, Mail Server and Proxy
Server
MODUL 1
Linux Basic
Why Debian?
Unparalleled support
Easy installation
Incredible amounts of software
Easy upgrades
Stability
Fast and easy on memory
Drivers for most hardware is written by GNU/Linux /
GNU/kFreeBSD users, not the manufacturer.
Good system security
Many more
Preparation
DVD Source / ISO Debian 6
Server Computer (or virtual box)
Intel x86 : i386 / Intel 64 or AMD 65 : AMD64
RAM > 2GB
HDD > 40 GB
Install Debian 6
When you already start your virtual machine, you can
find the option of installing debian
Install Debian 6
When you already start your virtual machine, you can find
the option of installing debian
Install Debian 6
Topology
192.168.50.100/24
Intern
et
192.168.50.254/24
192.168.50.x/25 (dhcp)
New IP Configuration
Then save the configuration, and run the script below to upgrade your
package source
# apt-get update
MODUL 2
DNS Server
/etc/bind/named.conf
file forward
file reverse
/etc/resolv.conf
$TTL 604800
@ IN SOA debiancourse.com. root.debiancourse.com. (
2
; Serial
604800
; Refresh
86400
; Retry
2419200
; Expire
604800 )
; Negative Cache TTL
;
@ IN NS debiancourse.com.
;add .dot. in every single domain you wrote
@ IN A
192.168.50.1
www
IN A
192.168.50.1
my IN A
192.168.50.1
$TTL 604800
@ IN SOA debiancourse.com. root.debiancourse.com. (
1
; Serial
604800
; Refresh
86400
; Retry
2419200
; Expire
604800 )
; Negative Cache TTL
;
@
IN NS debiancourse.com.
100.50.168
IN PTR debiancourse.com.
;write the IP reversed
From Windows
First, set your primary DNS to your server IP Address
Then run ping command to debiancourse.com on Command Prompt
MODUL 3
Web Server
#a2ensite my.debiancourse.com
MODUL 4
DHCP Server
What is DHCP?
Dynamic Host Configuration Protocol (DHCP) is a network protocol
that enables aserverto automatically assign an IP address to a
computer from a defined range of numbers (i.e., a scope)
configured for a given network.DHCPassigns an IP address when
a system is started
MODUL 5
Email Server
Configuring MX Record
Your email server is almost ready, now add MX Record in your DNS Forward File
Open DNS forward file
# nano /var/cache/bind/db.debian
Add this script on the last line
@ IN MX 192.168.50.100
Restart bind9 service
# /etc/init.d/bind9 restart
In another kind of browser, open IRedMail Webmail. Then login to second user
that you have created. And you can find a message that you have sent from
first user account
MODUL 6
Proxy Server
Delete command sign (#) in front of this script below and edit if it
#. . .
necessary
http_port 3128 transparent
#add transparent
cache_mem 16 MB
cache_mgr admin@debiancourse.com
visible_hostname proxy.debiancourse.com
#. . .
aclurl
dstdomain
/etc/squid/url
#blocked
domains
For
access
list, add script
below
to
acl key url_regex i /etc/squid/key #blocked words
http_access deny url
http_access deny key
acl lan src 192.168.50.0/24
#local IP Address
http_access allow lan
http_access allow all
ACL section
And enter the site that you will be blocked and save it
detik.com
kaskus.co.id
And enter the site that you will be blocked and save it
sex
porn
And start
# squid -z
Additional
If you use your Proxy Server, you make as a Gateway Server other
than as Proxy Server. You can make a Transparent Proxy with it.
Transparent proxy will force every single package to pass through
the proxy before it go to Internet
How?
Just add this IPTABLES to your server
# iptables t nat A PREROUTING s 192.168.50.0/24 p tcp --dport 80 j
REDIRECT --to-port 3128
# iptables-save > /etc/iptables