Java web small project_personal homepage (1)-cloud environment construction and project deployment

This article is a study note, review the lesson a few days agoLi WeijieOpen class taught by the teacher: java network project: personal homepage that makes interviewers shine .

Teacher Li Weijie’s teaching process:

[Rent cloud server]>[Use Aliyun polarDB database]>[Final project deployment]>[Project access acceleration]>[Code analysis]

As an open class, the teacher splits and analyzes these cumbersome steps from the perspective of everyone's zero foundation. Deploying the finished project on the first day allows us to see the final finished product first, and then analyze the code. Generally speaking, I feel very well understood and my thinking is very clear.

A quick glance at the results of the completion of the project:

Insert picture description here

Course Resource Pack Extraction code: th1z

Here are some supplements to knowledge

README: Layout overview

Insert picture description here

1. Alibaba Cloud's ecs server construction

Rent a host on Alibaba Cloud and deploy the final project content on the host

Alibaba Cloud ecs server setup process

Supplementary explanation of the operation:

(1) Server configuration network security group: who can access the server

端口范围:8888;授权对象:本机的公网IP

8888 is the default port number of the cloud server management software (pagoda) used later, which means that only computers under this IP and software under port 8888 can access this server.

I went to log in to the pagoda software after a period of time, but I couldn't get in. It turns out that the public IP (the one from Baidu's search IP) has changed and needs to be added to the security group again.

端口范围:80;授权对象:0.0.0.0/0

If the IP is 0, it means that any IP can be accessed, which means that everyone is allowed to access the personal homepage project.

(2) Pagoda control panel: Cloud Computer Manager

Because we chose the Linux operating system when we chose the server mirroring source, you may not be familiar with the use of this operating system, but other businesses have done it for you, and it is simple for you.

This pagoda control panel is equivalent to a computer butler, with a graphical interface, it is convenient for you to manage the computer, monitor the running status of the computer, and facilitate the download and installation of software.

(3) Why do small and medium-sized enterprises like to go to the cloud?

Because companies are demanding more and more programmers, you must know how to develop, but also know how to test, and you must also be good at operation and maintenance. You can only say that you are a qualified back-end development engineer after you have these three capabilities. It is difficult to win the operation and maintenance. It is better to spend money on servers. These companies also save the wages of operation and maintenance personnel.

(4) Tomcat server middleware

The personal homepage project can be accessed by others, and there must be a software on the computer (virtual host) that can expose the project for others to visit. This software is very much used in java web development: tomcat server middleware.

Expose some files in a certain folder on the computer, so that others can use it to access this folder through the URL.

(5) Why in the tomcat settings, the port number of tomcat that was originally 8080 is changed to 80?

The port number originally used by tomcat is 8080, and 80 means that the default port number of the HTTP protocol is used. When others visit this website, they don’t need to enter "URL+ :8080"

Port 80 is open for HTTP. This is the most frequently used protocol for Internet access. You can access the website by adding ": 80" to the URL, but because the default port number for browsing web services is 80, you only need to enter the URL. No need to enter ": 80".

(6) The URL is a folder

Understand that this URL is actually a folder, and you can access the file by accessing the address of the folder.

such as:

Insert picture description here
In a new webpage, open the picture 1.img under the img under the source under the Root path

Insert picture description here

It can be seen that at this step, we have been able to share the resources of the server with others , and others can access the things we uploaded through such a URL.

(7) utf-8 in the index file

In the index file, there pageEncoding="UTF-8"is a line for encoding settings. For the time being, you should understand the encoding that supports Chinese display.

The computer itself cannot store any words. Computers can only store binary values ​​of 0 and 1. If computers want to be popularized for civilian use, they must know these words in order to better help everyone change their lives.

Then give it a dictionary, the combination code of 01 numbers represents the text. UTF-8 is a variable-length character encoding for Unicode, also known as the universal code.

If there are garbled codes, there is a high probability that your computer and the cloud computer are not using the same code (different dictionaries)

2. PolarDB: Alibaba self-developed database

