A beginner's introduction to Linux environment configuration

Can you please stop making me wait for you? angry!

——When nmy waits for me for 5 minutes

Don't rush me!

——The next day when I waited for nmy for 20 minutes

An overview of getting started with Linux

1.1 Operating system

Computers are composed of hardware and software.The operating system is a type of software. Its main function is to assist users in scheduling hardware work and act as a user and A bridge between computer hardware.

Common operating systems include

  • PC端:WindowsLinuxMacOS
  • Moving end: Android, IOS, 鸿蒙系统

1.2 Introduction to Linux

Linux is an open source, free Unix-like operating system, which inherits the design philosophy of Unix with network as the core< a i=3>, is a multi-user, multi-tasking, multi-threading and multi-CPU operating system based on POSIX (Portable Operating System Interface) and Unix.

The Linux kernel was originally written by Finnish Linus Torvalds as a personal hobby when he was a student at the University of Helsinki.

Finn Linus Torvalds

1.3 Linux system composition

Linux system composition
LinuxSystem organization:

  • Linux system kernel: Provides the core functions of the system, such as: scheduling CPU, scheduling memory, scheduling file system, scheduling network communication, scheduling IO, etc.
  • System-level applications: It can be understood as the programs that come with the factory, allowing users to quickly get started with the operating system, such as:
    file manager, Task manager, picture viewing, music playback, etc.

Linux The system kernel is free and open sourceClick here to download

1.4 Linux distributions

The distribution version of Linux is a complete package of "kernel + system-level program".

Insert image description here
The main distribution versions of Linux are as follows:
Ubuntu (Ubuntu), < /span>, Debain (Butterfly), Fedora , SuSE, OpenSUSE, Red Flag Linux (domestic), Kali Linux (security penetration testing). CentOS, RedHat (Red Hat)

  • The basic commands are 100% the same
  • Some operations are different (such as software installation)

1.5 Linux application areas

Today, various Linux distributions are used in various occasions, from embedded devices to supercomputers, and have established a position in the server field. Usually servers use LAMP (Linux + Apache + MySQL + PHP) or LNMP (Linux + Nginx + MySQL + PHP) combination.

1.6 Linux vs Windows

Insert image description here

2 virtual machines

2.1 Introduction to virtual machines

Virtual machine uses virtualization technology to simulate computer hardware and install a real operating system on the virtual hardware. Linux system is not suitable for daily office use, we need to use virtual machine To obtain an available Linux system environment for learning.

2.2 VMware WorkStation installation

SelectVMware WorkStation software to provide virtual machines.
Player (free) download address: https://www.vmware.com/cn/products/workstation-player.html
PRO (paid) download address: https://www.vmware.com/cn/products/workstation-pro.html
17PRO:< /span>

	MC60H-DWHD5-H80U9-6V85M-8280D

Insert image description here

Insert image description here

Insert image description here

Insert image description here
Insert image description here
Insert image description here
Insert image description here

2.3 VMware WorkStation Configuration Check

  1. win+RStrike open traffic stile
  2. enterncpa.cpl
  3. Make sure there are two virtual network cardsVMware Network Adapter VMnet1 and VMware Network Adapter VMnet8

Insert image description here
Insert image description here

2.3 Install CentOS 7

2.3.1 Install CentOS 7 (Win)

CentOS can be downloaded from the following mirror website
Ali open source mirror station:https://developer.aliyun.com/mirror/ a>https://mirrors.cloud.tencent.com/ Tencent open source mirror site: https://mirrors.tuna.tsinghua.edu.cn/
Tsinghua University open source mirror site:

We can go to the official website:https://vault.centos.org/7.6.1810/isos/x86_64/

Insert image description here
Right-clickVMware Workstation Pro's startup program and select Run as administrator
Insert image description here
Insert image description here
Insert image description here
Insert image description here

Insert image description here
Insert image description here
Insert image description here

Wait a few minutes to automatically deploy the system
Insert image description here

Insert image description here
Insert image description here

2.3.2 Install CentOS 7 (MAC)

VMware WorkStationMac version is not provided, Mac system can be usedVMware Fusion Pro:https://www.vmware.com/cn/products/fusion.html

Insert image description here

Insert image description here
Insert image description here

Insert image description here
After opening, enter the password and the software will automatically install and open.

Insert image description here

Download the iso image just like windows
Insert image description here
Insert image description here
Insert image description here

Insert image description here
Wait a moment, the automated installation is complete

2.4 Remote connection on Linux

  • Linux The graphical page of the operating system: difficult to use and unstable.
  • In development, usecommand line form, which is more efficient, more intuitive, takes up less resources, and the program runs more stably.

2.4.1 Introduction to Finalshell

Usecommand line to learnLinux operating system, Then you must enrich the use of tools.

The command line page of operating inLinux is not very convenient. The main reasons are:VMware

  • Copy and paste content
  • File upload and download

We can operate throughFinalShell remote connectionLinux system .

2.4.2 Finalshell installation

官网:
http://www.hostbuf.com/
Windows:
http://www.hostbuf.com/downloads/finalshell_install.exe
Mac:
http://www.hostbuf.com/downloads/finalshell_install.pkg

Insert image description here
InstallationFinalshell and its dependent software
Insert image description here
In addition, currently only the 3.9 professional version has a free activation method
FinalShell_v3. 9.5.7.exe

Offline activation, run code

package demo;
 
import java.io.IOException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Scanner;
 
