- yum install java-11-openjdk -y
- java --version
- wget https://dl.halo.run/release/halo-1.5.2.jar -O /opt/halo.jar
- wget https://dl.halo.run/config/halo.service -O /etc/systemd/system/halo.service
- 修改查看服务配置:
vim /etc/systemd/system/halo.service - 启动服务
systemctl daemon-reload
systemctl start halo
systemctl enable halo
journalctl -n 20 -u halo - 主题下载
https://github.com/halo-dev
docker 安装:
在宝塔先安装好docker
镜像管理 =〉 ruibaby/halo =〉 终端: docker run -it -d --name halo -p 8090:8090 -v ~/.halo:/root/.halo halohub/halo:latest
或者: docker run -d --name halo -p 8090:8090 -v ~/halo:/root/halo ruibaby/halo
服务器安全规则放行8090端口,宝塔安全面板设置8090端口放行
输入服务器ip:8090初始化halo
有域名解析的话,需要调整nginx配置,配置如下:
server {
listen 80;
server_name bt.com; #换成自己的域名
location / {
rewrite ^/(.*)$ /$1 break;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:8090;
}
}