Vous êtes sur la page 1sur 21

PROJECT REPORT

LINUX SERVER ROLE IN SMALL SCALE COMPANY

BY

ANKUSH NATH SAXENA (100321009)

MOHIT POPLI (100321024)

NEHASHARMA (100321026)

Submitted to the Department of System & Database Administration


In partial fulfillment of the requirements
For the
PG Diploma
In

System & Database Administration

CENTER FOR DEVLOPMENT OF ADVANCED COMPUTING

NOIDA

FEB, 2011
DECLARATION

I hereby declare that this submission is my own work and that, to the best of my
knowledge and belief, it contains no material previously published or written by another
person nor material which to a substantial extent has been accepted for the award of any
other degree or diploma of the university or other institute of higher learning, except
where due acknowledgment has been made in the text.

Signature

Name ANKUSH NATH SAXENA MOHIT POPLI NEHA SHARMA

Roll No. 100321009 100321024 100321026

Date
CERTIFICATE

This is to certify that Project Report entitled”LINUX SERVER ROLE IN SMALL SCALE
COMPANY” which is submitted by Ankush Nath Saxena, Mohit Popli, Neha Sharma in partial
fulfillment of the requirement for the award of PG Diploma in Department of System and
Database Administration of CDAC, Noida, is a record of the candidate own work carried out by
him under my/our supervision. The matter embodied in this thesis is original and has not been
submitted for the award of any other diploma.

Date: Mrs.Priyanka Mishra


ACKNOWLEDGEMENT

It gives us a great sense of pleasure to present the report of the PG Diploma Project undertaken
during February 2011. We owe special debt of gratitude to Mrs.Priyanka Sharma, Department
of Electronics & Instrumentation Engineering, Meerut for his constant support and guidance
throughout the course of our work. His sincerity, thoroughness and perseverance have been a
constant source of inspiration for us. It is only his cognizant efforts that our endeavors have seen
light of the day.

We also do not like to miss the opportunity to acknowledge the contribution of all faculty
members of the department for their kind assistance and cooperation during the development of
our project. Last but not the least, we acknowledge our friends for their contribution in the
completion of the project.

Signature:

Name ANKUSH NATH SAXENA MOHIT POPLI NEHA SHARMA

Roll No. 100321009 . 100321024 100321026

Date :
INDEX
• OBJECTIVE

• DNS SERVER

• APACHE WEB SERVER


• MAIL SERVER - SENDMAIL/POSTFIX

• DHCP

• FTP
OBJECTIVE

The main objective of this project is to configure DNS & Apache Web Server
using Red Hat at Linux Operating System as working environment. User interact
with their mail server that using MUA (Squirrel Mail) ,MTA (Sendmail/Postfix)
that uses POP or IMAP to download their messages to their local machine which
is used in company. DHCP service is configured to assign automatic IP address to
the entire host in the company on the server system.
DNS SERVER
DNS

Domain Name System (or Service or Server), is an Internet service that translates Domain
Names into IP addresses. Because domain name are alphabetic, they're easier to remember. The
Internet however, is really based on IP addresses. Every time you use a domain name, therefore,
a DNS service must translate the name into the corresponding IP address. For example, the
domain name www.example.com might translate to 198.105.232.4.

Even the visa versa is also what DNS does, i.e. it translates IP address to Domain Name, for
example when we receive a website with its domain address shown in the address bar, actually
DNS does the work of the converting the address back to the domain name.

The DNS system is, in fact, its own network. If one DNS server doesn't know how to translate a
particular domain name, it asks another one, and so on, until the correct IP address is returned.

DNS Server

Name servers

The Domain Name System is maintained by a distributed database system, which uses the client-
server model. The nodes of this database are the name servers. Each domain has at least one
authoritative DNS server that publishes information about that domain and the name servers of
any domains subordinate to it. The top of the hierarchy is served by the root nameservers, the
servers to query when looking up (resolving) a top level domain name.
Introduction

Domain Name System (DNS) converts the name of a Web site (www.google.com) to an IP
address (66.102.7.104). This step is important, because the IP address of a Web site's server, not
the Web site's name, is used in routing traffic over the Internet. This chapter will explain how to
configure your own DNS server to help guide Web surfers to your site.

