halo组件安装
apt-get install openjdk-11-jre -y
cd /usr && mkdir halo
cd /usr/halo/ && wget https://dl.halo.run/release/halo-1.6.0.jar -O halo.jar
mkdir ~/.halo && cd ~/.halo
wget https://dl.halo.run/config/application-template.yaml -O ./application.yaml
cd /usr/halo/ && java -jar halo.jar
//后台启动
cd /usr/halo/ && nohup java -jar halo.jar > nohup.out 2>&1 &
配置文件
server:
port: 8090
# Response data gzip.
compression:
enabled: false
spring:
datasource:
# H2 database configuration.
# driver-class-name: org.h2.Driver
# url: jdbc:h2:file:~/.halo/db/halo
# username: admin
# password: 123456
# MySQL database configuration.
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/halodb?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
username: root
password: your_password
# H2 database console configuration.
# h2:
# console:
# settings:
# web-allow-others: false
# path: /h2-console
# enabled: false
halo:
# Your admin client path is https://your-domain/{admin-path}
admin-path: admin
# memory or level
cache: memory