——When nmy waits for me for 5 minutes
——The next day when I waited for nmy for 20 minutes
Linux from full stack development centOS 7 to operation and maintenance
- An overview of getting started with Linux
- 2 virtual machines
- Three environment construction
- [Crazy God Talks about Java] Server purchase and pagoda deployment environment instructions
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端:
Windows
、Linux
、MacOS
- 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.
1.3 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".
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
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
2.3 VMware WorkStation Configuration Check
- win+RStrike open traffic stile
- enter
ncpa.cpl
- Make sure there are two virtual network cards
VMware Network Adapter VMnet1
andVMware Network Adapter VMnet8
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/
Right-clickVMware Workstation Pro
's startup program and select Run as administrator
Wait a few minutes to automatically deploy the system
2.3.2 Install CentOS 7 (MAC)
VMware WorkStation
Mac version is not provided, Mac system can be usedVMware Fusion Pro
:https://www.vmware.com/cn/products/fusion.html
After opening, enter the password and the software will automatically install and open.
Download the iso image just like windows
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
InstallationFinalshell
and its dependent software
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();
}
}
2.4.3 Use of Finalshell
- In the virtual machine右键——Open Terminal Open the terminal
- Importation
ifconfig
Ip location
3. In Finalshell click the file symbol - blank plus sign - SSH connection
4. Make sure the IP address, user name and password are correct
Double-click to use
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)
- Shut down (shutting down is more efficient for taking snapshots)
- Right click - Snapshot - Take snapshot
- Problem restoring snapshot
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
2.6.2 Obtain Ubuntu distribution environment based on WSL2.0
WSL2.0 Request windows Edition demand database 1903, destinationwin+RTransportationwinver
检查windows Print version
- Open WSL Child lineage
- win+RStrike command
optionalfeatures
- choice
适用于 linux 的 Windows 子系统
,虚拟机平台
- 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
- Enable virtualization services
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
- ConfigurationWSL2.0Customer certified version
wsl --set-default-version 2
- Anso Linux Family
- Search from windows's own
Microsoft Store
and select One version installationubuntu
- Click to use
- Download [WSL2 Linux kernel upgrade package] and install it normally (https://wslstorestorage.blob.core.windows.net /wslblob/wsl_update_x64.msi) and install
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
- Linux 文 Subject System统和Windows 文 Subject System 统mutual access
- Linux EnterWindows
cd
Enter 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
Build environment
1. Fool style (Pagoda panel) 2. Command style (native)
Pagoda Linux panel installation tutorial https://www.bt.cn/bbs/thread-19376- 1-1.html
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!