public class FinalShell {
    
    
    public static void main(String[] args) throws NoSuchAlgorithmException, IOException {
    
    
        System.out.print("请输入FinalShell的离线机器码:");
        @SuppressWarnings("resource")
		Scanner reader = new Scanner(System.in);
        String machineCode = reader.nextLine();
        generateKey(machineCode);
    }
    public static void generateKey(String hardwareId) throws NoSuchAlgorithmException {
    
    
        String proKey = transform(61305 + hardwareId + 8552);
        String pfKey = transform(2356 + hardwareId + 13593);
        System.out.println("请将此行复制到离线激活中:" + proKey);
    }
    public static String transform(String str) throws NoSuchAlgorithmException {
    
    
 
        @SuppressWarnings("unused")
		String md5 = hashMD5(str);
 
        return hashMD5(str).substring(8, 24);
    }
    public static String hashMD5(String str) throws NoSuchAlgorithmException {
    
    
        MessageDigest digest = MessageDigest.getInstance("MD5");
        byte[] hashed = digest.digest(str.getBytes());
        StringBuilder sb = new StringBuilder();
        for (byte b : hashed) {
    
    
            int len = b & 0xFF;
            if (len < 16) {
    
    
                sb.append("0");
            }
            sb.append(Integer.toHexString(len));
        }
        return sb.toString();
    }
}

Insert image description here

2.4.3 Use of Finalshell

  1. In the virtual machine右键——Open Terminal Open the terminal
    Insert image description here
  2. ImportationifconfigIp location

Insert image description here
3. In Finalshell click the file symbol - blank plus sign - SSH connection

Insert image description here
4. Make sure the IP address, user name and password are correct
Insert image description here
Double-click to use
Insert image description here

2.5 Virtual machine snapshot

Snapshot saves the current state of the virtual machine. The virtual machine can be restored to the saved state through the snapshot in the future. (Archived)

  1. Shut down (shutting down is more efficient for taking snapshots)
  2. Right click - Snapshot - Take snapshot
    Insert image description here
  3. Problem restoring snapshot
    Insert image description here

2.6 WSL obtains Ubuntu system environment (expansion)

2.6.1 Introduction to WSL

WSL (Windows Subsystem for Linux) is a brand-new feature brought by the Windows10 system and is used on Windows systems Linux subsystem.

  • Get Linux system environment on Windows system
  • Completely directly connected to computer hardware, no need to virtualize hardware through virtual machine
  • Lightweight and memory-saving

Insert image description here

2.6.2 Obtain Ubuntu distribution environment based on WSL2.0

WSL2.0 Request windows Edition demand database 1903, destinationwin+RTransportationwinver检查windows Print version
Insert image description here
Insert image description here

  1. Open WSL Child lineage
  • win+RStrike commandoptionalfeatures
  • choice适用于 linux 的 Windows 子系统,虚拟机平台

Insert image description here

Insert image description here

  1. Upgrade toWSL2.0, if you downloaded Linux< in the third step a i=4> If the version is lower, it can be ignored
  • Enable Windows Subsystem for Linux: Open powershell and enter:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

Insert image description here

  • Enable virtualization services
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
  • ConfigurationWSL2.0Customer certified version
wsl --set-default-version 2
  1. Anso Linux Family
  • Search from windows's own Microsoft Store and select One version installationubuntu
  • Click to use
    Insert image description here
    Insert image description here
  1. Download [WSL2 Linux kernel upgrade package] and install it normally (https://wslstorestorage.blob.core.windows.net /wslblob/wsl_update_x64.msi) and install
    Insert image description here
    5. Click to open like a normal application and set the initial user name and password. If the referenced object type does not support the attempted operation, please Reset the networknet winsock reset
    Insert image description here
    Insert image description here
  2. Linux 文 Subject System统和Windows 文 Subject System 统mutual access
  • Linux EnterWindows cdEnter the corresponding drive letter to see the file
cd /mnt/
ls
  • Access Linux under and enter in the resource manager interfaceWindows\wsl$

Three environment construction

[Crazy God Talks about Java] Server purchase and pagoda deployment environment instructions

Why do programmers need their own server?

1. As a programmer, you must publish your own website and projects
2. Practice Linux operations
3. Your own remote warehouse , remote database, remote tomcat... built on the server
4. Practice, Linux performs arbitrary environment deployment operations! Develop under Window, you are not familiar with Linux.
5.. .. ·

How to buy a server

Try to take advantage of the discount and buy it cheaply! Student phone:
If you are a student or a friend under 24, you can buy a student phone for more than 100 yuan a year
Hong Kong servers can avoid registration, but try not to connect to VPN yourself, otherwise you will be blocked!
https://www.aliyun.com/minisite/goods?userCode=0phtycgr

What to do after buying a server

The server is a remote Linux.
1. If purchased from Alibaba Cloud, security group settings need to be enabled; port mapping 1024/65535

is used to open the port, otherwise it will not be accessible from the outside
2. Obtain the public IP address of the server; modify the instance name and password. The first modification requires a restart. Use xshell to connect remotely
Insert image description here

Build environment

1. Fool style (Pagoda panel) 2. Command style (native)Insert image description here
Pagoda Linux panel installation tutorial https://www.bt.cn/bbs/thread-19376- 1-1.html
Insert image description here
Insert image description here

Insert image description here
Put it into the website for access!
For example, put tomcat directly in the webapps directory!
For special websites: open source projects, just follow your own instructions Come!

Insert image description here

Guess you like

Origin blog.csdn.net/yanqiu12138/article/details/134479778