Based on a halo quickly build your own blog site

the public

Here Insert Picture Description

Pre-conditions

First you need to have an own server, such as various types of cloud above you go to buy its own ECS server, if you really do not have a server, you have to do to set up a local VM with a virtual machine to demonstrate our implementation process.

JDK installation

First, we need to give us one of our servers installed JDK, here we use a halo recommended open-jdk, and therefore only need to use the ssh client even after we directly execute the following command:

# 安装 OpenJRE
sudo yum install java-1.8.0-openjdk -y

# 检测是否安装成功
java -version

Download halo profile

Then we started to download halo, First we download his application.yaml template configuration file:

curl -o ~/.halo/application.yaml --create-dirs http://halo.ryanc.cc/config/application-template.yaml

Then according to their information needs to modify the configuration file:

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: 123456

  # 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

Recommended form H2 database used here, after all, this is only our own blog site, thousands of articles to the top article of the day, it is not recommended to use mysql database.

Download halo startup jar

Then execute the following command to start the download of our halo jar package:

wget https://github.com/halo-dev/halo/releases/download/v1.2.0/halo-1.2.0.jar -O halo-latest.jar

After the download is complete we start our program directly:

java -jar halo-latest.jar &

Verify start

Then we have direct access to: http: //127.0.0.1: 8090, according to the requirements then we can set our halo blog, and after setup is complete we can start pleasant to use our blog up.
Here Insert Picture Description

Published 128 original articles · won praise 72 · Views 1.13 million +

Guess you like

Origin blog.csdn.net/linzhefeng89/article/details/104425531