[Personal website] Zero-based personal website construction complete tutorial 2 (web server configuration)

A complete tutorial on building a zero-based personal website (2)

The content includes: front-end construction + back-end construction + how to choose a server and domain name + connecting to a server + uploading code + website online (complete tutorial)


foreword

Tip: To undertake the construction tutorial 1, this will discuss in detail a series of steps to connect to the server. If you have any questions, please leave a message in the comment area and solve them one by one.


We achieved this kind of website effect last time. After reading this blog carefully, you can have your own website in 10 minutes. From purchasing a server, purchasing a domain name, filing and auditing, to configuring a server, connecting to a server, and publishing a website, it will be discussed in detail.

insert image description here
insert image description here

3. Choose a server?

1. Domestic or foreign?

The domestic price-performance ratio is generally lower than that of foreign countries. The price-performance ratio here refers to the price per unit of hard disk space. The stability of domestic hosts is generally not high, unless it is a VPS, but one advantage in China is that the speed is fast, and the ping delay of foreign hosts Generally not small, especially the student party users, the experience in the education network is very poor.

Second, virtual host or cloud server?

If you have a small website, personal blog, and a low budget, you can consider using a virtual host; if you have a high technical level, a sufficient budget, and your own special needs, you can use a dedicated host/VPS and the like.

3. The location of the server

The factor that affects the speed of a website's visit is the distance of the node or server from the visitor. When choosing a server area, you should do a good job of statistics on the entire distribution area of ​​the user in advance, and try to choose a server that is closer to the user.
If users are mainly customers facing the south, it is generally better to choose servers in East China and South China. If the customer is in the north, it would be better to choose a server in the North China region. Of course, if your customers are foreign users, you can also choose the server in which country according to which country the users are concentrated in. If your customers are all over the country, you can select the server in the middle and add CDN nodes to ensure normal and stable access for users in each area.

Fourth, the server purchase example

My personal suggestion is to choose an Alibaba Cloud server. The following will take Alibaba Cloud as an example to introduce the purchase process.
First, search for a lightweight server on Alibaba Cloud and
insert image description here
enter the purchase interface. My server was purchased on Double Eleven, 43 yuan per year. Now the price is too expensive, mind choosing one year, at least three months, because it will take nearly a month for ICP filing.
Choose a place closer to your location, choose Beijing here;
insert image description here

Select WordPress for the application image, the default version, and
insert image description here
CentOS for the system image, with the default version. (Some people may think that their Linux foundation is not very good. If they choose Windows, I personally recommend not to choose it. Because I chose Windows before and found that it is not as simple and easy to operate as you think, there will be frequent problems connecting to the server, which will be explained in detail later), data disk size You can choose 40G, personal website is enough!
insert image description here
Submit the order
insert image description here
and you will see a server in the console

insert image description here

Fifth, the purchase of domain names

To purchase a domain name, directly search for "domain name" on Alibaba Cloud
insert image description here
and set up a domain name by yourself, select a suffix name, and purchase it directly. After purchasing a domain name, you
insert image description here
must verify the real name, and follow the instructions in the information template for real name verification. The specific operation will not be shown here. It is particularly emphasized that it is recommended to purchase a domain name for more than 1 year, because the subsequent registration will limit the time of the domain name, and the domain name is required to be owned for more than 3 months. The final domain name review takes about 1 to 3 days, and the next step is to start ICP filing.
insert image description here

6. ICP filing

In the upper right corner of the home page, click ICP filing

insert image description here

Filing directly on Alibaba Cloud is very convenient and saves a lot of time. It is recommended to download the Alibaba Cloud APP on your mobile phone. The mobile phone filing will be much more convenient, and it will be very fast. It takes about 10 to 20 days from the price increase information to the end of the review by the bureau.
You may be wondering what is the use of ICP filing, why not start configuring the connection server now?
Publishing a website in the mainland area without an ICP record number. According to the instructions below, you can also launch the website within 10 minutes and generate your own website. However, the Ministry of Industry and Information Technology will check your website. If it finds that there is no ICP record number at the bottom of the website, or there is a problem with the ICP record number, it will immediately shut down the website.
insert image description here

Fourth, connect to the configuration server

If you are here, your cloud server and domain name have been purchased, and you have completed the above domain name review and ICP filing, watch the next operation, and take you 10 minutes to have your own website! ! !

1. Reset the server password

Remember, it must be reset, otherwise it will be troublesome later, and the website can easily be tampered with by others.
In the console, you will be prompted to reset your password when you enter, and the specific operations will not be shown here.

2. Domain name resolution

1. Search for "domain name" in the Alibaba Cloud console and enter the domain name console
insert image description here
. 2. Click Resolution on the far right
insert image description here
. 3. Click Add Record
insert image description here
. , the record value is the public network IP (you can see on the server console interface that the public network IP must not be leaked casually, this is very important!!!) The TTL value is set to 10 minutes (the smaller the TTL value is, the faster it will take effect). Finally, click OK. At this point, your server and domain name are bound together, and then start configuring the server.
insert image description here

3. Download Xshell

Download link: https://xshell.en.softonic.com/ .

Installation tutorial link: Xshell novice download and installation tutorial (super detailed) .

Four, Xshell connection server

1. First, enter the xshell interface, click on the file, and create a new one
insert image description here

2. A dialog box appears, the name is arbitrary, the host is the public IP, the port number is 22, and the other defaults, click connect
insert image description here
3. After connecting, this window will pop up, click accept and save
insert image description here
4. Enter your username and password (if using CentOS , the username defaults to root, and the password is the server password)
insert image description here
insert image description here

5. When Welcome to Alibaba appears, it proves that the connection is successfulinsert image description here

Five, configure the server

1. Personally recommend to use the pagoda panel, the following is the operation of the
pagoda panel Pagoda panel installation link: https://www.bt.cn/ .
Choose the Linux version

insert image description here
2. Then you will see the installation command of the pagoda panel.
Copy this command to Xshell and press Enter directly. It will install the pagoda panel under the CentOS server.

yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh

insert image description here
3. Installation...
Wait 2~3 minutes, the installation is complete
insert image description here
4. Finally, the external network panel address, account name and password will appear.
Copy the external network panel address to the browser, log in to the account, and enter the panel interface
insert image description here
Note: If it has been configured, get the pagoda The address only needs to enter "bt default" in Xshell to get
5. Note: If the panel address does not appear at the end, go to the Alibaba Cloud server and add a 22 port to solve it.
Enter the console, click on the firewall
insert image description here
6. Add port number 22 and port number 8888, and then try again, the panel address will appear
insert image description here
7. Log in to the pagoda panel
insert image description here
8. After logging in, choose to install LNMP (recommended), click one-click installation, and wait for the installation Once you're done, you can create a website
insert image description here

9. Click Add Site to start creating a website

insert image description here
10. Fill in the domain name, select MySQL for the database, add your database account and password, if you have an FTP service, check it and submit! insert image description here
11. Show that the creation is successful
insert image description here
12. In this way, you will get your URL (the URL under the website name, click directly)
insert image description here
13. Show that the website was created successfully, but now the website content is empty, this initial page is displayed, then we start uploader
insert image description here

Five, upload program

1. Click on the website, click on the root directory, compress your program code and upload it here, and then unzip it to www/wwwroot/your website name (be sure to unzip the correct location)
insert image description here
2. At this point, the website has been created successfully, click the URL ( website name) to view your website.
insert image description here

6. The website is online

For the sake of privacy, we do not display the content of the website. If you have any problems in any link, please leave a message in the comment area and solve them one by one!

Guess you like

Origin blog.csdn.net/weixin_48701521/article/details/121702139