interview question and answer

January 11, 2012

How to configure linux sendmail server step by step guide Example and Implementation

How to configure linux sendmail server step by step 
In a company environment, email is an essential component to the work day. Email is used to communicate with both internal employees and external customers. In exam you will be tested to configure the send mail server for you local LAN.
By default sendmail server allows to connect to local host only. So we should edit the /etc/mail/sendmail.mc file to allow connect to other hosts.
The sendmail daemon is configured from a directory of files in /etc/mail and a directory of configuration files in/usr/share/sendmail-cf. There are two basic configuration files:
  • sendmail.cf The main sendmail configuration file.
  • sendmail.mc A macro that's easier to edit, which can be used to generate a new sendmail.cf file.
For this example we are using two systems one linux server one linux clients. These are the pre quest for a sendmailserver
  • A linux server with ip address 192.168.0.254 and hostname Server
  • A linux client with ip address 192.168.0.1 and hostname Client1
  • A Configured DNS server on Linux server
  • Updated /etc/hosts file on both linux system
  • Running portmap and xinetd services
  • Firewall should be off on server
We have configured all these steps in our pervious article.
We suggest you to review that article and configure DNS server before start configuration of sendmail server. Once you have completed the necessary steps follow this guide.

Configure sendmail server

sendmail and m4 rpm are required to configure sendmail server check them for install if not found install them.
sendmail rpm
Mail server program reads the /etc/mail/sendmail.cf. To change the configuration on mail server, we should edit the/etc/mail/sendmail.mc file. When Sendmail is started or restarted with the service sendmail restart command a new sendmail.cf file is automatically generated if sendmail.mc has been modified. In exam you should generate it with m4 command.
open /etc/mail/sendmail.mc for editing
vi /etc/mail/sendmail.conf
show hidden line with : set nu option on vi command mode
By default, the following line limits sendmail access to connect local host only [line no 116] 
sendmail.mc
You can allow other computers to use your sendmail server by commenting out this line.
In the sendmail.mc file , lines that begin with dnl, which stands for delete to new line, are considered comments. Some lines end with dnl, but lines ending in dnl are not comments
comment this line with dnl keyword followed by # sign
sendmail.mc
save this file with :wq and exit.
Now generate new sendmail.cf file by using m4 command as shown here
m4
Now restart sendmail service and also set it on with chkconfig
service sendmail restart
if sendmail service restart without any error means you have configured sendmailsuccessfully.

Configure sendmail client side

We are using another linux system to test sendmail server. All configuration are same as you have done on server system.
Check sendmail and m4 rpm for install. Open /etc/mail/sendmail.mc file and locate line no 116 and put a dnlwith sing and save file. All step are same which you have done on server.
Now generate new sendmail.cf file by using m4 command as shown here
m4
Now restart sendmail service and also set it on with chkconfig
service sendmail restart

Testing of sendmail server

We will test sendmail server by sending and receiving mail in lab environment. for this we use two user one on each system.
Now create one user on each system vinita on server
useradd
and nikita on client system
useradd
Now send mail from user vinita to nikita and from nikita to user vinita and also check each others mail by mail command

Use full user name to send mail. For example to send mail to nikita use nikita@client1 and tosend mail to vinita use vinita@server.example.com

January 10, 2012

How to configure linux yum server step by step guide Example and Implementation

How to configure linux yum server step by step guide Example and Implementation
YUM stands for Yellow dog Updater, Modified because it is based on YUP, the Yellow dog Updater. Yellow Dog is a version of Linux for the Power Architecture hardware. YUP, and later YUM, were written by the Linux community as a way to maintain an RPM-based system.

Advantages of YUM

Automatic resolution of software dependencies. If a package installation or upgrade request is made and requires the installation or upgrade of additional packages, YUM can list these dependencies and prompt the user to install orupgrade them.
Command-line and graphical versionsThe command-line version can be run on a system with a minimal numberof software packages. The graphical versions offer ease-of-use and a user-friendly graphical interface to software management.
Multiple software locations at one time. YUM can be configured to look for software packages in more than one location at a time.
Ability to specify particular software versions or architectures. Software locations accessible by YUM can contain multiple versions of the same RPM package and different builds for different architectures such as one for i686 and one for x86_64. yum can easily check the appropriate version and download it.
While it's unlikely that you'll have an Internet connection during the exam, you could have a network connection to a local repository. So you should be ready to use the yum command during the Red Hat exam.

How to create dump of RHEL CD

Whether you perform network installation or create yum repository file you need dump of RHEL CD. It is generally created on server in RHCE exam. Candidate is given a location of this dump to perform network installation. We will create dump of RHEL CD on /var/ftp/pub and use this for network installation or to create yum repository files.
Check how many space is available on /var partition mimimun 4 GB space is required
var
Now mount RHEL dvd on mnt and copy entire disk on /var/ftp/pub
Dump is created on /var/ftp/pub now you can umount RHEL dvd

Configure yum server

RHCE EXAM QUESTION
Backup of the Redhat Enterprise Linux 5 is taken in /var/ftp/pub on server named Server.example.com. You can install all required packages using yum by creating the repository file.
Pre quest of yum server
we assume that you have completed these pre quest of yum server
  • A Linux system with hostname Server.example.com and with ip address of 192.168.0.254
  • Dump of RHEL disk on /var/ftp/pub location
