master ,这是我的小站,欢迎访问哦~~
halo部署简易记录
安装docker
# 安装docker
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
启动docker
sudo systemctl start docker
设置开机启动
sudo systemctl enable docker
安装docker-compose
# 安装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
设置权限
sudo chmod +x /usr/local/bin/docker-compose
测试
docker-compose --version
安装halo
本文是docker-compose方式安装,使用halo+postgresql搭建使用,利用nginx反向代理,使用hao主题,若干插件,评论为artalk
docker-compose.yml
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
- 安装
要在CentOS 7上安装Nginx,您可以按照以下步骤进行操作:- 更新系统:
sudo yum update
- 安装EPEL存储库(Extra Packages for Enterprise Linux):
sudo yum install epel-release
- 安装Nginx:
sudo yum install nginx
- 启动Nginx服务:
sudo systemctl start nginx
- 设置Nginx开机自启:
sudo systemctl enable nginx
- 默认页面的文件路径为
/usr/share/nginx/html/index.html
。自定义Nginx的配置,可以编辑/etc/nginx/nginx.conf
文件
- 更新系统:
- 配置
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
插件
- Meilisearch : https://www.halo.run/store/apps/app-yJlEz
- 站点迁移 https://www.halo.run/store/apps/app-TlUBt
- 站点推送插件 https://www.halo.run/store/apps/app-KdbUz
- 朋友圈 https://www.halo.run/store/apps/app-yISsV
- 瞬间 https://www.halo.run/store/apps/app-SnwWD
- 链接管理 https://www.halo.run/store/apps/app-hfbQg
- Vditor 编辑器 https://www.halo.run/store/apps/app-uBcYw
- 应用市场 https://www.halo.run/store/apps/app-VYJbF
- RSS https://www.halo.run/store/apps/app-KhIVw
- 搜索组件 https://www.halo.run/store/apps/app-DlacW
- 图库管理 https://www.halo.run/store/apps/app-BmQJW
- Sitemap https://www.halo.run/store/apps/app-QDFMI
评论
artalk : https://artalk.js.org
评论区