reghao 1 year ago
parent
commit
6d5ef134c7
4 changed files with 41 additions and 13 deletions
  1. 39 6
      README.md
  2. 1 1
      build.sh
  3. 0 4
      config/hosts
  4. 1 2
      nginx/conf.d/tnb.conf

+ 39 - 6
README.md

@@ -1,4 +1,13 @@
 ## 系统简介
+tnb 是一个 bilibili-like 的 VOD 系统, 使用前后端分离模式开发, 后端采用微服务, 整个系统包括下述项目:
+- [tnb](https://git.reghao.cn/reghao/tnb)
+> 系统后端
+- [bnt](https://git.reghao.cn/reghao/bnt)
+> 系统后台应用
+- [oss-store](https://git.reghao.cn/reghao/oss)
+> 系统文件存储应用
+- [tnbapp](https://git.reghao.cn/reghao/tnbapp)
+> 系统前台应用
 
 ## 构建依赖
 - os:Linux
@@ -8,7 +17,7 @@
 - node:v16.19.0
 - npm:8.19.3
 
-## 运行依赖
+## 第三方服务依赖
 - mysql:5.7
 - redis
 - rabbitmq
@@ -17,7 +26,7 @@
 
 ## 构建部署
 构建部署流程如下:
-- 1.修改 config/application.yml 文件中第三方服务的地址和帐号密码等
+- 1.修改 config/application.yml 文件中第三方服务依赖的地址和帐号密码等
 - 2.修改 tnb0/db/init_db.sh 脚本中 MySQL 的地址和帐号密码, 然后在 tnb0/db 目录下执行 init_db.sh 脚本初始化数据库
 - 3.在 tnb0 目录下执行 build.sh 脚本构建应用
 - 4.构建成功后, 在 tnb0 目录下执行 start.sh 脚本启动应用
@@ -41,7 +50,7 @@ oss:
   console-host: 127.0.0.1
 
 ```
-> 需要修改 basedir, store-host, store-dirs, console-host 等配置
+> 第一步, 修改 basedir, store-host, store-dirs, console-host 等配置
 > - basedir
 > > 上传文件时 tomcat 存放的临时目录
 > - store-host
@@ -53,6 +62,30 @@ oss:
 > 
 > 若 oss-store 和 bntweb 部署在同一台机器上, 那么只需要修改 basedir 和 store-dirs
 > 
-> 然后切换到 tmp/bin/oss-store 目录下后执行 start.sh 脚本启动应用
-> 
-> 当然如果采用 aliyun-oss 存储文件, 那么就不需要使用 oss-store 应用
+> 第二步, 然后切换到 tmp/bin/oss-store 目录下后执行 start.sh 脚本启动应用
+> > 当然如果采用 aliyun-oss 存储文件, 那么就不需要使用 oss-store 应用
+
+## nginx 配置
+首先配置 hosts 文件, 在hosts 文件中添加下述映射:
+```
+# 指向 oss-store
+127.0.0.1 oss.reghao.cn
+# 指向 tnb
+127.0.0.1 api.reghao.cn
+# 指向 tnbapp
+127.0.0.1 tnb.reghao.cn
+# 指向 bntweb
+127.0.0.1 bnt.reghao.cn
+```
+
+然后配置 nginx, 详见 nginx/nginx.conf 和 nginx/conf.d/tnb.conf 文件
+> 需要修改的是 nginx/conf.d/tnb.conf 文件中 tnb.reghao.cn 域名所在的 block
+> > 将 root 修改为 tnbapp 应用中 dist 目录的实际路径
+
+## 使用系统
+后台系统地址(即 bntweb 应用)
+> http://bnt.reghao.cn
+> > 默认帐号和密码分别是: admin 和 admin12345678
+
+前台系统地址(即 tnbapp 应用)
+> http://tnb.reghao.cn

+ 1 - 1
build.sh

@@ -140,4 +140,4 @@ echo "构建后端应用..."
 build_backend
 
 echo "构建前端应用..."
-# build_front
+build_front

+ 0 - 4
config/hosts

@@ -1,4 +0,0 @@
-127.0.0.1 oss.reghao.cn
-127.0.0.1 api.reghao.cn
-127.0.0.1 tnb.reghao.cn
-127.0.0.1 bnt.reghao.cn

+ 1 - 2
nginx/conf.d/tnb.conf

@@ -101,13 +101,12 @@ server {
    server_name tnb.reghao.cn;
    access_log off;
 
-   root /opt/webroot/tnbapp;
+   root tnbapp/dist;
    location / {
       try_files $uri $uri/ /index.html;
    }
 }
 
-
 # server {
 #    listen 80;
 #    server_name tnb1.reghao.cn;