SlothのBlog

  • 首页
  • 分类
    • 教程
    • 释义
    • 分享
  • 服务器
  1. 首页
  2. 教程
  3. 正文

Qexo MarkDown编辑器 - Hexo篇

2024年1月21日 0条评论

前言

Qexo 是一个快速、强大、漂亮的在线静态博客平台编辑器, 其具有以下特点

  • 自定义图床上传图片
  • 在线配置编辑
  • 在线页面管理
  • 开放 API
  • 自动检查更新
  • 在线一键更新
  • 快速接入友情链接
  • 简单的说说短文
  • 类似不算子的统计
  • 自动填文章模板

本文主要介绍 Hexo 的部分

安装教程

1. 准备工作

安装nginx, git, python3

# Debian/Ubuntu
apt install -y nginx git python3 python3-pip/python-pip
# CentOS/AlmaLinux
yum install -y nginx git python3 python3-pip/python-pip

下载 Qexo Release 到目录

Releases · Qexo/Qexo · GitHub
github.com
Releases · Qexo/Qexo · GitHub
A fast, powerful and beautiful online manager for all static blog frameworks. - Releases ·...

2. 安装数据库

下载mysql

downloads.mysql.com
MySQL :: Download MySQL Community Server (Archived Versions)

建议 5.7.x 版本

上传并解压安装

按一下顺序安装

mysql-common
libmysql*
# 若要安装 libaio1 则安装一下
# apt install -y libaio1
mysql-client...
mysql-comminity-client...
mysql-community-server...

添加Mysql配置文件

在根目录创建 configs.py , 并填入以下内容

import pymysql
pymysql.install_as_MySQLdb()
DOMAINS = ["127.0.0.1", "yoursite.com"]
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'db name',
'USER': 'db user',
'PASSWORD': 'db password',
'HOST': '127.0.0.1',
'PORT': '3306',
'OPTIONS': {
"init_command": "SET sql_mode='STRICT_TRANS_TABLES'"
}
}
}

3. 安装各种依赖

pip3 install -r requirements.txt
python3 manage.py makemigrations
python3 manage.py migrate

4. 测试启动并写入 Systemd

测试运行

python3 manage.py runserver 0.0.0.0:8000 --noreload

写入 systemd 服务

cat >/etc/systemd/system/qexo.service<<-EOF
[Unit]
Description=Qexo Server
After=network.target

[Service]
ExecStart=/usr/bin/python3 <qexo目录>/manage.py runserver 0.0.0.0:8000 --noreload
Restart=on-failure
RestartSec=1s

[Install]
WantedBy=multi-user.target
EOF

重载、启动并设置开机自启

systemctl daemon-reload
systemctl enable qexo
systemctl start qexo

5. Nginx配置

server {
server_name your_site;
listen 443 ssl http2;
ssl_certificate 证书;
ssl_certificate_key 私钥;
ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
listen 80;
if ($scheme = http) {
return 301 https://$host:443$request_uri;
}

location / {
proxy_pass http://127.0.0.1:8000;
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_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_redirect http:// https://;
}
}

6. 各种设置


图床搭建参考这篇文章:

www.slotheve.com
https://www.slotheve.com/easyimg/

演示

标签: Hexo MarkDown online MarkDown在线 Qexo
最后更新:2024年1月21日

slotheve

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

文章目录
  • 前言
  • 安装教程
    • 1. 准备工作
    • 2. 安装数据库
    • 3. 安装各种依赖
    • 4. 测试启动并写入 Systemd
    • 5. Nginx配置
    • 6. 各种设置
  • 演示
标签聚合
wordpress mynodequery docker nginx docker cmd nginx面板 frp 内网穿透 nginxwebui

COPYRIGHT © 2024 SlothのBlog. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang