使用github page+阿里云域名搭建个人博客

1、下载git

2、安装node.js

3、安装hexo

4、下载主题,然后hexo clean | hexo g | hexo d素质三连

5、阿里云购买域名

6、hexo主目录下source文件夹下新建名为CNAME的文件,文件里面写入zhangxianxin.top(你的域名)。

7、阿里云添加三条域名解析记录

第一条为CNAME类型的解析记录,主机记录为WWW,记录值为你的博客GitHub page域名,我的是mmrblack.github.io。
后两条类型为A,主机记录为@,记录值分别为185.199.110.153和185.199.110.154。
由于我的域名还绑定了腾讯企业邮箱,以上顺序不可颠倒。

搭建ss通道

我的系统为Ubuntu 18.04

1、安装pip

1
2
3
sudo apt-get update
sudo apt-get install python-pip
sudo apt-get install python-setuptools m2crypto

2、安装shadowsocks

1
2
pip install shadowsocks
sudo apt install shadowsocks

3、修改openssl.py文件(这是一个大坑)

利用命令找到openssl.py文件

1
sudo find / -name openssl.py

打开文件

1
vi /你的路径/openssl.py

利用 :/string命令一个个找到cleanup这个单词,然后一个个替换成reset

1
/cleanup

4、配置文件

在系统新建一个文件

1
vi /home/ubuntu/shadowsocks.json

文件里面写入

1
2
3
4
5
6
7
8
{
"server":"0.0.0.0",
"server_port":8388,
"password":"your_password",
"timeout":600,
"method":"aes-256-cfb",
"fast_open": false
}

如果开启多个端口就写入

1
2
3
4
5
6
7
8
9
10
{
"server":"0.0.0.0",
"port_password": {
"8388": "your_password1",
"8389": "your_password2"
},
"timeout":600,
"method":"aes-256-cfb",
"fast_open": false
}

:wq保存。

5、开启shadowsocks

1
ssserver -c /home/ubuntu/shadowsocks.json -d start

停止ss

1
ssserver -c /home/ubuntu/shadowsocks.json -d stop

6、设为开机启动

创建service文件

1
vi /etc/systemd/system/shadowsocks.service

写入以下内容

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
[Unit]
Description=Shadowsocks
After=network.target

[Service]
Type=forking
PIDFile=/run/shadowsocks/server.pid
PermissionsStartOnly=true
ExecStartPre=/bin/mkdir -p /run/shadowsocks
ExecStartPre=/bin/chown root:root /run/shadowsocks
ExecStart=/usr/local/bin/ssserver --pid-file /var/run/shadowsocks/server.pid -c /etc/shadowsocks/config.json -d start
Restart=on-abort
User=root
Group=root
UMask=0027

[Install]
WantedBy=multi-user.target

设置文件权限

1
chmod 755 /etc/systemd/system/shadowsocks.service

启动服务

1
2
systemctl start shadowsocks
systemctl enable shadowsocks

你好,hexo

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

我的第一篇hexo博客文章!

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×