2.2.1 Linux system version selection
Linux system refers to the general term for operating systems with linux kernel. Operating systems released by different manufacturers based on the linux kernel combined with their own programs are called releases. The mainstream releases include RedHat, CentOS, Ubuntu, OpenSuse, Debian, Fedora, Android, etc. These releases are maintained by commercial companies or open source communities. According to the market application of Internet companies, it is recommended to use the CentOS system. At present, the latest version of Centos is Centos8.2, and the market application is mainly based on Centos7 version, supplemented by Centos6. Centos6 will stop updating and maintaining this year, so this tutorial uses Centos7 .6 as the operating system platform (win10+VMware15.5+Centos7.6).
2.2.2 Download Centos system image
The Centos system is open source and free, and there are many downloadable addresses, including centos official website, Alibaba Cloud mirror, Huawei mirror, NetEase mirror, Sohu mirror, Zhejiang University mirror, Tsinghua mirror station, etc. The major domestic mirror sites are updated and downloaded quickly. Some mirror sites only provide the latest version of the corresponding main version. The mirror sites of Alibaba Cloud, Huawei, and Tsinghua University provide a full range of versions. It is recommended to use the open source mirror sites of Alibaba Cloud and Tsinghua University. Some download addresses are listed below;
Centos official website http://mirror.centos.org/centos/ http://vault.centos.org/
Alibaba Cloud Mirror https://mirrors.aliyun.com/ https://mirrors.aliyun.com/centos-vault/
Huawei mirror site https://mirrors.huaweicloud.com/os/image
Tsinghua Mirror Station https://mirrors.tuna.tsinghua.edu.cn https://mirrors.tuna.tsinghua.edu.cn/centos-vault/
NetEase mirror station http://mirrors.163.com
Quickly download centos7.6 mirror https://mirrors.aliyun.com/centos-vault/7.6.1810/isos/x86_64/CentOS-7-x86_64-DVD-1810.iso
2.2.3 Install Centos7.6 system
Install the linux system on the VMware virtual machine, prepare the system image file CentOS-7-x86_64-DVD-1810.iso, select a disk with large space, create the virtual machine installation directory D:\vm\centos7, then create the virtual machine and install the system. The following takes the installation of Centos7.6 system as an example to explain the operation steps in detail.
1) Open VMware and create a new virtual machine---->Typical---->Install the operating system later---->Select the operating system and version---->Name the virtual machine and select the virtual machine installation directory ---->Specify disk capacity---->Customize hardware configuration, CPU, memory, DVD image, network---->Complete the creation of virtual machine configuration.
2) Install Centos7.6 system
Turn on this virtual machine ----> Up arrow key to select Install CentOS 7, and Enter key to execute the installation.
Select language Chinese-Simplified Chinese---->Network hostname, set network, customize hostname---->Customize date and time, turn on network time synchronization---->Installation location, select automatic partition without special requirements You can ----> minimize by default, execute installation---->set password---->installation complete, execute restart---->log in to the system as root, ping to test the Internet connection, and check the system version.
This completes the minimal installation of the centos7.6 system, which is the most commonly used linux server.
2.2.4 Basic settings of the new linux server
1) Close SELINUX
Temporarily close setenforce 0
Permanently close sed -i's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config restart to take effect
2) Turn off the firewall
Temporarily turn off systemctl stop firewalld
Permanently turn off systemctl disable firewalld and restart to take effect
3) Set yum source
Install the basic command yum install wget vim lrzsz unzip -y
Change to Alibaba Cloud yum source:
Create a backup directory mkdir /home/backup
Enter the yum source directory cd /etc/yum.repos.d/
Transfer backup repo file mv *.repo /home/backup/
Download the Ali source file wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
Download Ali epel source wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
Run yum makecache
4) Configure static ip (bridging)
Open the network configuration file vim /etc/sysconfig/network-scripts/ifcfg-ens33
Modify the BOOTPROTO network to static, and add IPADDR, NETMASK, GATEWAY, DNS configuration, these parameters are set according to the network environment where the virtual machine is located.
BOOTPROTO="static"
IPADDR="192.168.1.102"
NETMASK="255.255.255.0"
GATEWAY="192.168.1.1"
DNS1="8.8.8.8"
DNS2="114.114.114.114"
Systemctl restart network
This tutorial is the basis for installing and using the Linux system. It is the easiest way to deploy a virtual server. The installation and use of different versions of the system are slightly different. Knowledge points such as custom disk partitions, multi-disk multi-network card mounting, file system selection, etc. , Will learn to use it step by step in subsequent tutorials. The learning and growth of linux operation and maintenance is a down-to-earth, from the shallower to the deeper, and advancing with the times, to keep the love, continuous learning, and the courage to explore can not be eliminated.