DNS Domains

Everyone in the world has a first name and a last, or family, name. The same thing is true in the
DNS world: A family of Web sites can be loosely described a domain. For example, the domain
google.com has a number of children, such as www.google.com and mail.google.com for the
Web and mail servers, respectively.

BIND

BIND is an acronym for the Berkeley Internet Name Domain project, which is a group that
maintains the DNS-related software suite that runs under Linux. The most well known program
in BIND is named, the daemon that responds to DNS queries from remote machines.

DNS Clients

A DNS client doesn't store DNS information; it must always refer to a DNS server to get it. The
only DNS configuration file for a DNS client is the /etc/resolv.conf file, which defines the IP
address of the DNS server it should use.

Authoritative DNS Servers

Authoritative servers provide the definitive information for your DNS domain, such as the names
of servers and Web sites in it. They are the last word in information related to your domain.

How DNS Servers Find Out Your Site Information

There are 13 root authoritative DNS servers (super duper authorities) that all DNS servers query
first. These root servers know all the authoritative DNS servers for all the main domains -
.com, .net, and the rest. This layer of servers keeps track of all the DNS servers that Web site
systems administrators have assigned for their sub domains.

For example, when you register your domain my-site.com, you are actually inserting a record on
the .com DNS servers that point to the authoritative DNS servers you assigned for your domain.

Basic DNS Testing of DNS Resolution


Configuring Client System
Make change at the /etc/resolv.conf file by entering the following details.

NameServer 192.168.1.3

Check DNS IP at the client system using neat command.

Now use Dig Command to check pgdsda.com and the result should be all 4 steps.
Apache Web Server

Introduction

Apache is probably the most popular Linux-based Web server application in use. Once you have
DNS correctly setup, you'll need to configure Apache to accept surfers wanting to access your
Web site.

Download and Install the Apache Package


HTTPD is the package name that needs to be installed to configure DNS on the server.

HTTPD package's filename httpd-2.2.P3-9.i386.rpm. and its devel package name is httpd-devel-
2.3-13.To install http package name through rpm installation method the command used is “ rpm
-ivh httpd-2.2.P3-9.i386.rpm “ .If YUM is used to install the package then command used to
install is “yum install httpd”

How to Get Apache Started

Use the chkconfig command to configure Apache to start at boot:

[root@pgdsda]# chkconfig httpd on

Use the following to start apache service any time in the configuration
process.

[root@pgdsda]# /etc/init.d/httpd start


[root@pgdsda]# /etc/init.d/httpd stop
[root@pgdsda]# /etc/init.d/httpd restart

To test whether the Apache process is running use

[root@pgdsda]# pgrep httpd

Will get a response of plain old process ID numbers.

General Configuration Steps

The configuration file used by Apache is /etc/httpd/conf/httpd.conf in Red Hat Linux. As


for most Linux applications, you must restart Apache before changes to this configuration file
take effect.

Web Pages Location


DCHP

What is DHCP?

Dynamic Host Configuration Protocol (DHCP) is a network protocol that enables a server to
automatically assign an IP address to a computer from a defined range of numbers (i.e., a scope)
configured for a given network.

DHCP assigns an IP address when a system is started, for example:

1. A user turns on a computer with a DHCP client.

2. The client computer sends a broadcast request (called a DISCOVER or


DHCPDISCOVER), looking for a DHCP server to answer.

3. The router directs the DISCOVER packet to the correct DHCP server.

4. The server receives the DISCOVER packet. Based on availability and usage policies set
on the server, the server determines an appropriate address (if any) to give to the client.
The server then temporarily reserves that address for the client and sends back to the
client an OFFER (or DHCPOFFER) packet, with that address information. The server
also configures the client's DNS servers, WINS servers, NTP servers, and sometimes
other services as well.

5. The client sends a REQUEST (or DHCPREQUEST) packet, letting the server know that
it intends to use the address.

6. The server sends an ACK (or DHCPACK) packet, confirming that the client has been
given a lease on the address for a server-specified period of time.

