当前位置:网站首页>Server journey from scratch - Yu Zhongxian integrated version (IP access server, LNMP compilation and installation, Lua environment and socket expansion)

Server journey from scratch - Yu Zhongxian integrated version (IP access server, LNMP compilation and installation, Lua environment and socket expansion)

2022-06-25 19:06:00 Fairy in feather

Purpose and need to know before looking

Purpose :

The first step is to establish the most basic connection between the host and the virtual machine server .
The most basic thing is not to create a new virtual machine installation linux System . Want to connect to each other , You have to set up the network configuration from the beginning .
This article says to start from scratch , In fact, we have to start from scratch .
PS: The test system environment in this article is Win10+VWMware Under the Linux CentOS 7
Your Collection and give the thumbs-up Is the biggest support for bloggers

Look ahead and know :

We need to reach one word “ steady ”, as well as " Patience, ".

Conscious “ Diligence ” Baidu Learn to find resources It is also a powerful skill .
This article is about purity linux centos 7 Take compile install . It is not recommended that Mengxin take “ One click installation package ” Type of quick installation .
Slow compilation and installation , But it's safe .

Where is the safety ?

1. Know what you use liunx Installed in the system Callable commands .( Know which commands can be used directly , What needs to be installed separately )
2. During compilation and installation Errors reported in a certain step can be found in time And in this process, we can quickly practice and accumulate the foundation from scratch .
3, Know what you are accomplishing What architecture should be needed Instead of blindly installing .( Steer a ship , Don't keep paddling )
4. I haven't thought of .
PS: Some tough guys who get started and get started with ECS directly .

Documents to be prepared

1.VMware ( virtual machine ) —— VM12 From now on Suggest VM15 Register machine ( Crack ) Easy to find
2.Xshell6—— It is used to connect the server in the virtual machine
3.CentOS 7.iso——iso Is the suffix of the image file (4 individual GB about )
4. And installation packages for several environments Later, I will explain it slowly according to my own needs First gather all the above 3 individual

The first step is to start from scratch :Linux Creation of virtual machine & install CentOS 7

1. install Vmware( virtual machine ) success And download it CentOS 7 Image file
2. Running virtual machines choice file -> New virtual machine
Let's start Click with the picture
 Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  This line of code is to modify Liunx The name of the network card of the system and CentOS 5 6 Unified Avoid unnecessary mistakes  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here
thus , We have taken the first step from scratch . Our virtual machine is created and installed CentOS 7 Pure system
Carry out our “ steady ” The attitude of : The new virtual machine we created is “ snapshot ” Insert picture description here  Insert picture description here  Insert picture description here
PS: snapshot —— A snapshot is similar to a snapshot of a system “ Backup ”. however “ Backup ” It's a complete copy , and “ snapshot ” It is the system return according to the operation record time point , Be similar to “ Undo until you mark the undo point ”. Can be interpreted as photoshop History in .

The first step is to start from scratch complete !!!!

The second step is to start from scratch : The host connects to the virtual machine server remotely & browser ip Web access

One 、 The host connects to the virtual machine server remotely

1. Install well Xshell 6 as well as Get ready nginx.tar.gz 、pcre.tar.gz 、zlib.tar.gz Installation package (apache It's OK , Here I'm going to demonstrate nginx web Service Framework ).—— Yes, Baidu. lnmp Environment installation package to download resources .
2. a key : Get ready for you —— Take notes —— Text .
3. With —— As Administrator —— start-up VMware virtual machine .
4. Configure the virtual machine network . Start following the diagram :
 Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here
5. Run on the host Xshell 6. Start following the diagram :
 Insert picture description here ! Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here  Insert picture description here

Two 、 browser ip Web access

1. Start in Xshell 6 Start compiling and installing on our server .( I'll use nginx Installation package Resources prepare themselves , Don't ask why I don't link to resources ? Because after a period of time, the link will fail )
2. Start Input Code + Note taking :
PS:Xshell 6 in The shortcut keys for pasting are Shift + insert

install nginx

yum Commands are front-end software management commands It can be understood as yum It is just for installation yum install It means to install all
install nginx rely on :

yum install gcc gcc-c++ openssl openssl-devel cyrus-sasl-md5

 Insert picture description here
In the future ——》 Insert picture description here choice y that will do
 Insert picture description here
Come here nginx Depend on installation to complete .

stay root Under the directory, we create a folder soft . And upload our software installation package to this folder .

mkdir soft
cd soft

 Insert picture description here

Install upload command

yum  install lrzsz

 Insert picture description here

Input rz Upload

rz

 Insert picture description here  Insert picture description here
use ls Lists the files

Unzip the installation package

tar -zxf nginx-1.10.1.tar.gz 
tar -zxf pcre-8.42.tar.gz 
tar -zxf zlib-1.2.8.tar.gz

 Insert picture description here

Enter the nginx Folder , And install and configure ( Encountered configuration related information before installing the software )

cd nginx-1.10.1
./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-pcre=../pcre-8.42 --with-zlib=../zlib-1.2.8

 Insert picture description here  Insert picture description here
configured . Then install

make && make install

 Insert picture description here
 Insert picture description here
thus ,nginx Installation completed .

Then we need to modify the firewall . take CentOS7 Default firewall As firewall, change to iptables A firewall .

close firewall also prohibit firewall Boot up :

systemctl stop firewalld.service                                    
systemctl disable firewalld.service     

 Insert picture description here

install iptables A firewall :

yum install iptables-services  

 Insert picture description here  Insert picture description here

Modify firewall profile add to 80 Port allow access settings .

vi /etc/sysconfig/iptables    

 Insert picture description here
stay -A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT Add next line of
-A INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT  Insert picture description here  Insert picture description here

Restart the firewall for the configuration to take effect & Set the firewall to power on

systemctl restart iptables.service                              
systemctl enable iptables.service   

 Insert picture description here

start-up ngxin service & And see if nginx Successful startup

cd /usr/local/nginx/sbin/ 
./nginx 
ps aux|grep nginx

 Insert picture description here

Back to host Open the browser to access the virtual machine IP Address

 Insert picture description here

Home page file storage path :

cd /usr/local/nginx/html/
ls

 Insert picture description here

.......... Update slowly , Thank you for your support . The comments section raises questions and suggestions .
Because school + Internship Update from time to time and from time to time .

原网站

版权声明
本文为[Fairy in feather]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202190528449885.html