Tải bản đầy đủ (.pdf) (264 trang)

quan tri mang linux LPI12

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (24.85 MB, 264 trang )



..,.,..J'.."JteJC, TRUNG TAM DAO TAO MANG MAY TiNHNIIAT NGu-e
D6I TAC DAO T�O CUA MICROSOFT T� VIl:T NAM
"/,r'J;
-"!",., --- 105 Ba Huyen Thanh Quan, Q3, TP. HCM
NHATNGHE· Tel: 39.322.734
. - 39.322.735- Website: www.nhatnghe.com

-:�I�
"1,.,

Aficrosoft·Pa rtner
Goi:i Learning

Topic 1: Linux Installation and Package Management
- - - � - - - Installing software
Install programs from source

Phien Bin Thir Nghifm - Ltru Banh N{>i Bq

1


.t1"Jleft,
r.A/,r'J;
,,

NHATNGHE·

TRUNG TAM E>AQ T,:\.O M,:\.NG MAY TiNHNHAT NGH.f:


1>61 TAC BAO T�O CUA MICROSOFT T�I �T NAM
105 Ba Huyen
. Thanh Quan, Q3, TP. HCM
.
Tel: 39.322.734 - 39.322.735- Website: www.nhatnghe.com

Mic#Osolt·Partner

Installing Linux as a Server
1 • Yeu cau ph).an clfDg
,
System Requirements:
• I GHz x86_64 processor
• I 024MB of system memory (RAM)
• 5GB of disk space (for OS files; consideration should be given to the (often very large) size
of user files that will occupy the /home directory)
• Graphics card and monitor capable of I 024x768
• CD Drive, DVD Drive, or bootab]e USB Port
• Sound support, if you need sound.
• Internet access is helpful
A

).

2. Cai dJt
Giao trinh nay se hu6ng d!n cac b�n cai d�t CentOS 7.1 Enterrprise
Kh&i d<)ng tu CD Rom cua CentOS 7.1 enterprise
Khi chuong trinh cai d�t khai d<)ng, se hi�n thi man hinh:

BI. Ch9n ngon ngu cai d�t, chc,m continue:


2

·Phien Ban Th1r Nghifm - LU'U Hanh Nqi Bq


-.:�11�

....,.J:."llen- TRUNG TAM DAO T�O M�G MAY TiNHNHA.T NG�
B6I TAC BAO T�O CUA MICROSOFT T� V:q:T NAM
r-/111:'J:,
105 Ba Huy�n Thanh Quan, Q3, TP. �CM
-N-HA..,...,T_N_G_H_E
· Tel: 39.322.734 - 39.322.735- Website: www.nhatnghe.com

�,.,

Mictosoft· Partner
Goi
WELCOME TO CENTOS 7�
What language would you like to use during the installation process?
V

"-;

'°" t,ms.s«� "°''�+=<•

'� « ;, � """'


}:pgtisn ,(l!Jn!�ed fit
Afrikaans

Afrikaans

""'ci.:

Amharic

- �I

Arabic



Asturianu

Assamese
Asturian

- i

i

F>'�


English (United Kingdom)
English (India)

English (Australia)
English (Canada)
English (Denmark)
English (Ireland)

5e11apycKast

Belarusian

English (New Zealand)

6bllrapcKw

Bulg:,rian

English (Nigeria}

Bengali ----

�n.9:ish_ _ (r.:Jo':9 �0-�9 .�'.':'� �hlna)


..

Quit

Continue

Install or upgrade an exiting system: Cai m&i ho�c nang d.p


EB. Ch9n Ho chi Minh City, Done

82. Ch9n Date & Time

LOCALIZATION

DATE&TIME

DATE &TIME

Americas/New York timezone
LANGUAGE SUPPORT

English (United States)

SOFTWARE
84. Ch9n Software Selection

85. Ch9n Software selection, done

Phien Ban Thfr Nghifm - LtrU Hanh Nqi Bq

3


Me"-

NHAT NGH�


TRUNG TAM DAO T�O M�NG MAY TINHNHA.T NGffl:
DOI TAc BAO T.,;.o CUA MICROSOFT T.,;.I vq:T NAM
105 Ba Huy�n Thanh Quan, Q3, TP. HCM
Tel: 39.322. 734 - 39.322.735 - Website:

www.nhatnghe.com

SOFTWARE SELECTION
Minimal Install

Miclosoft· Partner

Base Envlrorrnent

Add-

"'· Fie and Print Server

File, print, and storeg-e server for ,ent,erprises.
r, Basic Web Server

Ser,er for serving static and dynamic internet
content.

KDUMP
Kdump is enabled

n ,

,..,.., Virtualization Host

Minimal virtualization host.

GNOME Desktop

86. ChQn Installation Destination

B7. ChQn disk sda, I will configure
partitioning
,Done

SYSTEM

Device Selection
Select the device($) you'd like to Install to. They will be left unto
"Begin Installation" button.

INSTALLATION DESTINATION

Local Standard Disks

Automatic partitioning selected
NETWORK & HOST NAME

Not connected

.40GiB

VMware, VMware Virtual S

sda I


992. 5 KiB free

Other Storage Options
Partitioning
�, Automatically configur.e partitioning. 0 I ,..�_.,m configure partitioning.

-�s. Ch9n Standard Partition, done
"'New CentOS 7 lnstallatlon
You haven't created any mount points for your
CentOS 7 installation yet. You can:


Ctkk here to create them autornatkaUv.

B9. T�o munt point /boot dung lu9ng 200M
ADD A NEW MOUNT POINT

More customization options are available
after creating the mount point below.
Mount Point:

• Create new mount points by dicking the '+'
button.
New mount points will use the following
partitioning scheme:

r��-���-�r���;-�;;��.·;:_,-·:_-_�.�-:�_-:·.:·..• ·. ::_ �.]

