Teach you to quickly build your own website without any foundation (VPS server + pagoda + typecho)

Insert image description here

1. Preparation work

First of all, we need to prepare a server, which can be used at home or abroad. Newbies recommend that all major domestic server manufacturers (Huawei Cloud, Tencent Cloud, Alibaba Cloud, etc.) are suitable. Most domestic servers have student discounts, which are basically less than 100. In 2017, the cheapest server is enough. Of course, if there are friends who are learning Linux development like me, they should consider which cheap manufacturers to use. After all, they are all students, because the author himself uses Microsoft. server, so I haven’t used the domestic server in detail yet, so I can’t make a recommendation; the second is a domain name of your own. Regarding the application for the domain name, it is recommended to search on the Internet. If you just want to play, of course, the cheaper The better. The domain name that the author applied for only cost a few dollars a year. Now that the two conditions are ready, you only need to follow me step by step. I guarantee that you can build it successfully.

2. Log in to the server and install the Pagoda panel

Let us mention here that if the server system installation is used for website construction, it is recommended to install Centos or Ubuntu directly. As for the version, it does not need to be the latest, because the latest version usually has some unpredictable problems. These two types are relatively stable. Of course, if you If you have studied other Linux systems, you can also install them according to your own preferences.

Next we useXShell or otherssh tools to log in to the server we purchased

The author here is using theUbuntu20.04version

Enter the following command and press Enter

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

Ubuntu/Deepin installation script
wget -O install.sh http://download.bt.cn/install/install-ubuntu_6.0.sh && sudo bash install.sh ed8484bec

Debian installation script
wget -O install.sh http://download.bt.cn/install/install-ubuntu_6.0.sh && bash install.sh ed8484bec

Fedora installation script
wget -O install.sh http://download.bt.cn/install/install_6.0.sh && bash install.sh ed8484bec

Before entering this command, we need to switch to the root account first and then execute it, otherwise it may prompt that the permissions are insufficient. If it is your first time to use it and you do not know how to set up the root account, then we enter it first.

passwd root

Then enter the password you want to set and press Enter. You also need to confirm once ( It should be noted here that there is no feedback when entering the password under Linux. It means you enter the number. You have to remember that pressing Enter means the input is complete)

After setting up, there are two ways to execute the above command:

The first way is to directly enter the command abovesudo+ and press Enter. Then it will prompt us to enter the password. This password is the one aboveroot Password, we can enter and press Enter for the subsequent sentences involving y/n?y

In the second way, we can directly switch root accounts first. We first enter su and press Enter, then enter root Enter the password, switch to the root account and directly execute the above statement

The effect is as follows (here I installed it directly with the root account):

Insert image description here

After waiting for the installation to complete, the following interface will appear.

Insert image description here

The first step is to copy these important information and save it to notepad. We will use it later. After copying, we can close this panel.

First we look at the first sign,Please allow the port in the security groupXXXXX, we go to ourselves The purchased server panel, take my Microsoft cloud here as an example

This is theNetwork option. Some server manufacturers may directly use the Security Group Options

Insert image description here

When we look at this picture, we should pay attention to the followingBoth the inbound port and the outbound port must be set, we added the port access of the pagoda above ( here I am 28132, you may not be it, please check it yourself), except For this we also need to add the access rules for port 443

After completion, enter the second step and see the external network panel address it gives. We copy it, open the browser, paste it and press Enter , the browser will prompt that it is not safe. This is because there is no certificate here. Don’t worry about it. Just continue to visit, and then we will see the following interface

Insert image description here

The account and password are the ones he gave us earlier. Enter them to log in. Users who use Pagoda for the first time may need to bind their mobile phone numbers. I will not demonstrate here.

3. Pagoda panel environment construction and site settings

After we log in successfully, the following interface will pop up
Insert image description here

We see the recommended box. Check it like I did. For MySQL, choose 5.6 and for PHP, choose 7.2. Because we need to install other tools later. Too high a version may cause incompatibility. Then click one-click installation.

It may take a long time here. Let’s set up our DNS site first. We go to the Cloudflare official website. Generally, the domain name we buy will be hosted on this website. If not, you can search for how to host it after purchasing the domain name. Compare the steps. Simple, then host your domain name on this website. Why you should use this website, I will talk about it later.

Cloudflare官网https://dash.cloudflare.com/

After your hosting is completed, we enter the Cloudflare website to manage our domain name

Insert image description here

We see this interface. First we select the website column, then click on our domain name and enter settings. If your interface is in English, there is a button in the upper right corner to switch to Chinese. Next we see the following interface
Insert image description here