Once you have completed these pre quests follow this guide.
change directory to /var/ftp/pub/Server
cd Server
yum and createrepo rpm are required for yum server install them
install yum rpm
Now install createrepo rpm
creatrepo
After installing necessary package change directory to /var/ftp/pub
cd pub
Now create repository of Server directory
create repo
repository of all rpm will be created in few minute
create respo
Now create repository for VT
createrepo VT
In few second all necessary repository will be created for VT
createrepo
Now create errata directory and repository for it
errata
During the process of creating repository two hidden directory with named .olddata is created automatically remove them
rm olddata
Now check hostname and change directory to /etc/yum.repos.d. copy sample repository file to the file with hostname And open it
cp repo
Default repository file look like these
vi respo

Remove defaults line and set new location of Sever and VT as shown here
repos
Save file with :wq and exit
Now remove all temporary data file with yum clean all command
yum clean all
Congratulation You have successful create yum server
To test yum server remove telnet package
yum remove telnet
After checking all dependences it will ask for conformation press y
yum remove telnet
Now install telnet package from yum server
yum install telnet
After checking all dependences it will ask for conformation press y
yum install telnet

January 9, 2012

How to Install Linux via ftp or nfs server step by step guide example and implementation

Install Linux via ftp or nfs server step by step guide example and implementation
During the first phase of RHCE exam you are asked to install Linux via nfs or ftp or apache server. you will be provided aLinux boot disk and IP address and necessary directory name for installation. You need not to prepare server side on exam but here in this article we will configure both server and client side . In this practical we will show you How to prepare nfs or ftp server for network installation and further we will installation linux via nfs as well as ftp server. We will take apache server in our next article.

RHCE Exam Questions

Install the Redhat Linux RHEL 5 through NFS. Where your Server is server.example.com having IP 192.168.0.254 and shared /var/ftp/pub. The size of the partitions are listed below:

/     -  1048
/home -  1028
/boot -  512
/var  -  1028
/usr  -  2048
swap  2X256 (RAM SIZE)
There is a NFS server 192.168.0.254 and all required packages are dumped in /var/ftp/pub of that server and the /var/ftp/pub directory is shared. Install the Redhat Enterprise Linux 5 .
There is a FTP server 192.168.0.254 and all required packages are dumped in /var/ftp/pub of that server and anonymous login is enabled. Install the Redhat Enterprise Linux 5.

prepare Linux server for network installation

For this practical we need two systems one linux server and one client system. These pre quests should be completed on Linux server.
  • Dump of RHEL disk must be taken on /var/ftp/pub. For help check our pervious article.
    How to create dump of RHEL CD
  • Linux server should be configured with hostname Server.example.com and IP address 192.168.0.254
  • DHCP, FTP, NFS server should be configured and dhcpd, nfs, vftpd services must be running. If you feel difficulties in configuration of dhcp, ftp and nfs server then check our articles
Once you have completed these pre quests remaining configuration is very easy. Follow this guide.

Prepare FTP server for network installation

By default pub directory is shared with anonymous user account login enable in ftp server. So you need no additionalconfiguration just create dump and restart the services.
create dump of RHEL disk to /var/ftp/pub and restart vsftpd service

Prepare NFS server for network installation

As dump is already taken on /var/ftp/pub so sharing of /var/ftp/pub directory will do the task.
open /etc/exportfs with vi editor
vi exportfs
Share /var/ftp/pub for our network
editing in exportfs
Now restart nfs service
service nfs restart
We have prepared both FTP and NFS server for network installation.

Configure Client for network installation via ftp server

Boot system with Linux boot CD, [ disk will be provided by examiner] Give linux askmethodcommand on boot prompt
linux askmethod
Select language to English
Select language to English
Select Keyboard layout to US
Select Keyboard layout to US
Select install method ftp to install via ftp server
install linux via ftp
At this point you can remove Linux boot disk form CDROM as we installing linux from ftp server.
Select Enable IPv4 supports and select dynamic ip configuration [ we have configured dhcp server on linux server so ip will be automatically retrieve ]
ip configuration
Give to ip address of FTP server in ftp site name and pub in directory name
ip address of ftp server
After few second you will retrieve anaconda linux boot loader form server
boot screen retirved from server
Now you can install linux as you have installed it from local CD ROM . All remaining steps are same.

Configure Client for network installation via nfs server

Boot system with Linux boot CD, [ disk will be provided by examiner] Give linux askmethodcommand on boot prompt
linux askmethod
Select language to English
Select language to English
Select Keyboard layout to US
Select Keyboard layout to US
Select install method nfs to install via nfs image
install linux via nfs
At this point you can remove Linux boot disk form CDROM as we installing linux from nfs server.
Select Enable IPv4 supports and select dynamic ip configuration [ we have configured dhcp server on linux server so ip will be automatically retrieve ]
ip configuration
Give to ip address of nfs server in nfs server name and /var/ftp/pub in directory path
ip address of nfs
After few second you will retrieve anaconda linux boot loader form server
boot screen retirved from server
Now you can install linux as you have installed it from local CD ROM . All remaining steps are same.

Two time saving technique

During RHCE exam most concern thing is time. So we suggest to create the partition According to the Question because Size and what-what partition should you create at installation time is specified in your question. Do not create any extra partition to save time because any additional partition will take time in formatting.
Due to the time limit, you should care about the installation packages. At Exam time these packages are enough.
  • X-Window System
  • GNOME Desktop
  • (these two packages are generally not required)
  • Administration Tools.
  • System Tools
  • Windows File Server
  • FTP Servers
  • Mail Servers
  • Web Servers
  • Network Servers
  • Editors
  • Text Based Internet
  • Server Configuration Tools
  • Base
  • Printing Supports