服务器运维管理平台 — 心跳监控 + 智能告警 + 3层守护
本向导将引导您完成系统安装配置。
安装完成后将自动生成:.env (Python后端) +
config.php (PHP兼容) +
MySQL settings表 (共享配置)
整个过程大约 3 分钟。
正在检测环境...
用户:
连接池:
溢出池:
Nexus 6.0 已成功安装。
install.php 已重命名为 install.php.locked — 防止重复安装
安装: sudo apt install -y supervisor
配置文件复制到: /etc/supervisor/conf.d/nexus.conf
[program:nexus] command=/venv/bin/uvicorn server.main:app --host 0.0.0.0 --port directory= user=root autostart=true autorestart=true startretries=10 startsecs=3 stopwaitsecs=10 stopsignal=INT environment=PATH="/venv/bin:%(ENV_PATH)s" stderr_logfile=/var/log/nexus/error.log stdout_logfile=/var/log/nexus/access.log stderr_logfile_maxbytes=50MB stdout_logfile_maxbytes=50MB
启动: sudo supervisorctl reread && sudo supervisorctl update && sudo supervisorctl start nexus
cd
python3.12 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
宝塔 → 网站 → 配置文件 → #PHP-INFO-END 后面粘贴:
# Nexus Python API + WebSocket
location ^~ /api/ {
proxy_pass http://127.0.0.1:;
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;
}
location ^~ /health {
proxy_pass http://127.0.0.1:;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
location ^~ /ws/ {
proxy_pass http://127.0.0.1:;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}宝塔 → 网站 → 伪静态 → 粘贴:
location /app/ {
try_files $uri $uri/ /app/index.html;
}
location / {
try_files $uri $uri/ =404;
}配置 crontab:
* * * * * /deploy/health_monitor.sh
✓ install.php 已自动重命名为 install.php.locked
✓ .env 包含 SECRET_KEY/API_KEY — 安装后不可修改(加密一致性)
✓ 防火墙限制端口 (仅允许本机和子服务器IP)
✓ 修改管理员默认密码