4


Phien Ban Thir Nghifm - LU'U Hanh Nqi Bq

V


-ALY,�
r/,r'J;
_N_H_A,.T_N_G_ H_�


TRUNG TAM DAO T�O M�.NG MAY TiNHNIIAT NGH¥
B61 TAC DAO T�O CUA MICROSOFT T�I Vll:T NAM
105 Ba Huyen Thanh Quan, Q3, TP. �CM
Tel: 39.322. 734 - 39.322.735 - Website: www.nhatnghe.com

BIO. ChQn+

ADD A NEW MOUNT POINT

�----·
/boot
Mount Point:

SYSTEM

Desired Capaclt
! 200MiB
t�---Device Type:
(

i Standard P�rtiti

More customization options are available
after creating the mount point below.

I

__,
__
j swap
. .
v
······ ···· ·_ ······_ ···· ··· ··················· ·······················_ · ·· ··
· ··

['-:
y
it
_
c
_ _ _ _ _ _ _ _
_
d Capa
Desire
Mount Point:

f::t�=���I

Cancel


Add mount point

Bl3. Ch9n done

B12. T�o han vimg /root

MANUAL PARTITIONING

ADD A NEW MOUNT POINT

Ill

More customization options are available
after creating the mount point below.
Mount Point:

Goici Learning

B11. T�o phan vung swap

sdal

,.. New CentOS 7 Installation
DATA

AfictOsoft· Partner

New CentOS 7 Installation

sda3

Mount Point:

I

V

Desired C.. pa ci
33.2 G,6

Device Type:

: Cancel

St•ndard P arti

Add mount point

B14. Ch9n Accept

B15. Ch9n Network% Hostname

SUMMARY OF CHANGES

SYSTEM

�st,ov Form�t ;;,., ·. - :-;:,.,, )1'.[''

0-e•t+ Forrn�t
(re.at-e Oevir.e


;� �r:.,�•-: ·:

Create Format

('=
Create Device

v....:tt<,,v':

Cr*ate Fomat

.•,,.,.·.�·

Cre-e Format

t-
INSTALLATION DESTINATION

Custom partitioning selected
NETWORK & HOST NAME
Not comected

B16. ChQn ON, configure

B17. NMp thong tin cho Lan card, Save, done

Phien Ban Thir Nghifm - Ltru Hanh Nqi Bq


5


TRUNq TA� DAO T�� M�NG MAY TiNH NIL\T NG11¥
,..,1"1Jf,e/fl
1>61
TAC f>AO T�O CUA MICROSOFT T�I VJt;T NAM
"{,r'J;
----- I 05 Ba Huy�n Thanh Quan, Q3, TP. HCM
NHAT NGH� Tel: 39.322. 734 - 39.322.735 - Website: www.nhatnghe.com

[i] Ethernet (eno16777736)
� Connected

..


/f/r,c,osott· Partner

,� .¥

�.'.ii:-it:i Leaming

Addresses

Hardware Address 00:0C:29:SA:CE:OA
Speed 1000 Mb/s
IP Address 192.168.232.143
Subnet Mask 255.255.255.0


0 Require lP\;4 addressing for this connection .to complete

Default Route 0.0.0.0
ONS 192.168.232.l
' Configure...

Bl 7. D�t password cho root: 123456

B 16. ChQn Begin Installation

CONFIGURATION

KDUMP
Kdump Is enabled

USER SETrlNGS
ROOT PASSWORD
Root password is not set

B 19. Ch9n Reboot

B 18. T�o user
CENTOS? INSTALLATION
Imus

, Help!

I ready for you to use! Go ahead and reboot to

820. Lo ·n user root


6

B21. Start using Centos Linux

Phien Ban Thii' Nghifm - Ltru Hanh Nqi Bq


_.,.17!�
r-ffll:'X
-i
-N-H A.-T_N_G_H_E
·

...:-�I�

TRUNG TAM DAO T�O M�NG MAY TiNHNIIAT NGHl:
B6I TAC BAO T�O CUA MICROSOFf T� viiT NAM
105 Ba Huy�n Thanh Quan, Q3, TP. �CM
Tel: 39.322.734 - 39.322.735-Website: www.nhatnghe.com

�--,

llllictosolt· Partner
Goi
Your computer is ready to use,
You may change these options at any time in Settings,
"""'-;:;


!;,j r :

-

""'

ti

Sta!i using C2n:OS unu<

Gin them Ian card
Bl. #nmtui

82. Doi ten profile

Phien Bin Thir Nghifm - L1111 Banh N9i B9

7


TRUNG TAM E>AO T�O M�NG MAY TiNH NIIAT NGQ
_.,L"'Jll,e/fl
1>61
TAC BAO T�O CUA MICROSOFT T�I VJ¥T NAM
rf,rr'J;
105 Ba Huyen Thanh Quan, Q3, TP. HCM
NHATNGHE
.
·
. www.nhatn he.com

.
· Tel: 39.322.73439.322.735-Website:
g

-·-tt---.

B4. #systemctl restart network
#mv /etc/sysconfig/network-scripts/ifcfg­
Wired_connection_ I /etc/sysconfig/network­
scripts/ifcfg-eno33554984
Chu y: co th8 d6i ten thanh ifcfg-ethO, ifcfg-ethl ...

Stop and Disable Firewalld on CentOS 7
DisableFirewalld
#systemctl disable firewalld

StopFirewalld
#systemctl stop firewalld

Check the Status ofFirewalld
#systemctl status firewalld

Disable SELinux CentOS 7
Xem �ng thai selinux:
[root@localhost-]# sestatus
enabled
SELinux status:
/sys/fs/selinux
SELinuxfs mount:
/etc/selinux

. SELinux root directory:
Loaded policy name:
targeted
enforcing
Current mode:
enforcing
Mode from config file:
enabled
Policy MLS status:
Policy deny_unknown status: allowed
. Max kernel policy version: 28
Mcr file /etc/selinux/config, sfra SELINUX=disbled
HoJc
[root@localhost-]# sed -i 's/enforcing/disabled/g' /etc/selinux/config
[root@localhost-]# reboot
[root@localhost-]# sestatus
disabled
SELinux status:
Change default runlevel in CentOS 7
Cach 1:
B 1. Xem runlevel hi�n t�i
[root@localhost -]# systemctl get-default

8

Phien Ban Thii' Nghifm - Ltru Hanh Nqi B{,

Miclosolf· Partner
',it.si::! Leaming



.AA.J'..."Jle,t, TRUNG TAM DAO T�O M�NG MAY TiNH NIIAT NGiq:
DOI TAC DAO T�O CUA MICROSOFT T�I \'q:T NAM
105 Ba Huy�n Thanh Quan, Q3, TP. �CM
_N _H_A.,.T_N_G_H_E
· Tel: 39.322.734 - 39.322.735-Website: www.nhatnghe.com

"/ffl:'X

':�,�
...,,.,

AficlOsoff·Partner

graphical.target
B2. Xem cac target c6 �n
[root@localhost -]# systemctl list-units --type=target
UNIT
LOAD ACTIVE SUB DESCRIPTION
basic.target
loaded active active Basic System
cryptsetup.target
loaded active active Encrypted Volumes
getty.target
loaded active active Login Prompts
graphical.target
loaded active active Graphical Interface
local-fs-pre.target
loaded active active Local File Systems (Pre)
local-fs.target

loaded active active Local File Systems
multi-user.target
loaded active active Multi-User System
network.target
loaded active active Network
paths.target
loaded active active Paths
ren1ote-fs-pre.target loaded active active Remote File Systems (Pre)
remote-fs.target
loaded active active Remote File Systems
slices.target
loaded active active Slices
sockets.target
loaded active active Sockets
sound.target
loaded active active Sound Card
swap.target
loaded active active Swap
sysinit.target
loaded active active System Initialization
timers.target
loaded active active Timers
LOAD = Reflects whether the unit definition was properly loaded.
ACTIVE= The high-level unit activation state, i.e. generalization of SUB.
SUB = The low-level unit activation state, values depend on unit type.
17 loaded units listed. ·Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.
83. Change default to runlevel 3
#systemctl set-default multi-user.target
rm '/etc/systemd/system/default.target'

In -s '/usr/1ib/systemd/system/multi-user.target' '/etc/systemd/system/default.target'
84. Ki�m tra
#systemctl get-default
multi-user.target
85. Reboot
Cach2:
B 1. Check the current level
# systemctl get-default
multi-user.target
B2. Xem cac runlevel
[root@localhost -]# Is /lib/systemd/system/runlevel*target -1
lrwxrwxrwx. l root root 15 Apr 14 2015 /lib/systemd/system/runlevelO.target -> poweroff.target
lrwxrwxrwx. l root root 13 Apr 14 2015 /lib/systemd/system/runlevel I .target -> rescue.target
lrwxrwxrwx. I root root 17 Apr 14 2015 /lib/systemd/system/runlevel2.target -> multi-user.target

Phien Bin Thir Nghifm - Lll'll Hanh Nqi Bq

9


Men,

TRUNG TAM DAO T�O M�NG MAY TINHNIIA.T NGII¥
D6I TAC DAO T40 CUA MICROSOFT T4J V�T NAM
� I 05 Ba Huy�n Thanh Quan, Q3, TP. HCM
.,
NHAT NGH� Tel: 39.322. 734 - 39.322.735 - Website: www.nhatn
ghe.com

lrwxrwxrwx.

lrwxrwxrwx.
lrwxrwxrwx.
lrwxrwxrwx.

1 root root
1 root root
1 root root
1 root root

17 Apr
17 Apr
16 Apr
1 3 Apr

14
14
14
14

"

":.iL�i:S Leaming

2015 /lib/systemd/system/runleve13.target -> multi-user.target
2015 /lib/systemd/system/runlevel4.target -> multi-user.target
2015 /lib/systemd/system/runlevel5.target -> graphical.target
2015 /lib/systemd/system/runlevel6.target -> reboot.target

B 3. Chuy�n runleve tir 3 sang 5
In -sf /lib/systemd/system/runlevel5.target /etc/systemd/system/default.target

Ho�c
In -sf /lib/systemd/system/graphical.target /etc/systemd/system/defalilt.target
B4. Ki�m tra
# systemctl get-default
runlevel5.target
#reboot

10

�--

Mlclosolt' Partner

Phien Ban Thfr Nghifm - LU11 Hanh Nqi Bq


1lf1t"'

i11!\
� ...

TRUNG TAM DAO T�O M�G MAY TiNHNBAT NGHf;
D6I T.AC D.AO T�O CUA MICROSOFf T� VItT NAM
105 Ba Huyen Thanh Quan, Q3, TP. HCM
NHATNGHE· Tel: 39.322.734
. - 39.322.735- Website: www.nhatnghe.com

Aficrosoft·Pa rtner

A


,,

Goid Learning

Installing software
- Redhat Package Manager (RPM) la cong cv dung d� Installing, Uninstalling va Upgrading software
cho h� th6ng Linux.
- M9t RPM package la m9t file chfra cac chucmg trinh thl,lc thi, cac scripts, tai li�u, va m9t s6 file dn
thi€t khac. Cdu true ciia m9t RPM package nhr sau:

1

package
Ndmt, .

1jo 1

1 .. 1

- �

I i386 I

Rekose

A.rcbfttetart

11ersion


rp1

I

1. Quan ly package bing The Package Management Tool (dung giao difn d6 hqa)
- Vao menu Application 7 ch9n System tool, Software
,

..

i J"
Pfaces . t$ftware

Favorites

Boxes

Accessories

'X,

Graphics

r; �

Software



Software Update


Documentation
Internet

Office

. �

Sound & Video

Sundry

jsystem Tools

1.

. tJ

J

IIJ

Settings

Startup Applications
System Log
System Mon,tor

Man hinh Software Manager.
Software


System Management

!. .. Virtualization

Virtuali:ation Client

Virtualization Hypervisor

'

Virtualization Platform

Tools
Ii" WebVirtualization
Services
load Balancer

.,·1. I

Ttle Ap��;·.:irw's-;rve�is-; ..
1
:powerful, efficient, and extensible :

'·······' -·-··------··-···---··-····--··-d
Dov:nload size 2.8 MB

• Software Sources

Liu,nce ASL 2.0


Source CentOS-7 - Base

Phien Ban Thir Nghifm - Ltru Hanh Nqi B9

11


TRUNG TAM oAo T�O M�NG MAY TINHNHA.TNGffl:
�e,,t, D6I TAC DAO T�O CUA MICROSOFT T� Vq:TNAM
,.,
- - 105 Ba Huy�n Thanh Quan, Q3, TP. HCM
NHAT NGHe Tel: 39.322.734 - 39.322.735- Website: www.nhatnghe.com

..

_;,...,,

,� �

Mlc#osoff·Pa rtner
'i:.:-k: Leaming

2. Quan ly package bing RPM (dung command)
2.1. Xem cu phap lenh rpm: man rpm
Red Hat Linux

PM(8)

RPM(8)


rpm - RPM Package Manager
IS
QUERYING ANO VERIFYING PACKAGES:
rpm {-ql--query} [s el.ect-options] [query-options]
rpm {·Vl·-verify} [sel.ect-options] [verify-options]
rpm {·Kl--checksig} [--nosignature] [--nodigestJ
PACKAGE FILE ..:....!..::.
INSTAlUNG, UPGRADING, AND REMOVING PACKAGES:
rpa {-il--instaU} [instaU-options] PACKAGE FILE

.!...!...!.

rpm {·Uf--upgrade} [instal.l.-options] PACKAGE FILE

.,_,_,_

rpm {-Ff--freshen} [instatl.-options] PACKAGE FILE

.:...:...,.

rpm {-el--erase} [--allmatches] [--nodeps] [--noscripts]
[--notriggers] [--repackage] [--test] PACKAGE NAME .:...:...,.
HISCELLANEOUS:
rpm {--initdbl·-rebuilddbj

¢ Xem va d6i chi�u v&i ly thuy�t cac option khi su dµng I�nh rpm.
2.2. Cai djt tir DVD

* Cac tham s6 thucmg dung cha vi�c cai d�t


[root@localhost-]# mount /dev/cdrom /media/
[root@localhost-]# rpm -ivh /media/Packages/mc-4.8.7-8.el7.x86_64.rpm
warning: /media/Packages/mc-4.8.7-8.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID
f4a80eb5: NOKEY
#################################[lOOo/o]
Preparing...
Updating I installing...
#################################[lOOo/o]
l:mc-l:4.8.7-8.el7
Ch�y thfr ph§.n m�m me
[root@may 1 -]#me

12

Phien Ban Thii' Nghi�m - LU11 Hanh Nqi Bq


JutL""Jletr,

TRUNG TAM DAO TtO MtNG MAY TiNHNHATNG:Hl:
D61 TAC DAO T�O CUA MICROSOFT T� VJl;T NAM
105 Ba Huyen
. Thanh Quan, Q3, TP. HCM
.
NHATNGHE• Tel: 39.322. 734 - 39.322.735 - Website:
www.nhatnghe.com

"/fflfX
"'


A

��
.,.,,,.,

Mictosott·Pa rtner
Gold Learning

me []:/

· Truy v§.n cac thong tin lien quan d�n g6i da cai
Cac tham s6 thucmg dung
Tuy chf!n

-q
-a
-d
-i
-c

Ynghia

(package.file) hien thj package.
(all) truy van tat CG CllC package afi aU()'C Ceti tfgt.
(documentation) li?t ke cacfiles tai li?u lien quan tlen package.
(information) li?t ke cac thong tin nhu package name, description,
release number, size, build date, installation date, vendor, va cac thong
tin khac.
(configuration) li?t ke cac t(lp tin cau hinh cua package.


#rpm -qa me => li�t ke cac packages c6 ten la samba.
[root@mayl -]# rpm -qa me
mc-4.8.7-8.el7.x86 64
[ root(a2may I -]#
#rpm -qa me* => li�t ke cac packages co ten nit dAu la me.
[root@mayl -]# rpm -qa me
mc-4.8.7-8.el7.x86-64
[root(a2mayl -]#
#rpm -qa I grep me => li�t ke cac packages c6 ten chua me.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!13
Phien Bin Thi'r Nghifm - Ltr0 Hanh N{H Bq


TRUNG TAM DAO TAO MANG MAY TINHNBAT NGHE
-AAL"'ll�
B6I
T.A.C BAO T�O CUA MICROSOFT T� Vfl;T NAM
"/,r'J;
I 05 Ba Huy�n Thanh Quan, Q3, TP. �CM
'!'"N-�,-..-T-N_G_H-�· Tel: 39.322.734 - 39.322.735 - Website: www.nhatn he.com
g

�,.

...... ·�

.a-lCIOSOft· Partner


[root@mayl -]# rpm -qa I grep me
libXdmcp-1.l .1-6.l .el7.x86_64
smc-meera-fonts-6.0-7.el7.noarch
smc-fonts-common-6.0-7.el7.noarch
mc-4.8.7-8.el7.x86_64
abrt-addon-vmcore-2.1.1119.el7.centos.0.3.x86 64
#rpm-qd httpd

. => li�t ke cac files tai li�u lien quan d�n me.

[root@localhost-]# rpm -qd httpd
/usr/share/doc/httpd-2.4.6/ABOUT_APACHE
/usr/share/doc/httpd-2.4.6/CHANGES
/usr/share/doc/httpd-2.4.6/LICENSE
/usr/share/doc/httpd-2.4.6/NOTICE
/usr/share/doc/httpd-2.4.6/README
/usr/share/doc/httpd-2.4.6NERSIONING
/usr/share/doc/httpd-2.4.6/httpd-dav.conf
/usr/share/doc/httpd-2.4.6/httpd-default.conf
/usr/share/doc/httpd-2.4.6/httpd-info.conf
/usr/share/doc/httpd-2.4.6/httpd­
languages.conf
rpm-qi me

=> li�t ke cac thong tin mo ta g6i me.

[root@localhost-]# rpm-qi httpd
Name
: httpd
Version

: 2.4.6
: 31.el7.centos
Release
Architecture : x86 64
Install Date : Tue 14 Apr 2015 06:14:49 PM JCT
Group
: System Environment/Daemons
Size
: 9810046
License
: ASL 2.0
: RSA/SHA256, Sat 14 Mar 2015 02:55:03 PM
Signature
24c6a8a 7f4a80eb5
Source RPM : httpd-2.4.6-31.el7.centos.src.rpm
Build Date
: Thu 12 Mar 2015 10:09:17 PM ICT
Build Host
: workerl.bsys.centos.org
Relocations : (not relocatable)
: CentOS BuildSystem <>
Packager
Vendor
: CentOS
URL
: />Summary
: Apache HTTP Server
Description
The Apache HTTP Server is a powerful, efficient, and extensible
web server.

rpm-qc samba

JCT,

Key ID

=> li�t ke cac �p tin du hinh cua samba.

I [root@Jocalhost-]# rpm -qa I grep samba
14�!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Phien Bin Thu Nghifm - LU'U Hanh Nqi B9


TRUNG TAM DAO TAO MANG MAY TINHNBA.T NGHE
�en, 1>61 TAC BAO T40 CUA MICROSOFT T4{ viiT NAM
,.,
· _ l05 Ba Huyen Thanh Quan, Q3, TP. HCM
NHATNGHE
. - 39.322.735- Website: www.nhatnghe.com
· Tel: 39.322.734

Microsoft·Pa rtner
Goici Learning

samba-common-4.1.12-2 l .el7_1.x86_64
samba-4.1.12-21.el7- l.x86-64
samba-libs-4.1.12-2 l.el7 l.x86 64
2.3. Ga bo mqt package (Erase)
[root@mayl -]# rpm -e me

Chu y: Niu gfi bo m(Jt package ma package do con ph1:1 thu(jc vao cac package khac thi khi
gfi bo ta ditng them tuy ch,;m --nodeps.
[root@localhost -]# rpm -e samba-common
error: Failed dependencies:
samba-common = 4. l .12-21.el7 _1 is needed by (installed) libsmbclient-0:4. l .12-21.el7 _1.x86_64
libpopt_ samba3.so()( 64bit) is needed by (installed) samba-0:4. l .12-21.el7_ l .x86_64
libpopt samba3.so(SAMBA 4. l .12)(64bit) is needed by (installed) samba-0:4. l.12-21.el7 l.x86 64

c:> L6i do samba-common ph1,1 thu(k vao g6i samba-0:4. l .12-2 l.el7_1.x86 _64. Vi v�y n�u
mu6n xoa g6i do samba-common thi c6 2 each:
Cach 1: xoa g6i samba-0:4. l .12-2 l .el7_1.x86_64 tru6c, sau d6 xoa g6i samba-common.
Cach 2: xoa g6i samba-common dung v6i option --nodeps
rpm -e samba-common --nodeps
Dung l�nh rpm -qa grep samba d� ki�m tra k�t qua.
J

2.4. Cfp obit m{>t package (upgrade)
[root@mayl -]# rpm -Uvh /media/Packages/ samba-4. l.12-21.el7_l.x86_64.rpm
warning:
/media/Packages/samba-4.1.12-21.el7_1.x86_64.rpm:
Header
RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Preparing...
################################# [100%]
package samba-0:4.1.12-21.el7 1.x86 64 is already installed

V3

Ghi chu:


- Ta co thi ditng Nnh rpm vai option.'

--nodeps
: l¢nh rpm se ho qua cac g6i ph1,1 thu(>c.
: lfnnh rpm se bo qua l6i xung a(>t.
--force
-Di cai aijt software tren HDH Linux ngoai RPM package, chung ta con co thi cai aijt bi'lng
goi source, chi tih Se aU()'C trinh bay O' phJn sau.

3. Sir dyng lfnh yum
L�nh yum cho phep tim ki�m va cai d?t cac ph!n m�m, thu vi�n tri.rc ti�p tir internet
Cuphap:
yum [options] [command] [package ...]
Cac thong s6:
* install package1 [package2] [...]
* update [package]] [package2] [...]
* check-update
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!�15
Phien Ban Thir Nghifm - Llfll Hanh N{H B9


TRUNG TAM E>AO T�O M�G MAY TINHNIIATNG�
.A�L"'Jl,eJC,
1>61 TAC BAO T�O CUA MICROSOFT T� Vft:T NAM
"/fflfl:
105 Ba Huyen Thanh Quan, Q3, TP. HCM
NHATNGHE· Tel: 39.322.734
. - 39.322.735- Website: www.nhatnghe.com
,.,


A


"'..
.-ICIOSOtt' Partner

* upgrade [package!] [package2] [...]
* remove I erase package! [package2] [...]
* list [...]
* info [...]
* provides I whatprovides feature! [feature2] [...]
* clean [ packages I headers I metadata I cache I dbcache I all ]
* makecache
* groupinstall groupl [group2] [...]
* groupupdate group! [group2] [...]
* grouplist [hidden]
* groupremove group! [group2] [...]
* groupinfo group! [...]
* search string! [string2] [...]
* shell [filename]
* resolvedep depl [dep2] [...]
* localinstall rpmfilel [rpmfile2] [...]
* localupdate rpmfilel [rpmfile2] [...]
* deplist package 1 [package2] [...]
Cai tir dia DVD
b 1. t�o thu m1,1c trong root:
mkdir /media/cdrom
b2. mount dvd vao thu m1,1c:
mount /dev/cdrom /media/cdrom
b3. import key PGP:.

rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
b4. cai d�t cac nh6m phfin m�m v&i yum:
Xem cac group aa dugc cai va chua [root@mayl AdobeReader]# yum grouplist
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Group Process
Installed Groups:
Additional Development
Base
Client management tools
Console internet tools
Debugging Tools
Desktop
Desktop Debugging and Performance Tools
Desktop Platform
Available Groups:
Backup Client
Backup Server
CIFS file server
Compatibility libraries
16�!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Phien Ban Thu- Nghifm - Lu-u Hanh Nqi Bq


"":4l"i,

Men,

TRUNG TAM DAO T�O M�NG MAY TINHNHA.T NGH¥
D6I TAC DAO T�O CUA MICROSOFT T�I Vll:T NAM

_ 105 Ba Huyen Thanh Quan, Q3, TP. HCM
,.,
NHATNGHE· Tel: 39.322.734
. - 39.322.735 - Website: www.nhatn he.com
g

Aficrosoft·Pa rtner

...

Goici Leaming

Desktop Platform Development
Development tools
Directory Server
Eclipse
Emacs

Vi d1=1 cai g6i "Backup Server"
[root@mayl AdobeReader]# yum --disablerepo=\* --enablerepo=c6-media groupinstall "Backup
Server"
Runningrpm_check_debug
RunningTransaction Test
Transaction Test Succeeded
RunningTransaction
Warning: RPMDB altered outside of yum.
** Found 1 pre-existingrpmdb problem(s), 'yum check' output follows:
samba-client-3.5.10-114.el6.i686 has missing requires of samba-common = ('O', '3.5.1O', 'l 14.el6')
1/3
Installing: 2:xinetd-2.3.14-33.el6.i686

Installing: amanda-2.6.1p2-7.el6.i686
2/3
Installing: amanda-server-2.6.1p2-7.el6.i686
3/3
Installed:
amanda-server.i686 0:2.6.1p2-7.el6
Dependency Installed:
amanda.i686 0:2.6.1p2-7.el6

xinetd.i686 2:2.3.14-33.el6

Complete!

Cai tir internet
Cai d�t me:

[root@serverl /]# yum install me - y
Loading "installonlyn" plug1n
Loading "priorities" plugin
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.
---> Package mc.i386 1:4.6.la-35.el5 set to be updated
--> Running transaction check
Dependencies Resolved
Package


Arch

Version

Repository

Installing:
me
i686
1:4.7.0.2-3.el6 base
Total download size: 1.6 M

Size
1.6 M

Phien Bin Thii' Nghifm - Ltru Hanh Nqi Bq

17


Men,

TRUNG TA.M E>AO T�O M�NG MAY TiNHNIIAT NG11¥
DOI TAC DAO T.�O CUA MICROSOFT T*1 VIE:T NAM
105 Ba Huy�n Thanh Quan, Q3, TP. HCM
NHAT NGH�
Tel: 39.322.734 - 39.322.735- Website: www.nhatnghe.com


A


Installed size: 5.4 M
Is this ok [y/N]: y
Downloading Packages:
mc-4. 7.0.2-3.el6.i686.rpm
00:08
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : 1:mc-4.7.0.2-3.el6.i686
1/1

llllr#CIOSOlt' 1Partner
:;,.,k! Leaming

I 1.6 MB

Installed:
mc.i686 1:4.7.0.2-3.el6
Complete!
Qua trinh cai k�t thuc.
Xem thong tin g6i me
[root@mayl AdobeReader]# yum info me
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirrors.hostemo.com
* extras: mirrors.hostemo.com
* updates: mirrors.hostemo.com
Installed Packages

: me
Name
Arch
: i686
Epoch
:I
Versio.n : 4.7.0.2
Release : -3.el6
Size
: 5.4 M
: installed
Repo
· From repo : base
Summary : User-friendly text console file manager and visual shell
URL
: />License : GPLv2
Description : Midnight Commander is a visual shell much like a file manager, only
: with many more features. It is a text mode application, but it also
: includes mouse support. Midnight Commander's best features are its
: ability to FTP, view tar and zip files, and to poke into RPMs for
: specific files.
[root(a),mayl AdobeReader]#
E>� go b6 g6i phin mSm, sti di,mg thong sd remove
[root@serverl /]# yum remove me
Loaded lu ins: fastestmirror, refresh-packa ekit, security
18�!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Phien Ban Thir Nghifm - LU'U Hanh Nqi Bq


TRUNG TAM E>A.O T�O M�NG MAY TiNHNHAT NG�

JtAL"'lle/tl
DOI
TAC D.AO T.�O CUA MICROSOFT T�I V)¥T NAM
"(fll:'J:
105 Ba Huy�n Thanh Quan, Q3, TP. �CM
_N _H_A�T-N_G_H_E· Tel: 39.322.734 - 39.322.735- Website: www.nhatnghe.com

Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package mc.i686 l:4.7.0.2-3.el6 will be erased
--> Finished Dependency Resolution
Removing:
me
1 :4.7.0.2-3.el6
i686
5.4M
Remove
1 Package(s)
Installed size: 5.4 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Erasing
1/1

'


�,-,

Aficrosott· Partner
Goici Learning

@base

1 :mc-4.7.0.2-3.el6.i686

Removed:
mc.i686 1 :4.7.0.2-3.el6
Complete!

Phien Ban Thir Nghifm - Ltru Banh N9i B9

19


Men,

TRUNG TAM oAo T�O M�NG MAY TINHNHA.T NGfll:
DOI
TAC BAO T�O CUA MICROSOFT T� VJt;T NAM
.
105 Ba Huy(!n Thanh Quan, Q3, TP. HCM
,.,
NHAT NGHe Tel: 39.322.734 - 39.322.735-Website: www.nhatn e.com
gh


Topic 2: GNU and Unix Commands
Work on the command line
Process text streams using filters
Perform basic file management
Create and change hard and symbolic links
Use streams, pipes and redirects
Create, monitor and kill processes
Modify process execution priorities
Search text files
Using vi

·

20

Phien Ban ThU" Nghifm - LU'U Hanh Nqi Bq

�,.
...,_
llll"ICIOSOlt-Partner
,.i.:::>ki Leaming


TRUNG TAM E>A.0 T.e,.O M.e,.NG MAY TiNHNHAT NGHE:
JoAL'Tl,e/tl
1>61
TAC B.AO T�O CUA MICROSOFT T�I �T NAM
7fllf'J:
,.,
_ 105 Ba Huyen Thanh Quan, Q3, TP. HCM

NHATNGHE· Tel: 39.322.734
. - 39.322.735-Website: www.nhatnghe.com

"':��1,�..,

Aficrosoft·Pa rtner
Cioirl Learning

The Command Line
1. Gioi thieu
Su d\Jng BASH Shell
- Linux cung cftp kha nang giao ti�p v6i kernel thong qua trinh di�n dich trung gian gc;>i la Shell.
Shell co chuc nang gi6ng "command.com"(DOS)
- Cac lo�i Shell trong Linux:

Xwindow

Xem cu phap Ifnhf
D� xem cu phap cua m9t l�nh bftt ky trong Linux ta dung l�nh man hay (info)
Xem cu phap l�nh rpm:
[root@mayl -]# man rpm
RPM(8)

RPM(8)

NAME
rpm - RPM Package Manager
SYNOPSIS
QUERYING AND VERIFYING PACKAGES:
rpm {-ql--query} [select-options] [query-options]

rpm {-Vl--verify} [select-options] [verify-options]
rpm --import PUBKEY ...
rpm {-Kl-�checksig} [--nosignature] [--nodigest]
PACKAGE FILE ...

Ciu true hf th6ng tip tin
9!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!21
Phien Ban Thu Nghifm - LU'U Hanh Nc)i Be)


TRUN� TA� f>AO TA.q MA.NG MAY TiNHNHATNGiq:
..,.,.,J"..'Jle,i,
DOI TAC BAO T�O CUA MICROSOFf T� �T NAM
"fffl:"X
I 05 Ba Huy�n Thanh Quan, Q3, TP. HCM



,.,

.

A

NHAT NGH�

Tel: 39.322.734 - 39.322.735- Website:

www.nhatnghe.com


M'"ICl'OSOlt' Partner

Khai ni�m t?p tin trong Linux dugc chia ra lam 3 lo�i chinh:
+ T?p tin chua du li�u binh thucmg.
+ T?p tin thu mvc.
+ T?p tin thi�t bi.
Ngoai ra Linux con dung cac Link va Pipe nhu la cac t?P tin d�c bi�t.
Xem cfiu true t?p tin h� th6ng:

root@1oca1host
ota1· 76
rwxrwxrwx.
1
r-xr-xr-x.
5
rwxr-xr-x 19
rwxr-xr-x. 143
3
rwxr-xr-x.
rwxrwxrwx.
1
1
rwxrwxrwx.
2
rwx------.
3
rwxr-xr-x.
rwxr-xr-x.
2
rwxr-xr-x.

3
r-xr-xr-x 285
r-xr-x---. 15
rv..rxr-xr-x
37
rwxrwxrwx.
1
rv,1xr-xr-x
3
rwxr-xr-x.
2
13
r-xr-xr-x
20
rwx rwx rwt
rwxr-xr-x. 13
rwxr-xr-x. 23

-

-]# '11 I
root root
root root
root root
root root
root root
root root
root root
root root
root root

root root
root root
root root
root root
root mot
root root
root root
root root
root root
root root
root root
root root

7
1024
3226
12288
4096
7
9
16384
4096
4096
4096
G
4096
1080
8
4096
4096

0
4096
4096
4096

Apr
Apr
Apr
Apr
Apr
Apr
Apr
Apr
Apr
Jun
Apr
Apr
Apr
Apr
Apr
Apr
Jun
Apr
Apr
Apr
Apr

14 17:16 bin -> usr/bin
14 17:39 boot
15 14:41 dev

15 14:43 etc
14 17:25 home
14 17:i6 i..ib -> usr/lib
14 17: 16 l
-> usr/1ib64
14 17:16 lost+found
14 22:34 media
10 2014 mnt
14 17:23 opt
15 14:12 proc
15 14:41 root
15 15:09 run
14 17: 16
-> usr/sbin
14 18:31 software
10 2014 srv
15 14:12 sys
15 14:43 ff�
14 17: 16 us r
15 14:12 var

£>6i v&i Linux, khong c6 khai ni�m cac 6 dia. Toan b<) cac thu m1,1c va t?p tin dugc "g�n" Jen
(mount) va t�o thanh m<)t h� th6ng t?p tin th6ng nh§t, b�t d!u tu g6c '/'
M<)t s6 t�p tin thu m1,1c ca ban tren Linux:
T�p tin thu m1,1c
/bin,
/sbin
/boot
/dev
/etc

/home
/lib
/mnt
/proc
/root
/tmp
/usr
/var

Chuc nang
Chua cac t?p tin nhj phan ho trg cho vi�c boot va thµc thi cac
l�nh dn thi�t.
Chua Linux kernel, file anh ho trg cho vi�c load h� dieu hlnh.
Chua cac t?P tin thiet bi (nhu CORom, HOD, FOO, ... ).
Chua cac t?P tin cau hinh h� thong.
Chua cac home directory cua nruai dunj;!;.
Chua kernel module, va cac thu vi�n chia se cho cac t�p tin nhj
phan trong /bin va /sbin.
C�ua cac mount point cua cac thiet bj dugc mount vao trong h�
thong.
Luu trii thong tin ve kernel.
Luu trii home directory cho user root.
Chua cac file t�m.
Chua cac chuong trinh da duqc cai d�t.
Chua cac Joj;!; file, hang dgi cac chuong trinh, mailbox cua uers.

2L�!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Phien Ban Thir Nghi�m - LU'U Hanh Nqi Bq



Men,

· TRUNG TA.M flAO T�O M�G MAY TiNHNHATNGiq;
B6I TAC BAO T�O CUA MICROSOFI' T�I Vll:TNAM
Thanh Quan, Q3, TP. HCM
,.,
,_ I 05 Ba Huyen
NHATNGHc
. - 39.322.735- Website: www.nhatnghe.com
· Tel: 39.322.734

Xem danh sach cac files
- Xem danh sach cac file tren thu mvc 6c:
[root@testsrv -]# ls -l I
otal 139
rwxr-xr-x 2 root root 4096
rwxr-xr-x 4 root root 1024
rwxr-xr-x 3 root root 1024
rwxr-xr-x 10 root root 3740
rwxr-xr-x 95 root root 12288

Jan
Jan
Jan
Jan
Jan

26
26
26

26
26

17:20
10:29
10:09
15:46
17:20

Aficrosoft·Pa rtner
G<:id Leaming

bin
boot
data
dev
etc

M{>t s6 options thucmg dung v&i l�nh ls
Options
-L
-1
-a
-R

Y nghia
Hien thi danh sach file (chi hi�n thi ten).
Hien thi danh sach file (gom nhieu CQt: filename,size,date,....
Li�t ke tat ca cac file, baa gom nhfrng file an.
Li�t ke tat ca cac file ke ca cac files hen trong thu m1,1c son.


2. Nhom lfnh qua ly thtr ffl\JC
· 2.1. mkdir: T�o thu m1,1c
- T�o cay thu m1,1c sau:

/--data--

c

dulieu
ke toan
kinh doanh
OS
linux
Fedora
E Redhat
Ubuntu
unix
AIX
E FreeBSD
Solaris
windows
win2k8
E win7
winxp

L

Su di.mg l�nh mkdir v6i cu phap sau d� t�o cay thu m1,1c tren
[root@mayl -]# mkdir /data

[root@mayl -]# mkdir-p /data/os/unix/AIX
[root@mayl -]# mkdir /data/os/unix/{Solaris,FreeBSD}
[root@mayl -]# mkdir -p /data/os/linux/{Fedora,Redhat,Ubuntu}
[root@mayl -]# mkdir /data/os/windows
[root@mayl -]# cd /data/os/windows/
[root@mayl windows]# mkdir winxp win7 win2k8
[root@mayl windows]# mkdir ../. ./dulieu
[root(a),mayl windows]# mkdir ../../dulieu/{"ke toan","kinh

. Phien Ban Thir N:ghifm - LtrU Hanh Nqi Bq

23


Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Tải bản đầy đủ ngay
×