Hexo远程部署Vultr
1. 本地操作
Hexo安装完成
Git安装完成
Git配置(Git Bash)
Git SSH Keys(Git Bash)
Hexo安装hexo-deployer-git插件
2. Vultr配置
新建用户
创建authorized_keys
安装Git和Nginx
创建Git仓库目录
创建网站目录
配置Git Hook
赋予执行权限
禁止Git用户登陆控制台
配置Nginx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23server {
listen 80 ;
root /home/wwwroot/hexo;
server_name XX.XX.com; # 域名
access_log /var/log/nginx/hexo_access.log;
error_log /var/log/nginx/hexo_error.log;
location ~* ^.+\.(ico|gif|jpg|jpeg|png)$ {
root /home/wwwroot/hexo;
access_log off;
expires 1d;
}
location ~* ^.+\.(css|js|txt|xml|swf|wav)$ {
root /home/wwwroot/hexo;
access_log off;
expires 10m;
}
location / {
root /home/wwwroot/hexo;
if (-f $request_filename) {
rewrite ^/(.*)$ /$1 break;
}
}
}重启Nginx
3. Hexo配置
_config.yml文件配置如下:
完事……
Hexo远程部署Vultr