waline 是一款简洁、功能强大评论系统。本文介绍下如何独立部署waline服务端。

准备

  • 创建一个数据库并导入waline.sql数据表模板
  • 安装好Node和PM2

安装waline服务端

## 创建一个目录并进入
mkdir waline && cd waline

## 安装waline服务端
npm install @waline/vercel

## 创建一个 pm2 启动 waline 的配置文件
## 配置文件必须以.config.js结尾, 即xx.config.js
touch waline.config.js

编辑waline.config.js。pm2配置文件参数说明: 点击查看,waline服务端环境变量说明: 点击查看

module.exports = {
    apps: [{
        name: "waline",
        script: "node node_modules/@waline/vercel/vanilla.js 8360",
        env: {
            "SITE_NAME": "your_site_name",
            "SITE_URL": "https://exp.com",
            "IPQPS": "30",
            "AKISMET_KEY": "false",
            "DISABLE_USERAGENT": "true",
            "DISABLE_REGION": "true",

            "MYSQL_HOST": "127.0.0.1",
            "MYSQL_PORT": "3306",
            "MYSQL_DB": "db",
            "MYSQL_USER": "user",
            "MYSQL_PASSWORD": "passwd",

            "SMTP_SERVICE": "QQex",
            "SMTP_USER": "user@exp.com",
            "SMTP_PASS": "passwd",
            "SMTP_SECURE": "true",
            "SENDER_EMAIL": "user@exp.com",
            "SENDER_NAME": "exp.com",
            "AUTHOR_EMAIL": "user@exp.com"
        }
    }]
};

启动

pm2 start waline.config.js