Browse Source

feat: add Redis installation and configuration instructions to deployment guide

Dave 2 months ago
parent
commit
cb34818bcf
1 changed files with 44 additions and 1 deletions
  1. 44 1
      install服务器部署.md

+ 44 - 1
install服务器部署.md

@@ -157,7 +157,50 @@ exit
 
 ---
 
-# 5. 安装 PM2
+# 5. 安装 Redis 7
+
+```bash
+# 安装 Redis(Ubuntu 官方仓库)
+sudo apt update
+sudo apt install -y redis-server
+
+# 确认 Redis 已启动
+sudo systemctl status redis-server
+```
+
+### 配置 Redis 以允许本地稳定服务
+
+编辑配置文件:
+
+```bash
+sudo vim /etc/redis/redis.conf
+```
+
+确保以下内容:
+
+```
+bind 127.0.0.1
+protected-mode yes
+port 6379
+supervised systemd
+```
+
+保存并重启:
+
+```bash
+sudo systemctl restart redis-server
+```
+
+测试 Redis:
+
+```bash
+redis-cli ping
+# 返回 PONG 表示成功
+```
+
+---
+
+# 6. 安装 PM2
 
 ```bash
 npm install -g pm2