When a computer uses a static IP address, it means that the computer is manually configured to
use a specific IP address. One problem with static assignment, which can result from user error
or inattention to detail, occurs when two computers are configured with the same IP address.
This creates a conflict that results in loss of service. Using DHCP to dynamically assign IP
addresses minimizes these conflicts.
DHCP Server Configuration for Red Hat Linux

Step 1

Download dhcp rpm package from Red Hat and install:


# rpm -ivh dhcp-2.0pl5-8.i386.rpm

Used #rpm –ivh dhcpd* so that all the serviced related to dhcpd are automatically installed.

Step 2

Opened file /etc/sysconfig/dhcpd and edit the first line as follows:


DHCPDARGS=eth1
Replaced 'eth1' above with the network interface that you want to use for dhcp; this should be an
internal network interface; denial of service attacks are possible if dhcp is running on an external
interface.

Step 3

Copied /usr/share/doc/dhcp-2.0pl5/dhcpd.conf.sample to /etc


# cp /usr/share/doc/dhcp-2.0pl5/dhcpd.conf.sample /etc/dhcpd.conf
This sample file is a good starting point for our /etc/dhcpd.conf file, which by default is not
installed.

Step 4

Edit /etc/dhcpd.conf according to the number of host that needs to be assigned IP address.

ddns-update-style interim;
ignore client-updates;

subnet 192.168.0.0 netmask 255.255.248.0 {

# --- default gateway


option routers 192.168.1.3;
option subnet-mask 255.255.255.0;
# option nis-domain "domain.org";
option domain-name "pgdsda.com";
option domain-name-servers 192.168.1.1;

option time-offset -18000; # Eastern Standard Time


# option ntp-servers 192.168.1.1;
# option netbios-name-servers 192.168.1.1;
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- you understand Netbios very well

# option netbios-node-type 2;

# range dynamic-bootp 192.168.1.128 192.168.1.254;


range 192.168.1.10 192.168.0.50;
default-lease-time 21600;
max-lease-time 43200;

# we want the nameserver to appear at a fixed address


host ns {
next-server marvin.redhat.com;
hardware ethernet 12:34:56:78:AB:CD;
fixed-address 207.175.42.254;
}
}

• The range given in this httpd.conf file is from 192.168.1.10 - 192.168.1.50


• This means that 50 hosts connected to the server can get the IP address automatically
assigned.
• The client system just has to change their networking setting to DHCP.
• The lease time defined here is 43200 i.e. in sec which means 12 hours.
• After 12 Hours automatically the server assign the same IP or different to the host.

Step 5

Firstly restarted the DHCP service i.e. service dhcpd restart so that all the changes done in the
file get acknowledged.

Now to check which host system are using which IP address can be easily done by looking at a
particular lease file.

Checked that the lease database has been created; the rpm should create this file automatically; if
not, create the file:

# touch /var/lib/dhcp/dhcpd.leases
To view the lease file:

#vi /var/lib/dhcp/dhcpd.leases

In this file the all the details related to client host IP address assigned , MAC address and
hostname is saved.

Reservation in DHCP

Reservation is used in DHCP so that client system gets same IP address assigned by the server
system every time any request for an IP address.

Thus same IP address gets assigned to a particular host which is fixed in the dhcpd.conf by
entering the information about the MAC address of the host system in the file.

The changes made to reserve a particular IP address in file are:

Original Line

host ns {
next-server marvin.redhat.com;
hardware ethernet 12:34:56:78:AB:CD;
fixed-address 207.175.42.254;
}

Copied these lines to make a new entry in the file dhcpd.conf

