搭建Halo博客网站
- 创建云服务器
- 连接云服务器
- ssh-keygen命令生成密钥
- ssh-copy-id 自动上传公钥
- 关闭密码登录
- 使用 mosh 提高连接速度
- 搭建Halo博客网站
- Docker 安装
- 下载Halo配置文件
- 使用Docker安装Halo博客系统
- 创建Halo数据库
- 修改nginx配置
- 测试Halo功能
docker Halo blog 配置文件
wget https://github.com/codewhynet/docker-halo-blog/archive/refs/heads/master.zip
1 clear
2 vim /etc/ssh/sshd_config
3 vim /etc/ssh/sshd_config.d/50-cloud-init.conf
4 service ssh restart
5 sudo apt install mosh
6 ufw allow 60000:60009/udp
7 exit
8 # Add Docker's official GPG key:
9 sudo apt-get update
10 sudo apt-get install ca-certificates curl gnupg
11 sudo install -m 0755 -d /etc/apt/keyrings
12 curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
13 sudo chmod a+r /etc/apt/keyrings/docker.gpg
14 # Add the repository to Apt sources:
15 echo "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
16 sudo apt-get update
17 sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
18 docker ps
19 wget https://github.com/codewhynet/docker-halo-blog/archive/refs/heads/master.zip
20 mkdir /home/_docker_site
21 cd /home/_docker_site/
22 unzip ~/master.zip
23 cd docker-halo-blog-master/src/
24 ls
25 bash docker_lnmp.sh
26 docker ps
27 docker exec -it src-mysql-1 mysql -uroot -p
28 ls
29 nvim data/www_site/halo_blog_web/application.yaml
30 nvim config/nginx/conf.d/www.halo.blog.web.conf
31 cat config/nginx/conf.d/www.halo.blog.web.conf
32 docker ps
33 docker restart src-nginx-1
34 docker restart src-halo-blog-1
35 docker logs src-halo-blog-1
36 docker ps
37 cd