SiriBlog

siriyang的个人博客


  • 首页

  • 排行榜

  • 标签115

  • 分类37

  • 归档320

  • 关于

  • 搜索

Hexo:将博客部署到腾讯云服务器

发表于 2020-05-16 更新于 2021-10-29 分类于 计算机 , 环境 阅读次数: Valine:
本文字数: 1.5k 阅读时长 ≈ 1 分钟

  昨天莫名其妙博客的评论系统出问题了,没法读写数据库。今天更惨,博客直接访问不了了,查看DNS解析和Coding管理界面都没有问题。没办法,只好将博客搬到空闲已久的腾讯云服务器上去。之前放Coding和GitHub的page上都有出现访问速度慢,甚至有些用户无法访问的情况,不知道腾讯云的服务器会不会好一点。

  网上的博客部署教程已经很多了,本次主要参考:yearito’s Blog | Hexo搭建个人博客系列:部署上线篇

  本文用于记录部署过程中遇到的一些问题及解决方案。


Note1

  在服务器上创建一个新用户git:

1
2
$ sudo adduser git
$ sudo passwd git

  为git用户赋予超级用户权限,首先要打开/etc/sudoers,然后作如下修改:

1
2
3
4
5
6
7
8
9
10
11
12
13
## Next comes the main part: which users can run what software on 
## which machines (the sudoers file can be shared between multiple
## systems).
## Syntax:
##
## user MACHINE=COMMANDS
##
## The COMMANDS section may have other options added to it.
##
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
siriyang ALL=(ALL) ALL
+ git ALL=(ALL) ALL

Note2

  在服务器上安装git:

1
$ sudo yum install -y git

Note3

  在服务器上安装nginx:

1
$ yum install -y nginx

Note4

  重启nginx的时候报错:

1
nginx: [error] open() "/run/nginx.pid" failed (2: No such file or directory)

  解决方案为先运行命令:

1
$ nginx

参考资料:https://blog.csdn.net/quanqxj/article/details/89375436


Note5

  配置nginx.config,将项目部署到8080端口:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# siriblog
server {
listen 8080;
server_name _;
root /var/www/blog.siriyang;

# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;

location / {
}

error_page 404 /404.html;
location = /40x.html {
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
-------- 本文结束 感谢阅读 --------
相关文章
  • Docker:基于base_centos安装SuperSet
  • Docker:基于base_centos安装MySQL
  • Docker:基于CentOS8的基础镜像制作
  • BRAT安装与使用
  • Docker:手动下载安装Docker镜像
觉得文章写的不错的话,请我喝瓶怡宝吧!😀
SiriYang 微信支付

微信支付

SiriYang 支付宝

支付宝

  • 本文标题: Hexo:将博客部署到腾讯云服务器
  • 本文作者: SiriYang
  • 创建时间: 2020年05月16日 - 14时05分
  • 修改时间: 2021年10月29日 - 18时10分
  • 本文链接: https://blog.siriyang.cn/posts/20200516142853id.html
  • 版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明出处!
Linux 环境 CentOS Hexo
Hexo:使用七牛云进行CDN加速
考研复试口语高频话题
SiriYang

SiriYang

努力搬砖攒钱买镜头的摄影迷
320 日志
33 分类
88 标签
RSS
GitHub E-Mail
Creative Commons
Links
  • 友情链接
  • 作品商铺

蜀ICP备19008337号 © 2019 – 2025 SiriYang | 1.7m | 25:41
0%