halo部署简易记录

master ,这是我的小站,欢迎访问哦~~

安装docker

1
2
3
# 安装docker
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh

启动docker

1
sudo systemctl start docker

设置开机启动

1
sudo systemctl enable docker

安装docker-compose

1
2
# 安装docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

设置权限

1
sudo chmod +x /usr/local/bin/docker-compose

测试

1
docker-compose --version

安装halo

本文是docker-compose方式安装,使用halo+postgresql搭建使用,利用nginx反向代理,使用hao主题若干插件,评论为artalk

docker-compose.yml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
version: "3"
services:
halo:
image: registry.fit2cloud.com/halo/halo:2.16
restart: on-failure:3
depends_on:
halodb:
condition: service_healthy
networks:
halo_network:
volumes:
- ./halo2:/root/.halo2
ports:
- "8090:8090"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8090/actuator/health/readiness"]
interval: 30s
timeout: 5s
retries: 5
start_period: 30s
command:
- --spring.r2dbc.url=r2dbc:pool:postgresql://halodb/halo
- --spring.r2dbc.username=halo
# PostgreSQL 的密码,请保证与下方 POSTGRES_PASSWORD 的变量值一致。
- --spring.r2dbc.password=openpostgresql
- --spring.sql.init.platform=postgresql
# 外部访问地址,请根据实际需要修改
- --halo.external-url=http://localhost:8090/
halodb:
image: postgres:15.4
restart: on-failure:3
networks:
halo_network:
volumes:
- ./db:/var/lib/postgresql/data
healthcheck:
test: [ "CMD", "pg_isready" ]
interval: 10s
timeout: 5s
retries: 5
environment:
- POSTGRES_PASSWORD=openpostgresql
- POSTGRES_USER=halo
- POSTGRES_DB=halo
- PGUSER=halo
networks:
halo_network:

nginx

  1. 安装
    要在CentOS 7上安装Nginx,您可以按照以下步骤进行操作:
    1. 更新系统:sudo yum update
    2. 安装EPEL存储库(Extra Packages for Enterprise Linux):sudo yum install epel-release
    3. 安装Nginx:sudo yum install nginx
    4. 启动Nginx服务:sudo systemctl start nginx
    5. 设置Nginx开机自启:sudo systemctl enable nginx
    6. 默认页面的文件路径为/usr/share/nginx/html/index.html。自定义Nginx的配置,可以编辑/etc/nginx/nginx.conf文件
  2. 配置
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    upstream halo {
    server 127.0.0.1:8090;
    }
    server {
    listen 80;
    listen [::]:80;
    server_name www.yourdomain.com;
    client_max_body_size 1024m;
    location / {
    proxy_pass http://halo;
    proxy_set_header HOST $host;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
    }

主题

Hao : https://www.halo.run/store/apps/app-MgZJX

插件

  1. Meilisearch : https://www.halo.run/store/apps/app-yJlEz
  2. 站点迁移 https://www.halo.run/store/apps/app-TlUBt
  3. 站点推送插件 https://www.halo.run/store/apps/app-KdbUz
  4. 朋友圈 https://www.halo.run/store/apps/app-yISsV
  5. 瞬间 https://www.halo.run/store/apps/app-SnwWD
  6. 链接管理 https://www.halo.run/store/apps/app-hfbQg
  7. Vditor 编辑器 https://www.halo.run/store/apps/app-uBcYw
  8. 应用市场 https://www.halo.run/store/apps/app-VYJbF
  9. RSS https://www.halo.run/store/apps/app-KhIVw
  10. 搜索组件 https://www.halo.run/store/apps/app-DlacW
  11. 图库管理 https://www.halo.run/store/apps/app-BmQJW
  12. Sitemap https://www.halo.run/store/apps/app-QDFMI

评论

artalk : https://artalk.js.org