Sie sind auf Seite 1von 69

LAB Setup for LINUX

TASK # 1: Download and Install VMware Workstation (30

mins)
By using this virtualization software, we can create many VMs (CPU+mem+HD) on
which install different Operating systems such as windows or Linux flavors(300+)
Main Objective: We are going to create 2 VMs and then Install CentOS Linux OS later
on those VMs.

You will get the software in Folder - Favorites\Downloads (i.e.,


C:\users\hussain\Downloads)

Double click on the software to begin installation:

OR you can use the below serial keys after 30 days

Serial Key for Workstation 12


5A02H-AU243-TZJ49-GTC7K-3C61N
Download and Installation of VMware workstation software is completed
successfully. If you dont want this one then you can go for Oracle VM
VirtualBox software.

All these software are only to create VM on which you can install OS. This you can
compare like, instead of buying different laptops and installing OS, you are creating
as many laptops as possible in this software. This is virtualization concept.

TASK 1.1: Create a VM by name server1

Now 1st VM got created by name "server1". Suppose this is like your 1 st laptop and
now you have to install Linux OS (CentOS 6).
For any OS installation, you need CD/DVD image or .ISO file image or image on
network to boot.

TASK 1.2: Create a VM by name "server2"


Follow same steps as mentioned in Task# 1.1

TASK # 2: Download Any Linux Flavor OS from internet


TASK 2.1: Download CentOS linux 32-bit OS and after that
select its .iso image to boot

This way, you download centos 32-bit OS software .iso image.


By default, You will get the software in Folder - Favorites\Downloads (i.e.,
C:\users\hussain\Downloads)

Similarly download centos 64-bit OS or Fedora Linux or Ubunto linux or


opensuse,Suse Enterprise linux etc.
Tasks for Suse Enterprise Linux - Try to install Suse Enterpise Linux version11 SP4
and migrate to Version12 SP1
Latest version of Suse Enterprise Linux : https://www.suse.com/download-linux/
For Older versions of Suse Enterpise Linux : https://download.suse.com/index.jsp

Responsibilities:

Installed and configured Red Hat O.S. 5/6 on IBM servers.


Installation and configuration of RHEL5 and 6(Red Hat Enterprise Linux) PXE boot,
Kick start (via NFS, HTTP, and FTP).
Deploy and manage virtual machines. Manage user access to the VMware
infrastructure.
Installing configuring and managing Linux Servers.

Working on user account management by creating, deleting, managing user accounts


and passwords.
Installing Packages according to the requirement.
Managing Red Hat package manager & YUM server.
Good proficiency in Logical Volume Manager (LVM).
Adding disks to volume groups and creating file systems.
Managing File Systems per Database.
Scheduled various regular and periodic tasks by using crontab.
Responsible for setting up NFS server and client, FTP servers, DNS, LVM, Apache,
SAMBA Installation and configuration.
Monitoring system performance of virtual memory, managing swap space, disk
utilization and CPU utilization by using various tools.
Implementing NFS server configurations.
Configuring FTP server to maintaining the shared folders in the Organization.
Configuring Kick Start servers for complete hands-free installation.
File system managing and trouble shooting. Installation, configuration and
maintenance of LVM on RHEL.
Worked with File systems include ext3, ext4, vfat NFS, and VxFS.
Security implementations as setuid, setgid, sticky bit.
Managing IBM servers X3650 M4, X3650 M3, System X3630 M2 and System X3200
M3.
Administration of Red Hat Linux including performance monitoring.
User/Group administration and providing privileges and security implementation.
Installing and partitioning disk drives, creating, mounting and maintaining file
systems to ensure access to system, application and user data.
Installed and configured SAMBA for windows and Linux connectivity.
Configuring distributed file systems and administering NFS server and NFS clients
and editing auto-mounting mapping as per system / user requirements.
Worked and Scheduled Cron jobs.
Experience on performance tuning, adding volumes for automation of tasks, data
movement, Software Configurations.
Setup and maintained DNS, NIS, NFS, NTP, FTP, Auto mount, Send mail, Samba, etc.
Monitors system performance on a daily basis to ensure adequate response times for
production applications.
Monitored trouble ticket queue using Remedy ticketing System to attend user and
system calls.
Providing 24 x 7 supports to various application level server level & network level
Monitoring and troubleshooting of any data center outages.
Involved in development, user acceptance, performance testing, production and
disaster recovery server.

TASK 2.2: Download Ubuntu Linux 32-bit


Homework

TASK # 3: RHCE 6 BASIC INSTALLATION


Minimum and Recommended Requirement to install RHEL 6: (RHEL versions
= CentOS versions)

Hardwa
re
Process
or
Mother
Board
RAM
Hard
Disk

Recomm.
Req.
For RHEL6
32-bit
AMD/Intel
Dual Core

AMD/Intel P 4

Recomm.
Req.
For RHEL6
64-bit
AMD/Intel Core
2 duo