Alibaba self-developed PolarDB usage process

Before creating and generating a personal resume, we need to obtain the information entered by the user, and then put it in the database for unified arrangement and management.

(1) Isn't it fragrant to use mysql?

Also fragrant. But it also needs to build an environment, need to download a variety of software and it is more cumbersome.

Many companies like to use cloud databases when they use databases, which saves the salary of operation and maintenance personnel, and the performance is relatively high. Compared with the open source mysql, it is a 5 times performance improvement and fully supports the operation of mysql.

For me, it means to focus on learning.

(2) Data planning of the database

Insert picture description here

The specific structure of this format is established by the DBA (Database Administrator).

Here we only need to import this file into the database, and then we can create the corresponding format in it.

Insert picture description here

(3) Tools for database management: DMS

What tools are used to link and manage this database? Use Alibaba Cloud's own, very easy to use. (You must have permission to apply to make major changes to the database. We are the highest administrator, so we directly approve and approve it)

DMS cluster is a graphical data management tool provided by Alibaba Cloud. It is a management service that integrates data management, structure management, access security, performance and optimization.

(This software also has a local software version that can be downloaded)

(4) Set the IP whitelist of the database cluster: who can access the database

Set who can access the database: computers (public network) can access, and Alibaba Cloud's cloud server (public network)

The database also needs to apply for a public website that can be accessed. Through this address, we can access the database in tomcat.

(5) Log in to the database with DMS and deploy the data format

In the heiheihei database, there are another list of 5 libraries, we will create the database kkbdb. Divide the data format of the kbbdb database: [Data Import]> [Batch Data Import]

Insert picture description here

(6) Deploy the code and replace all content in the root

After the replacement is completed, the configuration of the database must be modified.

The following file is the configuration of the data warehouse information: modify it to your own database address, account number, and password

Insert picture description here
In addition to the url, add the name of the database
Insert picture description here

Note: Do not add spaces randomly. For example, if there is a space before the password, the space will also become a part of the password.

url is the public network address of the polarDB database cluster

Insert picture description here

3. The evolution of the development model: the development process of the Dachang project

Efficiently and quickly complete the software life cycle management through automated tool collaboration and communication.

In the current era, there are more and more large project requirements, and things are becoming more and more complex. The big projects mentioned before now seem to be small projects.

(1) Waterfall style

Development methods still used by second- and third-tier small businesses

Insert picture description here

If there is a problem in the test, this mode will have a big drawback: it is difficult to modify.

When we wrote 50,000 lines of code, the test found that there was a problem with the logic of the code written, something was wrong, and we needed to change it. When I changed it, I found that this code was called in 50 places, and there were 50,000 lines of code that needed to be adjusted.

It's exploded, the feeling at this time is that I don't want to fucking do it anymore. I feel that this project is going to be overthrown and restarted. The programmer developed at this time is the one who suffers the most.

(2) Agile development model

Insert picture description here

A small feature is delivered every two days, and this small feature is handed over to testers for testing. After the test, if there is a problem, change it immediately, and change it in time. (Continuous delivery concept)

It is mostly seen in second-tier cities, and there are also drawbacks. In the end, the operation and maintenance may say that your architecture deployment method is unreasonable.

The architecture used when a project is concurrently at the 10,000 and million level is definitely different. The corresponding code is not written in the same way.

(3) The architectural form of microservices: DevOps development model

Taobao has many various functions. The Tmall, bookstore, and flying pigs that are divided into later are all products that Taobao slowly extended, and they were originally Taobao. Taobao has grown bigger and bigger, so each function in the project has been separated into independent application software.

At the same time, Taobao, Tmall, Fliggy, etc. all share an account system and an order system. A large application is divided into n small applications to write, and finally n small applications are put together like building blocks. Big software.

It can be understood like this:

Insert picture description here

The logic is easy to understand, but the real implementation is very complicated. It will not be expanded in detail here.

Guess you like

Origin blog.csdn.net/weixin_44742824/article/details/115104493
Recommended