CentOS 7 basic tutorial
After CentOS 7 minimal is installed, the system is unable to speak out and the change is huge. It is found that no common commands have been used in the past.
I. Installation of Common commands
Check the anaconda-ks.cfg, it turns out that there is no base group package
[Root @ centos7 ~] # Cat anaconda-ks.cfg
# Version = RHEL7
# System authorization information
Auth -- enableshadow -- passalgo = sha512
# Use CDROM installation media
Cdrom
# Run the Setup Agent on first boot
Firstboot -- enable
Ignoredisk -- only-use = sda
# Keyboard layouts
Keyboard -- vckeymap = us -- xlayouts = 'use'
# System language
Lang en_US.UTF-8 -- addsupport = zh_CN.UTF-8
# Network information
Network -- bootproto = dhcp -- device = eno16777736 -- onboot = off -- ipv6 = auto
Network -- hostname = localhost. localdomain
# Root password
Rootpw -- iscrypted $6 $ Zz5VMf1HPPRm0YRL $ logs/ylVGUcDYv. lrxfNodTiI/7DO1UR7carvL1EdgwQpuiwDt524f6. GR.
# System timezone
Timezone Asia/Chongqing -- isUtc -- nontp
# System bootloader configuration
Bootloader -- location = mbr -- boot-drive = sda
Autopart -- type = lvm
# Partition clearing information
Clearpart -- none -- initlabel
% Packages
@ Core # Only core
% End
[Root @ centos7 ~] # Yum groupinstall base # After installation, ifconfig, service, chkconfig, and other commands will all have
Ii. Operation-level switch
[Root @ centos7 ~] # Cat/etc/inittab # The setting method of the system running level has also changed
# Inittab is no longer used when using systemd.
#
# Adding configuration here will have no effect on your system.
#
# Ctrl-Alt-Delete is handled by/etc/systemd/system/ctrl-alt-del.target
#
# Define EMD uses 'targets' instead of runlevels. By default, there are two main targets:
#
# Multi-user.target: analogous to runlevel 3
# Graphical.tar get: analogous to runlevel 5
#
# To set a default target, run:
#
# Ln-sf/lib/systemd/system/<target name>. target/etc/systemd/system/default.tar get
I understand it here. Make a soft link to modify the default running level.
[Root @ centos7 system] # ll/lib/systemd/system/runlevel *. target # system 0-6 7 running levels, 2 3 4 running points to the same file
Lrwxrwxrwx 1 root 15 Oct 11/lib/systemd/system/runlevel0.target-> poweroff.tar get
Lrwxrwxrwx 1 root 13 Oct 11/lib/systemd/system/runlevel1.target-> rescue.tar get
Lrwxrwxrwx 1 root 17 Oct 11/lib/systemd/system/runlevel2.target-> multi-user.target
Lrwxrwxrwx 1 root 17 Oct 11/lib/systemd/system/runlevel3.target-> multi-user.target
Lrwxrwxrwx 1 root 17 Oct 11/lib/systemd/system/runlevel4.target-> multi-user.target
Lrwxrwxrwx 1 root 16 Oct 11/lib/systemd/system/runlevel5.target-> graphical.tar get
Lrwxrwxrwx 1 root 13 Oct 11/lib/systemd/system/runlevel6.target-> reboot.tar get
Iii. systemctl Management System Service
Systemctl can be viewed as a combination of service and chkconfig.
Job
|
Chkconfig, service |
Systemctl |
| Auto-Start Service |
Chkconfig -- level 3 httpd on |
Systemctl enable httpd |
| Auto-start when the service is not started |
Chkconfig -- level 3 httpd off |
Systemctl disable httpd |
Service Status |
Service httpd status |
Systemctl status httpd (service details) Systemctl is-active httpd (only show whether it is active) |
| Startup status of all services |
Chkconfig -- list |
Systemctl list-units -- type = service |
| Start the service |
Service httpd start |
Systemctl start httpd |
| Stop Service |
Service httpd stop |
Systemctl stop httpd |
| Restart service |
Service httpd restart |
Systemctl restart httpd |
Centos 7 and earlier versions all adopt the Sysvinit system to start the process management system. Because it is a serial process initiation process, the startup process may be affected by the blocking of a process. Centos 7 uses systemd. The goal is to start fewer processes as much as possible, and start more processes in parallel as much as possible (this is the conceptual basis for better performance than SysVinit ).
Introduction to systemd
RHEL7/CentOS7 default running level and terminal resolution
Detailed tutorial on installing CentOS 7.0 on a USB flash drive
64-bit CentOS 6.5 Installation Method
64-bit CentOS 6.4 dual-system installation in Win7
Precautions for installing CentOS and Windows systems
Install Windows 8 and CentOS on UEFI + GPT
Windows 8.1 and CentOS6.5 dual-system installation