docs(deployment): 移除过时的配置文档并更新部署说明
- 删除了 502 错误排查指南文档 - 删除了配置文件管理说明文档 - 删除了域名配置总结文档 - 删除了 Nginx SSL 配置指南文档 - 删除了项目改进计划文档 - 删除了公网访问配置检查清单文档 - 更新了部署说明文档中的后端部署流程 - 简化了前端部署说明,移除了冗余的配置验证步骤 - 更新了配置检查清单,聚焦生产环境部署要点
This commit is contained in:
@@ -4,26 +4,20 @@
|
||||
|
||||
### 后端部署
|
||||
|
||||
1. **配置文件已更新**
|
||||
- ✅ `app.frontend.url` 已设置为 `http://175.178.252.59`(公网地址,通过Nginx访问)
|
||||
- ✅ `paypal.webhook-url` 已设置为 `https://175.178.252.59/api/paypal/webhook`(HTTPS,PayPal要求)
|
||||
- ✅ 后端端口已设置为 `8082`
|
||||
- ✅ 前端 `.env.production` 已创建,API地址为 `/api`(相对路径)
|
||||
|
||||
2. **打包应用**
|
||||
1. **打包应用**
|
||||
```bash
|
||||
cd E:\MTKJPAY
|
||||
mvn clean package -DskipTests
|
||||
```
|
||||
|
||||
3. **上传并启动**
|
||||
2. **上传并启动**
|
||||
```bash
|
||||
# 上传 jar 文件到服务器
|
||||
# 启动应用
|
||||
java -jar mt-pay-0.0.1-SNAPSHOT.jar --spring.profiles.active=dev
|
||||
# 启动应用(使用生产环境配置)
|
||||
java -jar mt-startup-0.0.1-SNAPSHOT.jar --spring.profiles.active=prod
|
||||
|
||||
# 或后台运行
|
||||
nohup java -jar mt-pay-0.0.1-SNAPSHOT.jar --spring.profiles.active=dev > app.log 2>&1 &
|
||||
nohup java -jar mt-startup-0.0.1-SNAPSHOT.jar --spring.profiles.active=prod > app.log 2>&1 &
|
||||
```
|
||||
|
||||
### 前端部署
|
||||
@@ -34,42 +28,20 @@
|
||||
npm run build
|
||||
```
|
||||
|
||||
2. **本地测试打包结果(验证打包是否正确)**
|
||||
```bash
|
||||
cd dist
|
||||
python -m http.server 3000
|
||||
# 或
|
||||
npx http-server -p 3000
|
||||
# 访问 http://localhost:3000(应该能看到页面,不是空白)
|
||||
```
|
||||
|
||||
3. **API地址配置**
|
||||
- ✅ `.env.production` 文件已创建
|
||||
- ✅ API地址已设置为 `/api`(相对路径,通过Nginx代理)
|
||||
- ⚠️ **重要:** 必须使用相对路径 `/api`,不要使用完整URL
|
||||
|
||||
4. **上传到服务器**
|
||||
```bash
|
||||
# 上传dist目录下的所有文件到服务器
|
||||
scp -r dist/* root@175.178.252.59:/path/to/web/root/
|
||||
```
|
||||
|
||||
5. **服务器配置**
|
||||
- 如果服务器已有Web服务器,将dist内容放到Web根目录
|
||||
2. **上传到服务器**
|
||||
- 上传 `dist` 目录下的所有文件到服务器Web根目录
|
||||
- 确保支持Vue Router的history模式(配置 `try_files`)
|
||||
|
||||
## 配置说明
|
||||
|
||||
- **开发环境**:使用 `application-dev.yml`(本地开发,默认)
|
||||
- **生产环境**:使用 `application-prod.yml`(服务器部署,需指定 `--spring.profiles.active=prod`)
|
||||
|
||||
## 配置检查清单
|
||||
|
||||
部署前请检查以下配置:
|
||||
|
||||
- [x] 后端 `app.frontend.url` 已设置为 `http://175.178.252.59`(公网地址)
|
||||
- [x] 后端 `paypal.webhook-url` 已设置为 `https://175.178.252.59/api/paypal/webhook`(HTTPS)
|
||||
- [x] 后端端口已设置为 `8082`
|
||||
- [x] 前端API地址已配置为 `/api`(相对路径,通过Nginx代理)
|
||||
- [ ] 数据库连接信息正确
|
||||
- [ ] 服务器防火墙已开放必要端口(8082等)
|
||||
- [ ] **Nginx已配置SSL证书(PayPal Webhook必需)**
|
||||
- [ ] PayPal控制台Webhook URL已更新为 `https://175.178.252.59/api/paypal/webhook`
|
||||
- [ ] **Nginx配置中的proxy_pass端口已更新为8082**
|
||||
|
||||
|
||||
- [ ] 使用 `--spring.profiles.active=prod` 启动(生产环境配置)
|
||||
- [ ] 数据库连接信息正确(生产环境)
|
||||
- [ ] 服务器防火墙已开放必要端口(8082、443等)
|
||||
- [ ] Nginx已配置SSL证书(PayPal Webhook必需HTTPS)
|
||||
- [ ] Nginx配置中的proxy_pass端口为8082
|
||||
- [ ] PayPal控制台Webhook URL已配置为域名(HTTPS)
|
||||
|
||||
Reference in New Issue
Block a user