Transcript redhat

CHAPTER - 1
LINUX (LIH-NUCKS)
Official OS
(Red Hat Enterprises Linux)
Free OS
( Red Hat 9, Fedora)
INTRODUCTION TO LINUX
• Linux is quite possibly the most important free
software achievement.
• It has been developed into an operating system
for business, education and personal
productivity.
• Linux (pronounced with a short I, as in LIHnucks) is a UNIX operating system clone.
History of Linux
• UNIX is one of the most popular operating systems
worldwide because of its large support base and
distribution.
• It was originally developed at AT&T as a multitasking
operating system for minicomputers and mainframes in
the 1970’s, but has since grown to become one of the
most widely used operating systems.
• Linux is a free version of UNIX developed by LINUS
TORVALDS at the university of Helsinki in Finland.
About Linux
• Linus Torvalds originally developed Linux as a
hobby project.
• Minix, a small UNIX system developed by
Andy Tanenbaum, inspired it
• The Linux kernel uses no code from AT&T or
any other proprietary source.
• On October 5, 1991, Linus announced the first
“official” version of Linux ,which was version
0.02.
Famous Linux Distributions
•
•
•
•
•
•
Red Hat Linux
SuSe Linux
Caldera Linux
Mandrake Linux
Open Linux
Aryabhat Linux
Why Linux?
• Linux is a UNIX like operating systems
• Multi-user, Multi-tasking and Multi Processor
Support
• There are no royalty or license fees
“ A Linux Distribution has thousands of
dollars worth of software for no cost or a
couple of dollars if purchased on CD/DVD “
• Software Development Supports
• Linux runs on nearly any CPU
• Linux works very well as a personal computer
UNIX for the desktop
• Linux works well for server operations
• X-Window system (An excellent window system
called X)
Hardware Requirement
CPU:
Minimum
: Pentium-class
Recommended : 200 Mhz Pentium-class or better
Hard Disk Space:
Minimum
: 650 MB
Recommended : 2.5 GB
Full Installation : 4.5 GB
* Additional Space will be required for file storage.
Memory:
Minimum for text-mode : 64MB
Minimum for graphical : 128MB
Recommended for graphical: 192MB
CHAPTER - 2
Getting Started
•
•
•
•
The structure of a Linux System
Kernel & Shell
Login and Logout
Basic Linux Commands
The Structure of Linux system
User
Shell
(Application Programs )
Kernel
hardware devices
Fig - I
Fig - II
• Hardware Devices :
The lower most layer is the hardware components
(i.e. physical components like your motherboard, hard disk drive,
floppy drive, memory, etc…)
• Kernel :
When your system is booted, the Linux kernel will
be loaded into the memory of your system and after that the
kernel will control the entire operating system.
• Shell :
Shell is an interpreter through which a user can
interact with kernel.
Shell is program or command.
An application program may be a image editor,
word processor, music player, Games, and etc…..
Basic Commands
• ls
Listing the file and directory
syn:
# ls <options> <Destination directory>
example: # ls –l
• man
Help
example: # man ls
• pwd
Present working directory
# pwd
• mkdir
Creating Directory
# mkdir murali
• cd
Changing the directory
# cd murali
To Create a file
•
There are four type file creation
1.
2.
3.
4.
Cat
Touch
Vi editor
Gedit
Cat Command
it’s used to one of the file creation and right now give some content.
• To Create a file
# cat >murali
welcome to
accel it academy
^D
• To add a Content
# cat >>murali
Vadapalani
^D
• To view the content in a file
# cat murali
welcome to
Accel it academy
Vadapalani
#
Touch Command
• it’s used to Empty file creation.
# touch murali
#
Gedit Command
• It’s file create and modify in X Windows
Terminal
#gedit
or
# gedit <filename>
# gedit murali
Vi editor
•
•
•
This type of file create and modify in CUI and
GUI terminal mode.
It’s a editing tool.
We can worked on three modes
1.
2.
3.
ESC mode
Insert mode
Command mode
Syntax : # vi <Filename>
Example : # vi murali
•
•
•
•
•
•
•
•
•
•
Esc a – Curser move the next position switch to insert mode.
Esc i – Curser move to the beginning of the line and switch to insert mode.
Esc A – Curser move to the end of the line and switch to insert mode.
Esc o – Insert the new line below the curser position and switch to insert mode.
Esc O – Insert the new line above the curser position and switch to insert mode.
Esc r – Replace the single character.
Esc R – Replace the enter line after the curser position
Esc s – Deleted current character and switch to insert mode.
Esc S – Deleted the enter line
Esc x – To delete a character.
Esc k
Esc h
Esc l
Esc g
• Esc gg – Move the curser to beginning of the first line.
• Esc GG – Move the curser to the beginning of the lost line.
• Esc w – Move the curser to beginning of the next word.
•
•
•
•
•
•
•
•
•
•
•
•
•
Esc d – Move the curser to the beginning of previous word.
Esc dd – Delete the current line’s.
Esc dw –delete the current word’s.
Esc yy – Copy the current line.
Esc yw – Copy the current word.
Esc p – Paste the line and words.
Esc u –Undo.
Esc + Ctr + r – Redo.
Esc : set nu – To display enter line with numbering.
Esc : q – Quite without save file.
Esc : q! – Force quite without save file.
Esc : wq – To save and Quit.
Esc : wq! – To force save and quit.
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
rmdir
rm –r
rm
type cat
file murali
wc
- To remove the directory
- To remove the directory
- To remove the file.
- To find out the location of the command
- To view the type of file
- To view the no, of lines (l) , no, of word (w), no, of characters (c) in
file
mv
- To move the file
cp
- To copy the file and directory
head - 10 murali – To view the top 10 lines in a file
tail – 10 murali - To view the bottom 10 lines in a file
sort murali - To saw the order wise in a file ( numerical(-n) and reverse (-r)
grep
-To search for the string
aspell –c murali – To check the correct content in a file
hostname murali – To change the hostname in murali
exit
-To logout M/C
logout
- To logout M/C
clear
- To clear the screen
• who
- who logged in to our system currently
• whoami
- To show the current user
• tty
- To show the current terminals
• echo
- To display the typed message
• wall
- To send the broadcast message
• Write
- To send the message in particular user
• date
- To show the date and time
• cal
- To show the calendar
• bc
- Calculator
CHAPTER - 3
Installation of REDHAT Linux
“ Do Lab “
Better
CHAPTER - 4
The X-Window System
• The heart of Red Hat Linux is the kernel , for
many users, the face of the operating system is
the graphical environment provided by the X
Windows System, also called X.
“ Do Lab “
CHAPTER - 5
Linux Boot Process & Run
Level
•
POST : (Power on self test )
If will test what are commanded connected to the mother board and
they are properly working or not.
•
BSL : (Boot Strap Loader )
If will search the correct position and the booting file in the
secondary storage device, normally it’ll search the MBR.
•
MBR : (Master Boot Record )
The Information about the boot loader.
•
Boot Loader :
1.
2.
GRUB – Grant unified boot loader (default install in Linux)
LILO - Linux Loader
GRUB file path “ /etc/grub.conf ”
LILO file Path “ /etc/lilo.conf ”
RUN LEVEL
•
•
•
•
•
•
•
•
Init 0 – Halt
Init 1 – Single-user mode
Init 2 – Multi-user without Networking (user-definable)
Init 3 – Full multi-user mode (CUI)
Init 4 – Not used (use-definable)
Init 5 – Full multi-user mode (with an x-based screen or GUI )
Init 6 – Reboot
To show the current run level
# runlevel
• To change the run level
# vi /etc/inittab
id:3:initdefault
CHAPTER - 6
Linux File System Structure
• The /dev Directory :
The directory contains file system entries which represent device
that are attached to the system.
• The /etc Directory :
The directory is reserved for configuration file that are local to your
machine.
• The /lib Directory :
The directory should contain only those libraries that are needed to
execute the binaries in /bin and /sbin.
• The /dev Directory :
The directory refers to temporarily mounted file systems, such as
CD-ROMs and floppy disks.
• The /opt Directory :
The directory provides an area for usually large, static application
software package to be stored.
• The /proc Directory :
The directory contains special “ file” that either extract
information from or send information to the kernel.
• The /sbin Directory :
The directory is for executables used only by the root user.
• The /bin Directory :
The directory is for executables used only by the users.
• The /usr Directory :
The directory is for files that can be shared across a whole site.
• The /var Directory :
The directory “ … variable data files. This include spool
directory and file, administrative and logging data, and transient and temporary
files”.
• The /root Directory :
This is home directory for the administrator.
• The /home Directory :
The directory have the home directory for the user’s.
• The /boot Directory :
The directory have the kernel and booting files.
• The /tmp Directory :
The directory only temporarily files stores.
• The /lost + found Directory :
The directory used by function to placed the files.
Examples : linking files.
Files Permission
• To change the permission to file and directory’s
-/- - -/- - - /- - -
Types of the Files
•-
Regular file
• d
Directory
• b
Block device
• l
Linking files
• c
Character files
Default permission in file and
directory
• File
- / r w -/r - - /r - • Directory
d / r w x /r – x /r – x
File permission can be assign two
ways
• Symbolic method.
• Numeric 0r Absolute method.
Symbolic Method
•
•
•
•
•
•
•
+
=
U
G
O
a
To add a Permission
To remove a permission
To assign permission to equal
User or Owner
Group
Other’s or Public
All (user, group, and other’s)
Examples
• To create a file
# touch murali
# ls –l
-/ r w - / r - - /r - • To change the permission
Ex 1: # chmod < Permission> <file or directory>
# chmod g+wx murali
-/ r w -/r w x /r - Ex 2: # chmod a=rw murali
- / r w - /r w - /r w –
Numeric or Absolute Method
• Permission can be assigned using numeric word.
Examples
• Syntax :
#chmod <permission> <File or Directory >
# chmod U G O file or dir
• Example:
#chmod 742 murali
d/ r w x / r - - /- w # chmod 312 murali
- / - w x /- - x / - w –
“ Do Practice”
Advance or Special Permission
• This file permission assign to a execute file.
( Directory)
Setuid = 4
Setgid = 2
Stickybit = 1
• To assign execute permission user, group, and
others means.
Setuid – Set user identify – s
Setgid – Set group identify – s
Stickybit – Other identify – t
• Can ‘t to assign execute permission user, group,
and others means.
Setuid – Set user identify – S
Setgid – Set group identify – S
Stickybit – Other identify – T
Examples
- / - - S or s /- - S or s /- - T or T
Identify
• Syntax :
#chmod <permission> <File or Directory >
# chmod ID U G O file or dir
To assign the user, group, and others
• Example:
#chmod 5742 murali
d/ r w s / r - - /- w T
# chmod 7241 murali
- / - w S /r - S / - - t
“ Do Practice”
File Compressing
• To compressing the files.
* gzip :
It’s Compressing Linux and Unix based files. It can compress up to 75% of
the current files. The Compressed file will be in “.gz” format. Ex:
Ex: “murali.gz”
1. To Compress the file:
Syntax : # gzip <Filename>
Example : # gzip murali
2 To Unzipped the File:
Example : # gunzip murali.gz
3 To View the content in a gzip file :
Example : zcat murali.gz
* bzip2 :
It’s Compressing Small based files. It can compress up to 65% of
the current files. The Compressed file will be in “.bz2” format. Ex:
Ex: “murali.bz2”
1. To Compress the file:
Syntax : # bzip2 <Filename>
Example : # bzip2 murali
2 To Unzipped the File:
Example : # bunzip2 murali.bz2
3 To View the content in a bzip file :
Example : bzcat murali.bz2
CHAPTER - 7
USERS & GROUPS
USERS Administration
• Linux we can create up to 65535 users.
• Each user will be assign the unique id starting from 0 to
65535.
• User id from 0 to 99 is assigned for build user.
• We can assign the user id from 100 to 65535.
• By default system will assign the user id starting from 500.
User Account Database
Simple Creation in Terminal
•
Syntax
: # useradd <username> or
# adduser <username>
• Example:
# useradd murali
by default system create:
Home directory : /murali
User ID
: 500
Group ID
: 500
Shell
: /bin/sh
Manual Creation in Terminal
• Syntax
: # useradd <options> <username> or
# adduser <options> <username>
• Example:
# useradd -u 100 –s /bin/bash murali
• Options :
-u – To set the user ID.
-g – To set the group ID.
-G – To set the secondary group ID.
-c – Commands.
-s – To specify the shell (ksh, bash, and t-csh or csh).
ksh
Korn shell
bash
Bourne again shell
c-sh
Turbo compiler shell
• To modify the user accounts:
# usermod –u 200 –s /bin/bash murali
to change the user ID (200) and shell (bash) in murali user.
• To deleting an user’s:
# userdel murali (to delete a without home directory)
# userdel –r murali (to delete a with home directory)
• To set password the user:
#passwd murali
New password : *****
Retype password: *****
• To set without password the user:
# passwd –d murali (-d means without password).
Group Administration in Terminal
• A group contain similar type of user as it members.
( Collection of users called as group)
• The Group Add :
Syntax : #groupadd [-g GID ] group name
Example : #groupadd –g 100 Linux-Admin
• The Group Modify:
Syntax : # groupmod [ -g new gid ] [ -n new name] group name
Example : #groupmod –g 109 –n mail-Admin Linux-Admin
• The Delete a Group:
Example : #groupdel Linux-Admin
Graphical Mode (User & Group)
CHAPTER - 8
Disk Administration
Devices
• Devices are either block devices or character devices.
• A Character device is one from which you can read a sequence
of character. Example: Keyboard.
• A block device is one that stores data and offers access to all
parts equally, It’s also referred as random access devices.
Example : Hard disk.
• /dev/hda - IDE Hard disk – Primary Master.
• /dev/hdb - IDE Hard disk – Primary Slave.
• /dev/hdc - IDE Hard disk – Secondary Master.
• /dev/hdd - IDE Hard disk – Secondary Slave.
• /dev/sda - First SCSI Hard disk.
• /dev/sdb - Second SCSI Hard disk.
• /dev/fd0 - Floppy Disk Drive.
• /dev/cdrom - Cdrom Drive – Linked to corresponding hard disk
device file according to the configuration.
• /dev/hda1 - First partition in the primary master IDE hard disk
drive .
• /dev/hda2 - Second partition in the primary master IDE hard disk
drive .
• /dev/sda1 - First partition in the first SCSI hard disk drive.
• Mount
- For accessing a block device you have to mount it in
the different devices. The location you are mounting
the device is called the mounting point.
# mount <device path> <mounting point>
# mount /dev/cdrom /root/murali
• Umount
- Is used to unmount a mount file systems.
# umount /root/cdrom
• The /etc/mtab file :
The file contains the information about the currently mounted
file systems. This file will automatically updated when you are mounting or
unmounting partitions.
• The /etc/fstab file :
Is a text file which contain the information of the file system.
This file reads during the system startup and the file specified in it will get mounted
automatically.
• Creating New File systems :
After formatting a block device like floppy you have to make
file system on the floppy .
Syntax : # mkfs –t fstype device name
Example : #mkfs –t ext2 /dev/fd0
File system:
Ext2 --- Extended 2
Ext3 --- Extended 3
Disk partition Steps :
•
To show the partition:
# fdisk –l
•
To create a partition:
Example : Secondary IDE hard disk means ( /dev/hdb )
#fdisk /dev/hdb
command (m for help) : m
command (m for help) : n
command action
l logical (5 or over)
p Primary (1 – 4 )
press l
First Cylinder (400 – 2437, default 400) : 400
last cylinder or +size or +sizeM or +sizeK (400-2437, default 2437) : 500
command (m for help) : w
•
Reboot your machine:
# reboot
•
Create a file system:
Example : /dev/hdb8
# mkfs –t ext3 /dev/hdb8
•
To mount the partition:
# mount /dev/hdb8 /murali
CHAPTER - 9
RPMS
Red Hat Package Management Services
RPM (Red Hat Package Manager)
•
•
•
Package is a collection of software or application. That can be
installed or update or deleted for Linux operating system.
First Mount the CDROM
# mount /dev/cdrom /murali
#cd /murali
#ls - l
1.
2.
3.
4.
5.
Install
Update
Refresh or Reinstall
Delete
Query
• Query :
To check the package. (install or not)
Syntax : # rpm –qa package name
Example: # rpm –qa telnet*
• Install :
To Install the package.
Syntax : #rpm –ivh <FQPN> (full qualify package name)
Example : #rpm –ivh telnet -2.0-3.02
• Update :
# rpm –Uvh <FQPN)
• Refresh :
# rpm –F <FQPN)
• Delete or Remove :
#rpm –e telnet-2.0-3.02
CHAPTER - 10
Automated Tasks
•
In Linux, task can be configured to run
automatically with in a specified period of
time, on a specified date.
1. at
2. cron
at :
To schedule a one-time job at specific time.
Syntax : # at HH:MM format
Example: # at 10:30 pm
at> power off
Ctrl + d
Cron :
Cron is a daemon that can be used to schedule the execution of recurring task
according to a combination of the time, day of the month, month, day of the
week, and week. “ /etc/crontab ”
( * means – Everyday)
Syntax : #crontab filename
Example : # crontab backup
steps :
#cat >>backup
min
hrs
day month week
(0-59)
(0-23) (1-31) (1-12)
(0-6)
45
11
*
*
*
# crontab –l (–l means List the schedule)
command
power off
CHAPTER - 11
DNS
Domain name Service
or
Berkely Internet Name Domain (BIND)
• An IP address helps a computer system to
identify itself in a network.
• Referring hosts by their IP address is convenient
for computers, but humans have an easier time
working with names.
• There are two types of zones.
Forwards zone (.zone)
Reverse zone (.local)
Lab Steps
1. To check the package
# rpm –qa bind* (package name=bind)
2. To config the hosts
# vi /etc/hosts
10.0.0.9
murali.king.com
# vi /etc/sysconfig/network
NETWORK=yes
HOSTNAME=murali
3. To assign the IP address
# setup or netconfig or neat
4. To create a zones:
# cd /var/named
#cp named.local murali.local
#cp localhost.zone murali.zone
murali
5. To config the zone files:
# vi /var/named/murali.zone
$TTL 86400
@
1D IN SOA
42
3H
15M
1W
1D )
murali
www
murali.king.com murali.king.com (
; serial (d. adams)
; refresh
; retry
; expiry
; minimum
1D IN NS
murali.king.com
1D IN A
10.0.0.9
1D IN CNAME
6. To config the zone files:
# vi /var/named/murali.local
$TTL 86400
@
IN
SOA
IN
9
IN
NS
PTR
murali.king.com. murali.king.com. (
1997022700 ; Serial
28800
; Refresh
14400
; Retry
3600000 ; Expire
86400 ) ; Minimum
murali.king.com.
murali.king.com.
7. To config the service :
# vi /etc/named.conf
include "/etc/rndc.key";
zone"king.com" IN {
type master;
file "murali.zone";
allow-update { none; };
};
zone "0.0.127.in-addr.arpa" IN {
type master;
file "murali.local";
allow-update { none; };
};
• To update the service
# service named restart
# service network restart
• To check the result in client side or server side:
# nslookup 10.0.0.9
# nslookup murali.king.com
#nslookup www.king.com
CHAPTER - 12
DHCP
(Dynamic Host Configuration Protocol )
DHCP
• DHCP is network protocol for automatically assigning TCP / IP
information to client machines.
• Port number : server = 547
client = 546
• Package name : dhcpd
• Daemon name : dhcpd
• Configure file : “ /etc/dhcpd.conf “
• By Default lease duration
8 day’s Minimum
999 day’s Maximum
DHCP lease (or) DORA Process
DHCP
Client
D
O
R
A
DHCP
Server
Discover
Offer
Request
Acknowledgement
LAB Steps :
(server side)
• TO Check the Package
# rpm –qa dhcp*
• TO Config the service file :
# vi /etc/dhcpd.conf
ddns-update-style none;
subnet 10.0.0.0 netmask 255.0.0.0
{
range 10.0.0.1 10.0.0.100;
}
• To update the services
# service dhcpd restart
Lab step ( Client side)
• Linux M/C:
# netconfig
select : yes
select : dynamic automatic [DHCP]
#service network restart
• Windows M/C:
go to network then select obtain an IP address
automatic
set the dns master IP address means dhcp server
IP address.
CHAPTER - 13
Network Services
Telnet & FTP
Telnet
•
•
•
•
•
•
Terminal emulation Network.
It’s used to remote login to a telnet server.
It’s based on CUI
Package name : telnet-server
Port Number : 23
ssh: Secure Shell it’s used to login as a root ,
login as a another machine.
Lab Steps :
•
1.
Server side :
To check the package
# rpm –qa telnet-server*
2. To config the service file
# vi /etc/xinetd.d/telnet
--------------Disable : yes ( u are change the “no” )
#vi /etc/xinetd.d/rlogin
--------------Disable : yes ( u are change the “no” )
3. To update Service # service xinetd restart
•
Client side :
#telnet 10.0.0.9 (server IP address)-----only client login
or
#rlogin 10.0.0.9
#ssh 10.0.0.9 ------only root login
FTP (File Transfer Protocol )
• FTP is used for transforming file between different machines ,
also S/W different Platform.
• Port Number : 20, 21
• Package Name : vsftpd (very secure file transfer protocol ).
• Daemon Name : vsftpd
• Configuration file :
“ /etc/vsftpd/vsftpd.conf “ (main config file)
“ /etc/vsftpd.ftpuserd ” (to deny access user’s)
“ /etc/vsftpd.user-list “ (to allow the user’s)
“ /var/log/vsftpd.log “ (to logs regarding ftp )
Lab Steps
•
Server Side :
1.
To check the Package:
# rpm –qa vsftpd*
2. To enable the service
# service vsftpd restart
•
Client Side:
1. To any (Operating System ) Platform :
#ftp 10.0.0.9
user name : murali
password : *****
ftp> get murali
ftp>put shankar
ftp>bye
#
* get ---------- Get the file [ Ex: ftp>get <filename>]
* put---------- Put the file [Ex: ftp>put<filename>]
CHAPTER - 14
Firewall with IP tables
• The Linux kernel contains advanced tools for packet filtering, the process of
controlling network packets as they attempt to enter, move through, and exit
your system.
• Structure:
#iptables [-t <table-name>] <command> <chain-name> <parameter-1>
<option -1> <parameter –n> <option –n>
• Commands :
-A – Append the iptables rule to end of the specified chain.
-D – Deletes a rule in a particular chain by number in a chain.
• INPUT:
All incoming package are checked against rules in the change.
• OUTPUT:
All outgoing package are checked against rules in the change.
• Packet Paten :
-s – All the packet are checked for a specific source IP.
• Block :
-j – The Packet’s is drop , no massage send to the requesting computer.
• Reject :
The Packet’s drop, an error massage send to the requesting computer.
Lab Steps
• To set Firewall :
# iptables –A INPUT –s 10.0.0.18 –j DROP
• To delete the Firewall :
# iptables –A OUTPUT –s 10.0.0.18 –j DROP
• To set the total down the network in server:
# ifconfig eth0 down
• To set the total up the network in server :
# ifconfig eth0 up
CHAPTER - 15
NFS
( Network File System )
NFS
• Introduced by SUN Microsystems, to share the files
and binary between UNIX done operating system.
• It needs three protocols :
rpc.portmapper
rpc.nfsd
rpc.mountd
• In NFS we have to export the mount point to be
shared and it will be mounted on a client machine.
Lab Steps
•
Source Machine : (10.0.0.9)
1.
2.
3.
4.
5.
•
To check the package
# rpm –qa nfs*
To create a directory
# mkdir /home/murali
To access the all user’s in directory
# chmod 777 /home/murali
To Share the directory
# vi /etc/exports
/home/murali *(rw,sync)
To update the service
# service nfs restart
Destinations Machine :
1.
2.
3.
To create a directory
# mkdir /root/shankar
To mount the sharing directory
# mount –t nfs 10.0.0.9:/home/murali /root/shankar
To show the sharing directory
# cd /root/shankar
# ls –l
CHAPTER - 16
SAMBA
• With samba you can share a Linux file system
with windows 95, 98, 2000 or NT.
• You can share a windows 95, 98, or NT FAT file
system with Linux.
• You can also share printers connected to either
Linux or windows 95, 98, 2000, or NT.
• The samba suite of SMB protocol utilities
consists components.
• The smb daemon provides the file and print
service to smb clients.
Lab Steps
•
Linux Machines :
1.
2.
3.
4.
5.
6.
To check the package
# rpm –qa samba*
To create a directory
#mkdir /opt/murali
# chmod 777 /opt/murali
To share the directory
# vi /etc/exports
/opt/murali *(rw,sync)
To config the service file
#vi /etc/samba/smb.conf
(go to last line entry the contented )
[murali]
path = /opt/murali
valid users = murali, shankar
writable = yes
#
To set the samba password
#smbpasswd –a murali
To enable the service
# service nfs restart
#service smb restart
Windows Base
Right click the My Network Places
Select search for computer
Type the Linux (samba) IP address
Select & Login
CHAPTER - 17
APACHE
Apache Web Server
• The name Apache appeared during the early
development of the software because it was
“ a-patchy” server.
• Port Number : 80
• Package Name : httpd
• Daemon Name : httpd
• To Configuration File
“ /etc/httpd/conf/httpd.conf “
Lab Steps
• To check the package
# rpm –qa httpd*
• To config the service file
# vi /etc/httpd/conf/httpd.conf
1032 line: servername murali.king.com.
• To Create or Put in html file
# cd /var /www/html
# vi index.html (don’t change the html name)
<html>
<head> <title> test </title>
•
To update the service
# service httpd restart
• To open Mozila in Linux m/c or internet explore in windows base
type : www.king.com or IP address
CHAPTER - 18
SENDMAIL
Send mail
• It’s used to mail purpose.
Lab Steps:
1. To Check the package
# rpm –qa sendmail*
2. To modify the access file
# vi /etc/mail/access
murali.king.com
local host
127.0.0.1
10.0.0.9
RELAY
RELAY
RELAY
RELAY
3. To config the service file
# cd /etc/mail
#vi sendmail.mc
line 123 : Local _Domain (‘ murali.king.com’)
4. To change
# m4 sendmail.mc> /etc/sendmail.cf
5. To check
# pgrep –l sendmail
6. To config the xinetd file
#cd /etc/xinetd.d
# vi imaps
Disables = yes (u are change ‘ no ‘)
#vi imap
Disables = yes (u are change ‘ no ‘)
# vi ipop2 and ipop2 and ipops3
Disables = yes (u are change ‘ no ‘)
7. To update the service
# service sendmail restart
# service xinted restart
Result :
1. To send the mail to murali
# mail murali ( murali mean user)
u are enter the some one test
2. To check the mail so login to murali user
# mail
CHAPTER - 19
NIS
(Net Work Information System)
• The Network Information service (NIS) is a
simple, generic client/server database system.
• The most common use for it is sharing
password and group files across a network.
• NIS, developed by SUN Microsystems as part it
its SunOS operating system.
Lab Steps Server Side
• To Check the Package
# rpm –qa yp*
• If must DNS
• To assign domainname
# domainname king.com
• To create the NIS
# /usr/lib/yp/ypinit –m
------------------------ctrl+d
press : y
• To Config the nsswitch file
# vi /etc/nsswitch.conf
line 33 passwd: file nis
34 shadow: file nis
35 group : file nis
38 host: file nis dns
•
To update the service
# service ypbind restart
# service ypserv restart
2. Client Side :
•
To set the domain name
# domainname king.com
•
To set the NIS domainname
# vi /etc/sysconfig/network
NETWORK = yes
HOSTNAME = murali
NISDOMAIN = king.com
•
To edit the /etc/yp.conf file
# vi /etc/yp.conf
domain king.com server murali
•
To config the ‘ /etc/nsswitch.conf ‘ file
# vi /etc/nsswitch.conf
line 33 passwd: file nis
34 shadow: file nis
35 group : file nis
38 host: file nis dns
•
To enable the service
# service ypserv start
# service ypbind start
•
# authconfig
to set the NIS domain