# official_website **Repository Path**: learnhow/official_website ## Basic Information - **Project Name**: official_website - **Description**: No description available - **Primary Language**: Java - **License**: Not specified - **Default Branch**: develop - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-02-13 - **Last Updated**: 2022-03-17 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # official_website ![设计图](./架构图.png) ### 系统特点 1. 前后端统一使用maven编译,前端编译后的静态文件会被copy到backend目录下,更方便部署 2. 使用h2作单元测试,减少线上开发环境的数据依赖 3. 使用maven做统编管理 4. 使用stomp替代websocket ### CA证书链 ```shell doc/gen.sh ``` ### APISIX > 注意事项: > > ​ 使用docker配置apisix,上游服务的地址应该使用bridge的gateway地址 > > 路由配置: > > ​ 匹配正则表达式:^/api/(.*) > > ​ 转发路径模板:/$1 > > websocket: > > ​ 上游服务修改接收超时参数,保证心跳间隔小于超时时间 ### SpringBoot > Springboot开启HTTPs > > ​ server.ssl.key-store: classpath:cert.p12 > > ​ server.ssl.key-store-password: ... > > ​ server.ssl.key-store-type: PKCS12 > > ​ server.ssl.enabled: true ### 基于CentOS7开发环境 > 注意: > > ​ 如果需要编译grpc,就不需要提前单独编译protobuf,可能会造成版本冲突 > > ​ 另外需要注意grpc对openssl的依赖版本 ###### 升级gcc ```shell yum -y install bzip2 (optional) wget http://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-9.3.0/gcc-9.3.0.tar.gz tar -zxvf gcc-9.3.0.tar.gz cd gcc-9.3.0 ./contrib/download_prerequisites mkdir build cd build ../configure --enable-checking=release --enable-languages=c,c++ --disable-multilib make make install # 注意更新原有库的一些软链接 ln -s /usr/local/lib64/libstdc++.so.6.0.28 /usr/lib64/libstdc++.so.6 yum remove -y gcc # 注意:一定要删除老版本,否则后续的编译会失败 ``` ###### 升级cmake ```shell yum remove cmake -y wget https://cmake.org/files/v3.16/cmake-3.16.7.tar.gz tar zxvf cmake-3.16.7.tar.gz cd cmake-3.16.7 ./configure --prefix=/usr/local/cmake make && make install ln -s /usr/local/cmake/bin/cmake /usr/bin/cmake ``` ###### 升级OpenSSL ```shell tar -zxvf openssl-1.1.1k.tar.gz cd openssl-1.1.1k ./config --prefix=/usr/local/openssl make && make install cp -d /usr/local/openssl/lib/libcrypto.so* /usr/local/openssl/lib/libssl.so* /lib64/ cp -r /usr/local/openssl/include/openssl /usr/include/ ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl ``` ###### 编译restbed ```shell # 根据Findopenssl.cmake文件的依赖路径,建议将openssl的动态库复制到dependency/openssl/ git clone --recursive https://github.com/corvusoft/restbed.git mkdir restbed/build cd restbed/build cmake .. make make test ``` ###### 编译gRPC ```shell yum install build-essential autoconf libtool pkg-config git clone https://github.com/grpc/grpc cd grpc git submodule update --init mkdir -p cmake/build cd cmake/build cmake ../.. -DBUILD_SHARED_LIBS=ON make ``` ###### 编译protobuf ```shell yum install autoconf automake libtool curl make g++ unzip git clone https://github.com/protocolbuffers/protobuf.git cd protobuf git submodule update --init --recursive ./autogen.sh ./configure make -j$(nproc) make check make install ldconfig # refresh shared library cache. ```