The first step is to select the DNS tab, and then we click to add a record. How do we fill in the name here? For example, what we want to build is a blog website. Generally, we buy top-level domain names, so we add blog in front of our domain name. For example, I bought a domain name yulao.com, then I will fill in blog here, then we will get a second-level domain name to build our website. A top-level domain name can have many second-level domain names, and then we will Fill in the IPv4 address field with our server address, turn off the proxy status first, and then save it

After the Pagoda environment is installed, we select the website border on the left, and then click Add Site at the PHP project, as shown below

Insert image description here

Fill in the domain name. For example, if you set up a blog on Cloudflare above, we will fill in blog.你的顶级域名. Fill in any remarks. The database account and password will be automatically generated. You can also set it yourself. Others are defaulted. Then we submit

Then we click settings
Insert image description here

We see the following interface

Insert image description here

Select the SSL option, click Let’s Encrypt, check our domain name, and click Apply

Insert image description here

After generation, as shown below

Insert image description here

We turn on forced HTTPS and click Save. Only with the certificate can we allow our website to be accessed normally through the https protocol. Otherwise, access may be prohibited by the browser. Next, we enter our domain name in the browser and press Enter to see it. The following interface is

Insert image description here

Seeing the little lock means that our certificate installation was successful. Seeing this interface means that our website has taken initial shape, and we are getting closer to success! ! !

4. Set up Typecho environment

Typecho官网http://typecho.org/download

Insert image description here

Here we can directly download the official version. After the download is completed, we return to the Pagoda panel, click on the file tab on the left, delete all the files inside, then drag the Typecho compressed package we downloaded directly into it, and double-click to decompress it. As shown below

Insert image description here

Then when we visit our website, we will see the following interface

Insert image description here

We click next

Insert image description here

Here we need to add database information. We open the database option of the Pagoda panel, copy the information, paste and confirm.
Insert image description here

Then come to the interface below, set a username and password to manage the website backend, fill in the email address truthfully, and then click to continue the installation.

Insert image description here

Then see the following interface

Insert image description here

Control panel to enter the background
Insert image description here

Here we first go to the pagoda to add a theme template

Compared to joe main questionhttps://github.com/HaoOuBa/Joe

Let’s download this template theme first. There are many good-looking free themes on the Internet. Just search for Typecho free themes. Let’s do the experiment first.

After downloading the theme, open the Pagoda panel file option and open it in sequenceusr->themes, then drag the theme package we downloaded directly into it and double-click to unzip it

Insert image description here

We return to the background management page above. We can enter it directly in the address bar域名+/admin to enter the background directly, and then we click Change Appearance

Insert image description here

Enable the theme we just added, then enter the domain name in the address bar to view our website

Insert image description here
Insert image description here

We have built a blog website. All the label icon backgrounds we see here can be edited directly using buttons in the background. You still need to explore it yourself!

The backend supports blog writing in Markdown format, and also supports account management, including some weather plug-ins, music plug-ins, etc., all with graphical interface buttons for replacement.

Insert image description here

In addition, different themes may have more powerful functions, which can help novices quickly build and beautify their own websites.

Insert image description here

Of course you can also change the code directly

Insert image description here

You can also directly change codes and files through Pagoda's background file management, which is very convenient.

The blog website interface I built before (I didn’t have time to maintain it, so I closed it)
Insert image description here

Spend more time polishing it, I believe you can do better than me

5. Turn on CDN protection

If you plan to maintain your website for a long time, it is recommended that you turn on this function so that you can better protect your website and reduce the possibility of being attacked to a certain extent.

Why do you say that? Because if you don’t enable it, it will be easy to expose your real IP, which will make it easy for others to attack your website. Then you may wonder why you want to attack my small website. It’s very simple, practice! Let’s see how we can get your IP under normal circumstances, that is, without CDN protection turned on. We can ping our own domain name directly in the CMD command box.

Insert image description here

You can see your real IP. This is actually quite scary, so how do we solve it?

We only need two simple steps. We then open Cloudflare and return to the interface where we set up DNS.

Insert image description here

Just open the proxy and save it. Now we ping our domain name again.

Insert image description here
This IP is no longer our real IP. It should be noted that although it plays a protective role here, we will make the access speed slightly slower because it passes through the CDN transfer, but the impact is not big. My delay here is slightly The reason is that the author's server is overseas. At this point, all the construction process is completed. I believe you must have successfully built it. If you encounter any problems that cannot be solved, you can leave a message below or send a private message to the author.

Guess you like

Origin blog.csdn.net/kingxzq/article/details/133819852