Waline评论插件独立安装教程
最近更新:2025-01-15
|
字数总计:570
|
阅读估时:2分钟
|
阅读量:次
注意:
1. 开始安装
创建目录
1
| mkdir -p /usr/local/blog
|
安装 Waline
1 2
| cd /usr/local/blog npm install @waline/vercel
|
2. 导入数据库
3. 服务配置
创建 systemd 服务
1
| vim /usr/lib/systemd/system/waline.service
|
粘贴以下内容
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
| [Unit] Description=waline After=network.target
[Service] Type=simple WorkingDirectory=/usr/local/blog ExecStart=/usr/bin/node /usr/local/blog/node_modules/@waline/vercel/vanilla.js
Environment="SITE_NAME=云淡风清"
Environment="SITE_URL=https://tingbuqing.com"
Environment="SERVER_URL=https://waline.tingbuqing.com"
Environment="SECURE_DOMAINS=tingbuqing.com"
Environment="SMTP_SERVICE="
Environment="SMTP_HOST=smtp.ym.163.com"
Environment="SMTP_PORT=994"
Environment="SMTP_USER=welcome@tingbuqing.com"
Environment="SMTP_PASS=********"
Environment="SMTP_SECURE=true"
Environment="SENDER_NAME=Welcome Tingbuqing"
Environment="SENDER_EMAIL=welcome@tingbuqing.com"
Environment="AUTHOR_EMAIL=welcome@tingbuqing.com"
Environment="MYSQL_DB=waline"
Environment="MYSQL_USER=waline"
Environment="MYSQL_PASSWORD=********"
Environment="MYSQL_HOST=127.0.0.1"
Environment="MYSQL_PORT=3306"
Environment="MYSQL_PREFIX=wl_"
Environment="MYSQL_CHARSET=utf8mb4"
Environment="MYSQL_SSL=true" Restart=always
[Install] WantedBy=multi-user.target
|
重新加载 systemd 服务
4. 启动 Waline
1
| systemctl start waline.service
|
5. Nginx配置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| server { listen 80; listen 443 ssl; server_name waline.tingbuqing.com; if ($server_port !~ 443){ rewrite ^(/.*)$ https://$host$1 permanent; } ssl_certificate SSL/fullchain.cer; ssl_certificate_key SSL/tingbuqing.com.key; ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3; ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5; ssl_prefer_server_ciphers on; ssl_session_cache shared:SSL:10m; ssl_session_timeout 10m; add_header Strict-Transport-Security "max-age=31536000"; location / { proxy_pass http://127.0.0.1:8360; 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-Proto $scheme; proxy_set_header REMOTE-HOST $remote_addr; add_header X-Cache $upstream_cache_status; add_header Cache-Control no-cache; expires 12h; } }
|
6. 访问管理界面

参考文献: