DNS Setup
DNS CONFIGURATION
DNS Setup
DNS Configuration
named daemon is used
A DNS Server may be caching/master/slave server
The [Link] file has information of all Root
Servers.
There is a Forward Zone file and a Reverse Zone
file for every domain.
Configuration file:
/var/named/chroot/etc/[Link]
Forward Zone File:
/var/named/chroot/var/named/<forward_zone_file>
Reverse Zone File:
/var/named/chroot/var/named/<reverse_zone_file>
DNS Setup
Sample Master [Link]
zone "." {
type hint;
file "[Link]";
};
zone "[Link]" {
type master;
file "[Link]";
allow-query {any;};
};
zone "[Link]" {
type master;
file "[Link]";
allow-query {any;};
};
zone "[Link]" {
type master;
file "[Link].203.200.95";
allow-query {any;};
};
zone "[Link]" {
type slave;
file "[Link]";
masters { [Link]; };
allow-query {any;};
DNS Setup
Sample Forward Zone File
$TTL 86400
@ IN SOA [Link]. [Link]. (
200605091 ; Serial
10800 ; Refresh - 3 hours
3600 ; Retry - 1 hour
1209600 ;Expire - 1 week
43200 ) ; Minimum TTL for negative answers - 12 hours
IN NS [Link].
IN NS [Link].
IN MX 5 [Link].
IN MX 10 [Link].
IN MX 20 [Link].
$ORIGIN [Link].
ns1 IN A [Link]
mail0 IN A [Link]
proxy IN CNAME mail0
DNS Setup
Sample Reverse Zone File
$TTL 86400
$ORIGIN [Link].
95 IN SOA [Link]. [Link]. (
200605091 ; Serial
10800 ; Refresh - 5 minutes
3600 ; Retry - 1 minute
1209600 ; Expire - 1 weeks
43200 ) ; Minimum TTL for negative answers - 12 hours
IN NS [Link].
IN NS [Link].
$ORIGIN [Link].
;
;
142 IN PTR [Link].
144 IN PTR [Link].
DNS Setup
Configuring Local Resolver
/etc/[Link]
server [Link]
DNS Setup
Test DNS
nslookup
host
dig
Test your DNS with the following DNS diagnostics
web site: [Link]
Apache Setup
APACHE SETUP
Web Server Setup
Web Server
Apache Web Server is used
Daemon is httpd (service httpd start/stop/restart)
Web Server Setup
Files used by Apache
Configuration file: /etc/httpd/conf/[Link]
Log files: /var/log/httpd/access_log and
/var/log/httpd/error_log
Modules /etc/httpd/modules
Default Document Root /var/www/html
Default CGI Root /var/www/cgi-bin
Web Server Setup
Apache Configuration Directives
Server Name
Min and Max Servers
Document Root
CGI Enable/Disable
User Directory
Directory Index
Mime Types
Modules
Access Restrictions
Secure Server
Web Server Setup
Basic Settings
Change the default value for ServerName
www.<[Link]> in [Link] and put the
website content in /var/www/html
Additionally you can configure Name based Virtual
Hosting (allow more than one websites to run on
the same server)
Web Server Setup
Virtual Hosting
NameVirtualHost *:80
<VirtualHost *:80>
ServerName server-name
DocumentRoot path-to-virtual-document-root
</VirtualHost>
<VirtualHost *:80>
ServerName server-name
DocumentRoot path-to-virtual-document-root
</VirtualHost>
Squid Setup
SQUID SETUP
Squid Setup
Obtaining Squid
Source code (in C) from [Link]
Binary executables
Linux (comes with RedHat and others)
FreeBSD
Windows
Pre-installed in Fedora/Enterprise Linux
Squid Setup
Basic Settings
Edit the /etc/squid/[Link] file to configure squid
Configuration options:
Disk Cache size and location
Authentication
Allowed Hosts
Any other access restrictions (sites, content, size,
time of access etc.) using ACL
service squid start/stop/restart
Squid Setup
Disc Requirements
Squid makes very heavy use of disc because of
heavy read/write in cache
Needs discs with low seek times
SCSI is better
Can spread cache over 2 or more discs
Raid not recommended
Cached data is not critical
Squid Setup
Calculating Disc Space
Recommend keeping at least 2 days worth of
objects
10 days may be better
Example:
256Kbps link loaded 10 hrs/day ~= 1GB
assume 50% cacheable - .5GB / day
2 days objects - 1GB
10 days objects - 5 GB
Squid Setup
[Link] Basic Configuration
cache_dir ufs /var/spool/squid/cache 100 16 256
auth_param basic program /usr/lib/squid/ncsa_auth
/etc/shadow
acl sidbiusers proxy_auth required
http_access allow sidbiusers
acl our_network src [Link]/24
http_access allow our_network
(Note: use squid –z for the first time to create the
cache directory and its subdirectories)
Sendmail Setup
SENDMAIL SETUP
Mail Server Setup
Sendmail Configuration
Daemon: sendmail
Configuration File: /etc/mail/[Link]
Edit the following lines
LOCAL_DOMAIN(`[Link]')dnl
(Replace [Link] by the domain name for which
the mail server is being configured)
DAEMON_OPTIONS(`Port=smtp,Addr=[Link],
Name=MTA')dnl
(comment this line by adding dnl at the start of the line)
dnl MASQUERADE_AS(`[Link]')dnl
(remove dnl & replace [Link] by the domain name)
Sendmail Setup
Sendmail Configuration
Add the range of IP addresses of your network in
access file
(e.g. 172.31. Relay)
Run “make –C /etc/mail” command to compile
[Link] and generate [Link] file.
Restart sendmail and watch for errors
Sendmail Setup
PoP & IMAP Server
PoP3 & IMAP Server can be started using dovecot
server. (service dovecot start)
Firewall
FIREWALL
Firewall
Basic Setup
Internet
Application Firewall
Web Server
Database
Firewall
Firewall Rules
IP Address of Source (Allow from Trusted Sources)
IP Address of Destination (Allow to trusted
Destinations)
Application Port Number (Allow Mail but restrict
Telnet)
Direction of Traffic (Allow outgoing traffic but
restrict incoming traffic)
Firewall
Firewall Implementation
Hardware Firewall: Dedicated Hardware Box (Cisco
PIX, Netscreen )
Software Firewall: Installable on a Server ( )
Host OSs (Windows XP/Linux) also provide
software firewall features to protect the host
These days Firewalls provide IDS/IPS (Intrusion
Detection System/Intrusion Prevention System)
services also.
Linux Security
LINUX Firewall
Use GUI (Applications ->System Settings->
Security Level) to activate the firewall
Allow standard services and any specific port
based application
All other services and ports are blocked
Linux Security
LINUX Firewall