Article directory
This article introduces in detail 华为云云耀云服务器L实例
the whole process of using and building a personal blog. I hope it will be helpful to everyone.
Thanks to the coupon provided by Huawei Cloud, I can directly discount the price.
1. Introduction to Huawei Cloud Yaoyun Server L instance
1.1 Product introduction
Huawei Cloud Yaoyun Server L instance is a new generation of out-of-the-box lightweight application cloud server built for small and medium-sized enterprises and developers. Yunyao Cloud Server L instances provide rich and carefully selected application images, enabling one-click deployment of applications, helping customers to conveniently and efficiently build e-commerce websites, Web applications, applets, learning environments, various development tests, etc. in the cloud.
1.2 Product positioning
Yunyao Cloud Server L instance has a low threshold for use. If you are an entry-level user who is learning about cloud computing services, or an individual developer or small and medium-sized enterprise who needs to deploy simple applications on the server, it is recommended that you choose Yunyao Cloud Server L instance. .
1.3 Product features
Okay, that 华为云云耀云服务器L实例
’s it for the brief introduction. For a more detailed introduction, please go to Huawei Cloud’s official website to learn more. Friends who are already interested can click here to purchase directly.
2. Simple configuration
After the purchase is completed, we need to simply configure the server.
Console address: Huawei Cloud | Console
Click on the example below to enter the management page.
Opening the one in the screenshot above 流程引导
will directly display the configuration we need to make. It’s really thoughtful, so let’s follow the guidance and configure it step by step.
2.1 Administrator password setting
Click 设置/重置密码
to set the administrator password.
2.2 Configure security group
Click 配置规则
to set up the security group.
Security group configuration instructions:
- You can
更改安全组
modify the security group bound to the current instance through , and there is an operation to add a security group in the corresponding interface. - Under normal circumstances, we can directly modify the currently bound security group.
- Recommended inbound ports, just keep
22
these80
ports open.
My own security group is configured with22
,80
,443
and8888
ports.
Port introduction
port | effect | Remark |
---|---|---|
22 | SSH protocol remote connection | |
80 | HTTP protocol port | |
443 | HTTPS protocol port | If you don’t have https requirements, you can disable it. |
8888 | Pagoda Linux panel management port | Pagoda Linux panel management platform |
3. Upload personal blog
The personal blog I used to hexo
generate will not be described in detail here. Interested friends can go to the hexo official website to learn on their own.
The final generated blog file is as follows:
Next, we need to package these files and move them to our 华为云云耀云服务器L实例
server. Just use it directly sftp
.
# 1. 压缩博客文件
cd my_blog
zip -r my_blog.zip .
# 2. 链接服务器
sftp root@ip地址
# 输入密码
# 进入home目录,我们把博客文件放到这里
cd /home
# 传输文件
put {
文件全路径}/my_blog.zip
Next, we decompress the uploaded file. This time is sftp
after we have exited.
ssh root@ip地址
# 输入密码
# 进入home目录
cd /home
# ls 查看文件是否存在,不要放错了位置
# 解压缩 添加-d 解压到my_blog 这个目录里面
unzip -d my_blog my_blog.zip
At this point, we have put all the blog files 华为云云耀云服务器L实例
on the server.
4. nginx installation and configuration
The installation steps of nginx are as follows:
# 安装
apt install nginx
# 查看配置文件路径
nginx -t
Modify the configuration file as follows:
#user nobody;
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 3000;
#gzip on;
log_format access '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $http_x_forwarded_for';
server {
listen 0.0.0.0:80;
listen [::]:80;
server_name 你的IP;
access_log /etc/nginx/my_blog.log main;
location / {
root /home/my_blog;
autoindex on;
index index.html;
}
}
}
5. Start the service
# 直接启动nginx即可
nginx
6. Summary
By following the above steps, you should be able to complete the construction of a personal blog by yourself. Of course, the most important thing is our 华为云云耀云服务器L实例
server. As I walked through this step by step, I realized that it was simple and easy to use. From purchase to setup, he guided me step by step on how to operate it. The detailed introduction documents also helped me at critical moments.