2025-01-06 23:41:52 -05:00
|
|
|
|
## aaPanel + Docker 快速部署指南
|
2023-11-22 01:01:58 -05:00
|
|
|
|
|
2025-01-06 23:41:52 -05:00
|
|
|
|
本指南介绍如何使用 aaPanel + Docker Compose 部署 Xboard。
|
|
|
|
|
|
|
|
|
|
### 1. 环境准备
|
|
|
|
|
|
|
|
|
|
1. 安装 Docker:
|
|
|
|
|
```bash
|
|
|
|
|
# 安装 Docker
|
2024-03-20 06:47:28 -04:00
|
|
|
|
curl -sSL https://get.docker.com | bash
|
2025-01-06 23:41:52 -05:00
|
|
|
|
|
|
|
|
|
# CentOS 系统需要执行:
|
2024-03-20 06:47:28 -04:00
|
|
|
|
systemctl enable docker
|
|
|
|
|
systemctl start docker
|
|
|
|
|
```
|
2025-01-06 23:41:52 -05:00
|
|
|
|
|
|
|
|
|
2. 安装 aaPanel:
|
|
|
|
|
```bash
|
|
|
|
|
curl -sSL https://www.aapanel.com/script/install_6.0_en.sh -o install_6.0_en.sh && \
|
|
|
|
|
bash install_6.0_en.sh aapanel
|
2023-11-22 01:01:58 -05:00
|
|
|
|
```
|
|
|
|
|
|
2025-01-06 23:41:52 -05:00
|
|
|
|
### 2. 环境配置
|
2023-11-22 02:52:07 -05:00
|
|
|
|
|
2025-01-06 23:41:52 -05:00
|
|
|
|
在 aaPanel 中安装 LNMP:
|
|
|
|
|
- Nginx(任意版本)
|
|
|
|
|
- MySQL 5.7
|
|
|
|
|
- ⚠️ 无需安装 PHP 和 Redis
|
2023-11-22 01:01:58 -05:00
|
|
|
|
|
2025-01-06 23:41:52 -05:00
|
|
|
|
### 3. 部署步骤
|
2023-11-22 01:01:58 -05:00
|
|
|
|
|
2025-01-06 23:41:52 -05:00
|
|
|
|
1. 添加站点:
|
|
|
|
|
- 进入 aaPanel > Website > Add site
|
|
|
|
|
- 域名:填写你的域名
|
|
|
|
|
- 数据库:选择 MySQL
|
|
|
|
|
- PHP 版本:选择纯静态
|
|
|
|
|
|
|
|
|
|
2. 安装 Xboard:
|
|
|
|
|
```bash
|
|
|
|
|
# 进入站点目录
|
|
|
|
|
cd /www/wwwroot/你的域名
|
|
|
|
|
|
|
|
|
|
# 清理目录
|
2023-11-22 01:01:58 -05:00
|
|
|
|
chattr -i .user.ini
|
2024-07-15 14:25:49 -04:00
|
|
|
|
rm -rf .htaccess 404.html 502.html index.html .user.ini
|
2025-01-06 23:41:52 -05:00
|
|
|
|
|
|
|
|
|
# 克隆代码
|
2023-11-22 01:01:58 -05:00
|
|
|
|
git clone https://github.com/cedar2025/Xboard.git ./
|
|
|
|
|
|
2025-01-06 23:41:52 -05:00
|
|
|
|
# 准备配置文件
|
|
|
|
|
cp compose.sample.yaml compose.yaml
|
|
|
|
|
|
|
|
|
|
# 安装依赖并初始化
|
|
|
|
|
docker compose run -it --rm web sh init.sh
|
2023-11-22 01:01:58 -05:00
|
|
|
|
```
|
2025-01-06 23:41:52 -05:00
|
|
|
|
> 安装完成后请保存返回的后台地址和管理员账号密码
|
|
|
|
|
|
|
|
|
|
3. 启动服务:
|
|
|
|
|
```bash
|
2023-11-22 01:01:58 -05:00
|
|
|
|
docker compose up -d
|
|
|
|
|
```
|
2025-01-06 23:41:52 -05:00
|
|
|
|
|
|
|
|
|
4. 配置反向代理:
|
|
|
|
|
```nginx
|
2023-12-08 07:33:10 -05:00
|
|
|
|
location ^~ / {
|
|
|
|
|
proxy_pass http://127.0.0.1:7001;
|
|
|
|
|
proxy_http_version 1.1;
|
|
|
|
|
proxy_set_header Connection "";
|
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
|
proxy_set_header X-Real-PORT $remote_port;
|
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
|
proxy_set_header Host $http_host;
|
|
|
|
|
proxy_set_header Scheme $scheme;
|
|
|
|
|
proxy_set_header Server-Protocol $server_protocol;
|
|
|
|
|
proxy_set_header Server-Name $server_name;
|
|
|
|
|
proxy_set_header Server-Addr $server_addr;
|
|
|
|
|
proxy_set_header Server-Port $server_port;
|
2024-03-20 06:47:28 -04:00
|
|
|
|
proxy_cache off;
|
2023-12-08 07:33:10 -05:00
|
|
|
|
}
|
|
|
|
|
```
|
2023-11-22 01:01:58 -05:00
|
|
|
|
|
2025-01-06 23:41:52 -05:00
|
|
|
|
### 4. 版本更新
|
2023-11-22 01:01:58 -05:00
|
|
|
|
|
2025-01-06 23:41:52 -05:00
|
|
|
|
```bash
|
|
|
|
|
docker compose pull && docker compose up -d
|
2023-11-22 01:01:58 -05:00
|
|
|
|
```
|
2023-11-25 22:56:44 -05:00
|
|
|
|
|
2025-01-06 23:41:52 -05:00
|
|
|
|
### 注意事项
|
|
|
|
|
|
|
|
|
|
- ⚠️ 请确保防火墙已开启,避免 7001 端口暴露到公网
|
|
|
|
|
- 代码修改后需要重启服务才能生效
|
|
|
|
|
- 建议配置 SSL 证书以确保安全访问
|