Minimum
req. for
RHEL6 64-bit
AMD/Intel
Dual Core

Normal
1GB

Normal
384-512 MB

VT Enabled
2GB

VT Enabled
768-1GB

20 Gb

15 GB

40 GB

20 Gb

Minimum req.
for
RHEL6 32-bit

Minimum Partition Creation and sizes for Basic installation:


partition
Name
/ (called as
root File
System)
/boot
SWAP

Size for 32bit

Size for 64-bit

8 to 10 GB
200MB
Twice of RAM

15 to 20 GB
200MB
Twice of RAM

Installing RHEL 6 with above specification

Enter into BIOS setting and make CD/DVD Drive as first boot device
Make sure that VT (Virtual Technology) is enabled for RHEL6 64-bit systems
Insert the RHEL 6 CD/DVD into CD/DVD drive and boot the system
If booted from CD/DVD ROM, the installation screen will be displayed

Task 3.1: Installing CentOS6 linux (using standard method) on


VM1
(Installing RHEL7 --> http://www.tecmint.com/redhat-enterprise-linux-7installation/)
In my language,
OS installation is like moving the data from CD/DVD/ISO/Network image to Harddisk
in proper way(in windows they called C-drive and Linux they called / (root file
system)

Select the Linux .iso image via CD/DVD (virtually)

Now click on Power-On button

You will see the below screen 4

Move the cursor to Install or Upgrade an existing system and press


Enter

To test the media select OK, to skip the testing move cursor to Skip and
press Enter

Click on Next button to move forward

Select your desired language, usually English. Click Next to continue

Select the keyboard type as required usually U.S English, click Next to
continue

Select the type of Storage for the computer. Click Next to continue

If the storage device is from VMware then you will get above warning message

Assign a hostname to the system. If you wish to give ip address click on


Configure Network, else click Next to continue

Select the nearest city in your Time Zone and click on Next to continue

Set some password for root, then click on Next to continue

Select the type of partitioning you want, to create your own partitions with
custom sizes, select Create Custom Layout and click on Next to
continue
Note: If you choose default option instead of custom, OS will install
without any options for disk. It used LVM partitioning by default. You can
verify with #df -h command

Click on the Free space, then click on Create to create your own
partitions

Check the box beside Standard Partition, Click on Create to continue

Select /boot from Mount Point Box, give the size 200MB for it and click
on OK to create it

S
e
l
e
c
t

the Free space again and click on Create to create another partition.

Also check the box beside Standard Partition, Click on Create to


continue

Select / from Mount Point Box, give the size you wish for it and click on
OK to create it.

Repeat the above steps in similar fashion and create swap partition (select free
space , click on create. Again select standard partition and then create. Then below

box opens.
This time select swap from File System Type. Give the size required
and click on OK

Finally you will see the partition as above and click on Next to continue with
it.

Click on Format to format the partition and continue with it

Click on Write changes to disk to continue , if wish not to make changes


click on Go Back

Boot Loader is a program

Note: Here you can select Desktop or Basic server or any other type as per
requirement.
In real time, you use the image which will already setup by Engineering Team as per
company environment needs and hence you will not see these options and get only
basic server like OS.
If it is VM, then OS installation is nothing but a deployment from templates. Very
Very easy

When above prompt is displayed, remove the CD/DVD from drive and click on
Reboot.

Follow all the steps as appropriate by clicking on Forward, then you will
get login screen where you enter username and password.

Once you login,if it comes $ sign then it means normal user. If it # (pound) sign
then it means root user.
#uname-a
#cat /etc/*-release
[very important commands]

#arch

#dmidecode|more

Task 3.2: Installing CentOS Linux using LVM Partitioning on


VM2 :

The only difference in a normal installation and LVM installation is that


instead of creating normal partition we will create a VG and then LVs for all
partitions, except /boot and swap.
The advantage of installing Linux using LVM is that, if any of system
partition is running out of space and required more space, in case of normal
partitioning it is not possible to increase the size of a partition once it is
created. But, using LVM the space can be dynamically increased whenever it
is required.
Even if there is no space remaining in the disk some space can be borrowed
from other LVMsand can easily be assigned to required system partition to
fulfill its need.
LVM provides a greater scalability to the administrator and avoid uncertain
downtime to the server.
LVM ensures the possibility of increasing and decreasing the sizes whenever
required and prevents unnecessary loss of time.

Start the installation normally as done previously, but only at the time of
partitioning follow the steps below.

Select the Free space and click on Create, then select LVM Physical
Volume and click Create to proceed.

Give the maximum possible size to this PV, as all the partition has to be
created inside it only.

Select the created PV, i.e., sda1 and then click on create

This time check the box beside LVM Volume Group to create a volume
group, click on to create a VG.

Click on the Add button in the above diagram, it will create partitions in that
volume group vg_system2.

Click on Add button to start adding LVs one by one, Select a mount point
and assign a size to it and click on OK.
Repeat the above step and create the following partitions with the given sizes

/usr with 8.5 GB approx


/var with 4.5 GB approx
/opt with 2 GB approx
/, /tmp, /home 2 GB each approx
/opt 3 GB approx

Note: All the sizes listed above are based on the availability of the space. It is no
where a recommended or minimum sizes. The sizes can be based on your
requirements. But /usr required the above given size(more) if it is 64-bit
architecture.

Select the Free space under Hard Drives and create /boot with 200MB and
SWAP with 2 GB. Make sure that you select Standard Partition this time,
instead of LVM.

Verify the sizes and click on Next to continue with the installation. Complete
the installation as usual as we have done previously at the beginning of the
course.

NOTE (VERY IMPORTANT ):


Make sure about the connectivity between windows and Linux is correct
(networking)

If no internet is required on your Linux then


Right click on VM -->settings --> Network Adapter --> o NAT
and set the vmnet range IP to your Linux server
If internet is required on your Linux server then
Right click on VM -->settings --> Network Adapter --> o Bridge Network
and set the Wireless Wi-Fi range IP to your Linux server
To verify, internet is working or not Linux :

#ping www.google.com

Then set the IP address in the Linux server in the similar range of "VMware Network
Adapter VMnet8"

TASK # 4: Assign some name and number


(hostname=newservername& IP Address=your.network.range.IP X.X.X.X)

Task 4.1: Define hostname and IP address to OS installed on


VM1
Hostname=server1 and IP address= 192.168.1.10

To Assign/Change Hostname:
Step1: temporary

Step2: permanent even after reboot

To Assign / Change IP-Address :


Step1: Temporary but no one will use
#ifconfig eth0 192.168.1.10

Step2: Permanently this will change the IP address of the interface eth0

Finally you have the values as


Hostname=server1
Ip- Address = 192.168.1.10
Now check the

Task 4.1: Define hostname and IP address to OS installed on


VM2
Hostname=server2 and IP address= 192.168.1.11
Repeat same above steps for vm2 server
Login to server2 from VMware workstation and check what is the hostname and IP
address
#hostname
#ifconfig -a
Suppose if you want to change hostname then
#hostname server2

#vi /etc/sysconfig/network
HOSTNAME=server2
Suppose if you want to change IP address, then
#vi /etc/sysconfig/network-scripts/ifcfg-eth0
IPADDR=192.168.1.11
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
#service network restart

Best PRACTICE:
Make sure both servers are able to login each other using both IP and Hostname
Solution:
On server1 :
#vi /etc/hosts
192.168.1.10
192.168.1.11

server1
server2

On server2:
#vi /etc/hosts
192.168.1.10
192.168.1.11

server1
server2

In real-time, they setup DNS for this name-IP resolution which is very very important
to make our life cool. Think if you need to remember the IP for all the websites you
use daily then how your life will be.

TASK #5: How to login this Linux/Unix World


Task 5.1: Login to Linux server1/server2 from windows
My understanding:

Suppose if you need to call some of your friend, then you need to have his no. and
that number you will insert in dialpad and call him. That number will work only if it is
registered with carrier(At&T, T-mobile, Verizon, Vodafone, airtel etc.)
Similarly here if you need to login to server1, it should have some no. called as IP
address and you need to insert in some client called as putty at windows server

and the carrier it uses is SSH

Like this all the company people who are using this linux server1 will login using
putty. So it is very important that the carrier service ssh should run all the time on
server1 so that PUTTY loginworks.
If putty login does not work for some reason than application people will ask the
administrator to check. Administrator will login using CONSOLE login(nothing but
VMware workstation/vsphere client for virtual servers and ILO for physical servers)
Nobody will login using CONSOLE except administrator(you).

Task 5.2: Login to Linux server2 from Linux server1


Simply using the command ssh

With specific user "john" not with root user

NOTE: As per security policy, root user is disabled via SSH login

OR

Task 6: First Set of commands


i)
ii)
iii)
iv)
v)
vi)
vii)
viii)
ix)
x)

#cat /etc/*release
#uname a
#arch
#dmidecode ( and check for system information paragraph for Model and
serial#)
#uptime
#cat /proc/meminfo or #cat /proc/cpuinfo or #fdisk -l
#free m or #top
or df h
#ps ef or #ps aux
#cd /etc/init.d and #ls and #service service-name
(status/start/stop/restart/reload)
#rpm qa

IP Address related

=
#vi /etc/sysconfig/network-scripts/ifcfg-eth0
BOOTPROTO=dhcp

=
#Vi /etc/sysconfig/netwwork-scripts/ifcfg-eth0
BOOTPROTO=static
IPADDR=192.168.0.10
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
#Vi /etc/resolv.cong
nameserver 192.168.0.1

Das könnte Ihnen auch gefallen