pgdsda {

host pgdsda;

hardware ethernet 70-71-BC-29-58-48;

fixed-address 192.168.1.15;

Thus a host with MAC address 70-71-BC-29-58-48 gets the IP address 192.168.1.15 only.
FILE TRANSFER PROTOCOL

File Transfer Protocol (FTP) is a standard network protocol used to copy a file from one host to
another over a TCP-based network, such as the Internet. FTP is built on client-server architecture
and utilizes separate control and data connections between the client and server. FTP users may
authenticate themselves using a clear-text sign-in protocol but can connect anonymously if the
server is configured to allow it.

The first FTP client applications were interactive command-line tools, implementing standard
commands and syntax. Graphical user interface clients have since been developed for many of
the popular desktop operating systems in use today.

FTP Overview

FTP relies on a pair of TCP ports to get the job done. It operates in two connection channels as
I'll explain:

FTP Control Channel, TCP Port 21: All commands you send and the ftp server's responses to
those commands will go over the control connection, but any data sent back (such as "ls"
directory lists or actual file data in either direction) will go over the data connection.

FTP Data Channel, TCP Port 20: This port is used for all subsequent data transfers between
the client and server.

Types of FTP:

1. Active FTP

2. Passive FTP

From a networking perspective, the two main types of FTP are active and passive. In active FTP,
the FTP server initiates a data transfer connection back to the client. For passive FTP, the
connection is initiated from the FTP client.
FTP Configuration
Installing Packages

The rpm package to be installed for ftp is vsftpd. To install this package Yum is used

[root@pgdsda ~]# yum install vsftpd


Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for vsftpd to pack into transaction set.
Vsftpd-2.0.5-10.el5.i386. 100% |=========================| 17 kB 00:00
---> Package vsftpd.i386 0:2.0.5-10.el5 set to be updated
--> Running transaction check

Dependencies Resolved

=====================================================================
Package Arch Version Repository Size
=====================================================================
========
Installing:
vsftpd i386 2.0.5-10.el5 rhel.repo 137 k

Transaction Summary
=====================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Total download size: 137 k


Is this ok [y/N]: y
Downloading Packages:
Running Transaction Test
warning: vsftpd-2.0.5-10.el5: Header V3 DSA signature: NOKEY, key ID 37017186
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: vsftpd ######################### [1/1]

Installed: vsftpd.i386 0:2.0.5-10.el5


Complete!

Now the default folder for the ftp location is:

/var/ftp/pub/

Here copy all those files and folders that the system admin wants its users on host system can
access the files easily.

To start the service of ftp:

[root@pgdsda]# chkconfig vsftpd on

To start, stop, and restart vsftpd after booting use the service command:

[root@pgdsda]# service vsftpd start

[root@pgdsda]# service vsftpd stop

[root@pgdsda]# service vsftpd restart

To determine whether vsftpd is running you can issue either of these two commands. The first
will give a status message. The second will return the process ID numbers of the vsftpd daemons.

[root@pgdsda]# service vsftpd status

[root@pgdsda]# pgrep spam

The /etc/vsftpd.ftpusers File

To restrict FTP access to certain users adds the users to the list of users in the /etc/vsftpd.ftpusers
file. The VSFTPD package creates this file with a number of entries for privileged users that
normally shouldn't have FTP access. As FTP doesn't encrypt passwords, thereby increasing the
risk of data or passwords being compromised, it is a good idea to let these entries remain and add
new entries for additional security.

At Client Side
Add the following web address into the Web browser to view and download ftp files
hosted at server system.

ftp://192.168.1.3/

This is a Screenshot of the ftp files hosted at the server system

It contains all the rpm packages needed for various services. Even the location
/www/var/pub is default location for YUM conf.
BIBLOGRAPHY
Following Web Sites
For DNS

http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch18_:_Configuring_
DNS

For Web Server


http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch20_:_The_Apache
_Web_Server

For Mail Server


http://www.howtoforge.com/squirrelmail-configuration-easy-steps-squirrelmail-sendmail-
apache-redhat-centos-fedora

For DHCP
http://kb.iu.edu/data/adov.html
http://www.linuxselfhelp.com/quick/dhcp.html

For FTP

http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch15_:_Linux_FTP_
Server_Setup
http://en.wikipedia.org/wiki/Mail_user_agent
http://en.wikipedia.org/wiki/Mail_delivery_agent
http://searchsoa.techtarget.com/definition/mail-server

Following Books
1. Red Hat Enterprise Linux Essentials (RH033)

2. Red Hat Enterprise Linux Essentials (RH133)

3. Red Hat Enterprise Linux Essentials (RH253)


The Most Important Priyanka Mam’s Notes and all my practical configuration of these
services.

Vous aimerez peut-être aussi