1. Purchase a cloud server
1.1 introduction
Before buying a cloud server, do not just look at the price, do not look at which cheap, which more preferential, you buy which, you have to combine your own needs.
If your cloud buy server purpose, just to learn Linux, or build a blog site, play by yourself, do not require visits, then you buy a minimum with the server is completely enough.
If you buy the purpose of cloud server, it is to develop a website to make money, hope visit volume is bigger had better, that still suggests you buy configuration a bit taller cloud server.
Because if you are cheap and buy a server that can not meet your needs, when you want to expand, you will find the cost of expansion, far higher than you re registered a new member, enjoy preferential activities, and then buy a high cloud server cost, much higher. But if you buy a new server, wouldn’t the server you bought before be a waste?
So, before buying, first of all must figure out their use to buy the server!
1.2 Foreign cloud servers vs Domestic cloud servers
🎯 Advantages of foreign servers:
- Free for the record
- No regulation
- High degree of freedom
- High cost performance
🎯 Domestic server advantages:
- Compare the usage habits of composite people
- Better stability
- Customer service and work order system respond quickly
- There are also many preferential activities
- Provide domain name and record service (in fact, there are also free record server in China)
1.3 Personal Recommendation
In China, there are such as Ali Cloud, Tencent Cloud and Huawei cloud, etc. Here I recommend Ali Cloud server (I also use it personally) :
If we are interested, we can take a look at the evaluations and comparisons between these players: Ali Cloud, Tencent Cloud, Baidu Cloud, Huawei cloud
However, I recommend UCloud. The server I use to build my personal website is purchased on UCloud as follows:
1.4 Cloud Server Purchase Procedure (Discount)
Ali cloud server and UCloud cloud host UHost I have purchased, here is a detailed explanation of the UCloud cloud server purchase process!
1.4.1 Find the activity zone11.11 carnival
1.4.2 choiceHong Kong
Cloud server of the region
Personally, I think the cloud server with 1 core 2G configuration is enough for me. After all, I just build my personal blog website.
⭐ recommended cloud server in Hong Kong, China, free of filing really save a lot of time.
1.4.3 Confirm the purchased configuration
🔥 Mirroring: CentOS 7.2 64-bit
🔥 Bandwidth: 1 MB
I selected CentOS 8.3 64-bit before and then the problem of Docker configuration failure appeared later, so I suggest to follow my configuration!
By the way, what is demonstrated here is the price of the cloud server for one year, because I have bought it in one month, and the purchase quantity has reached the upper limit.
If an incorrect image version has been configured, perform the following operations to restore the image:
Remember! Change the system disk size to 40 GB or UCloud will let you pay the difference:
1.4.4 became ✔
2. Purchase a domain name
Buy a domain name from NameSilo:
2.1 Searching for Domain Names
Search for the domain you want to buy in the search bar, it may be purchased:
2.2 Selecting a Domain Name
The domain name wu-yikun.top was bought by me, so the search will show “Try To Buy”.
Note that the units here are us $** $**, domain names really are passwords for the wealth of a handful of people, even small countries.
2.3 Purchasing a Domain Name
Add to Checkout and then Checkout. Don’t buy a value-added service.
After payment, you can own the domain name!
2.4 Configuring Domain Name Mapping and waiting for Domain name Resolution
The purchase of a domain name does not automatically map to the host IP address of the cloud server you purchased, but also requires domain name mapping configuration (i.e., domain name resolution)!
Select Domain Manager.
Manage DNS for this domain:
Then configure the domain name mapping as shown in the following figure. After the configuration is successful, wait for the domain name resolution.
Most service providers promise to deliver within 24 hours, but usually within one or two hours.
The domain name the site bought takes about 30 minutes to resolve, which is relatively fast.
If your company has an internal DNS server, you may have to wait for its cache to be updated, which can take up to 48 hours.
GTLDS take effect within 2 hours and NTLDS take effect within 24 hours. Domain name resolution needs to be synchronized to the ROOT DNS server, which is refreshed periodically. Domain names can be accessed only after the root DNS server is refreshed.
New parses take effect in about 10 minutes and take up to 24 hours. Modifying parses takes longer.
🌹 Domain name resolution takes effect, that is, domain name and IP binding process!
🌹 Add the knowledge point (resource record) :
Image source: Computer Networking – The Top-down Approach
2.5 Domain name Resolution Takes Effect
Ping the purchased domain name address. If the following result is displayed, the domain name is successfully resolved.
🌹 Note: Request timeout does not affect! As long as the domain name followed by the IP address can!
The following information is displayed: Ping www.wu-yikun.top [xx.xx.xx.xx] 32 bytes of data are available
C:\Users\57715>ping www.wu-yikun.top ping www.wu-yikun.top [xx.xx.xx.xx] With 32 bytes of data: Request timed out. .Copy the code
Here the domain name related configuration operation is over!
3. Pagoda Linux panel configuration
What pagoda panels can do:
- One-click Configuration of the server environment (LAMP/LNMP)
- LNMP: Linux + Nginx + MySQL + PHP
- LAMP: Linux + Apache + MySQL + PHP
- One-click safe restart
- Create and manage website, FTP and database with one click
- One-click SSL certificate deployment
- One-click deployment source code (discuz, wordpress, Dedecms, Z-blog, microengine, etc.)
- One-click configuration (periodic backup, data import, pseudo static, 301, SSL, subdirectory, reverse proxy, switch PHP version)
- 1 click install common PHP extensions (FileInfo, INTL, OpCache, Imap, memcache, APC, Redis, IonCube, Imagick)
- Database one-click import and export
- System monitoring (CPU, memory, disk I/O, network I/O)
- Firewall Port Permission
- SSH on/off and SSH port change
- Disable PING on or off
- Convenient and efficient file manager (upload, download, compress, decompress, view, edit, etc.)
- Scheduled tasks (periodic backup, log cutting, shell scripting)
- Software management (one-click installation, uninstallation, version switching)
Simply put ❗ ❗ ❗
Large website programs are installed on the server, the server is using the Linux system, server maintenance needs to remember a lot of Linux commands, which is very troublesome. The advantage of the panel is that the server can be maintained through an interactive interface, such as updating the system, adding websites, modifying Settings, and so on. In the past, you need to remember various commands, but now you can just click the button through the panel, saving time and effort.
3.1 Xshell Remotely Connects to the Server
First log in Xshell to remotely connect to the UCloud cloud server you just purchased:
Then run the following command to install the Pagoda Linux panel on the cloud server (CentOS) :
💖 Installation instructions for other Linux distributions can be found in: Pagoda Linux Panel Installation Tutorial.
Yum install wget - y && wget - O the sh http://download.bt.cn/install/install_6.0.sh && sh the shCopy the code
After the installation, the default information of the pagoda Panel will be displayed, and then access the address of the external Panel to jump to BT-Panel, enter the username and password just provided to log in.
⭐ If you forget the user name, password, and entry of the BT Pagoda panel, run the following command:
[root@xxx ~]# /etc/init.d/bt default ================================================================== BT-Panel default info! = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = the network panel address: http://xxx/xxx network panel address: http://xxx/xxx * The following is only the initial default account password. If you cannot log in, run the bt command to reset the account/password. XXX If you cannot access the panel, release the following panel port [8888] in the security group Please check whether the firewall/security group has released a panel [8888] port = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =Copy the code
3.2 Adding a site through the BT panel
When you first log in to the pagoda panel to install the kit: Select LNMP(recommended) and check the speed install:
As follows: Main interface of the pagoda panel
Next add the site:
3.3 Adding an SSL Certificate
🍻 Note: Before adding an SSL certificate, ensure that domain name resolution takes effect. So be patient until then.
Click To enable forced HTTPS.
If ⭐ forces HTTPS, addresses accessing Wu-yikun. top are converted to https://wu-yikun.top! By default. ⭐ can also be accessed directly at https://wu-yikun.top! But direct access to http://wu-yikun.top will not be accessible!
If you do not enable it, you can also access wu-yikun. Top will show unsafe!
3.4 Configuring a Reverse proxy
Remember to comment out the configuration for the rest of the location:
⭐⭐⭐ Reverse proxy configuration The default access port 80 of the website is assigned to port proxy 8090. So then access to the Wu-yikun. top address will be mapped to https://wu-yikun.top:8090 instead of https://wu-yikun.top:80 by default!
Location / {proxy_pass http://127.0.0.1:8090/; rewrite ^/(.*)$ /$1 break; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Upgrade-Insecure-Requests 1; proxy_set_header X-Forwarded-Proto https; }Copy the code
3.5 Enabling the Firewall: Permits specified ports
Security group release tutorial, if you want to use all the functions of the pagoda completely, you also need to release the following ports
- Port 443: HTTPS
- Port 888: the default phpMyAdmin port
- ⭐39000-40000 Port: Linux
- 20 Port: FTP active mode data port
- 22 Port: indicates the SSH remote service
- Port 21: default FTP port
- ⭐8888 port: default port on the Pagoda Linux panel
- Port 80: the default port of the site
- ⭐8090 port: indicates the website port specified by the reverse proxy
💖 Explains why port 8090 is allowed:
🧠 except port 8090, the rest are some ports that must be allowed originally, and port 8090 is allowed only because the reverse proxy we set up uses port 8090 to proxy port 80 (the default website port). So a visit to my domain wu-yikun.top will automatically lead to Wu-yikun. top:8090 (but the URL will not show port 8090), so you need to release the port!
4. Install the Docker Engine on CentOS
⭐官网教程 : Install Docker Engine on CentOS ⭐英文官网
4.1 Uninstalling Old Docker Versions (Optional)
If the construction is carried out in strict accordance with the order of this article or Docker has never been downloaded, there is no need to execute the following uninstall command, otherwise it is better to execute it.
sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
Copy the code
4.2 Installing the yum-utils package
🍺 Run the following commands in sequence:
sudo yum install -y yum-utils
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
Copy the code
4.3 Installing the Docker Engine
sudo yum install docker-ce docker-ce-cli containerd.io
Copy the code
Install Docker to prepare for Halo!
5. Deploy Halo with Docker
Halo Documents
⭐ Run the following commands on Xshell:
5.1 Creating a Working Directory
mkdir ~/.halo && cd ~/.halo
Copy the code
5.2 Downloading the Example configuration file toWorking directory
wget https://dl.halo.run/config/application-template.yaml -O ./application.yaml
Copy the code
5.3 Pull the latest Halo image
Docker pull halohub/halo: 1.4.15Copy the code
5.4 Creating a Container
Docker run -d --name halo -p 8090:8090 -v ~/. Halo :/root/. Halo --restart=unless- Stopped halohub/halo:1.4.15Copy the code
- -it: enables the input function and connects to the pseudo terminal
- -d: indicates the background running container
- –name: Specifies a name for the container
- P: –Port mapping in the format of
Host (host) port: container port
, can be inapplication.yaml
Configuration. - -v: indicates the mapping of the working directory. The format is -v. Host path :/root/.halo, which cannot be modified.
- – restart:You are advised to set this parameter to
unless-stopped
Automatically launches Halo containers when Docker starts.
5.5 Visit personal Website (Witness miracle Moment)
🏆 Open https://ip: port number to view the installation boot interface. I can visit https://wu-yikun.top here!
💡Tip: If domain name access needs to be configured, you are advised to configure reverse proxy and domain name resolution before initialization. If you cannot access the server using http://ip:, go to the server vendor’s background and add the port number to the security group. If the server uses the Linux panel, check whether the Linux panel has security group configurations, and add the port number to the security group (that is, the allowed port).
🌹 Front desk address: Wu-yikun.top
🌹 Background address: Wu-yikun. top/admin
⭐ for more on Halo: halo.run/themes.html
🎯 welcome to visit my personal website ~ 💦 my personal blog website has just been deployed online, currently busy with the final exam, the holiday to maintain (some)!
We hope this article will help you 🧠 feel free to leave your thoughts in the comments 🌊, we will discuss and share 🔥