# 个人博客搭建
# 1. 服务器博客构建
# 1.1 域名购买
- 域名购买网址 (opens new window)
- 查询期望域名是否注册
- 注册购买域名
# 1.2 服务器购买
- 云服务器购买 (opens new window)
- 安全组设置 (opens new window)
- SSH密钥设置 (opens new window)
- 使用 SSH 登录 Linux 实例 (opens new window)
- 使用VSCode远程登录服务器
Host blog
HostName 119.45.13.127
User root
Port 22
IdentityFile //Users/liam/Desktop/code/liamhuo.cer
1
2
3
4
5
2
3
4
5
yum -y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel
yum install nginx
systemctl restart nginx
1
2
3
2
3
安装Git (opens new window)
sudo dnf install git-all安装Node/NPM
yum install epel-release
yum install nodejs
npm install -g n
# 使用或安装稳定的正式版本
n stable
# 修改默认Node版本
which node
vim ~/.bash_profile
export N_PREFIX=/XXX # 注:通过第一步获取到的当前Node的安装路径
export PATH=$N_PREFIX/bin:$PATH
source ~/.bash_profile
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
# 1.3 网站备案
- 服务器 + 域名备案 (opens new window) - 需要域名/身份证/居住证
- SSL证书
- DNS解析指向
- 七牛云CDN部署
- 安装Node/NPM/Git