<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                JAR部署方案 === >[info] Version: 2.4+ 版本 [TOC] ## 正式環境部署 >[info] - 后端服務通過JAR方式運行 > - 前端項目build的dist,部署到nginx ### 一、jeecg-boot項目打JAR包 - 1、修改配置文件 application-prod.yml >[warning] 修改 數據庫連接、緩存redis、上傳附件等配置 ![](https://img.kancloud.cn/6a/c7/6ac7a6aecae500779b4b7aec3adf724f_1541x785.png) - 2、切換Maven為生產模式 ![](https://img.kancloud.cn/a6/87/a68768ca5981c98b14654ae1a0837347_258x133.png) - 3、通過jeecg-boot-parent打包 ![](https://img.kancloud.cn/81/5c/815c14f07fdd79b1a2918d7f994183f1_292x257.png) - 4、拿到 `jeecg-boot-module-system-{版本號}.jar` 包 ![](https://img.kancloud.cn/c4/03/c403dd1fa9ec587a801a9d0ea46023e1_406x340.png) ### 二、通過JAR方式啟動后臺 通過命令啟動項目 ``` Window啟動命令: java -jar D:\jeecg-boot-module-system-2.0.0.jar Linux下后臺進程啟動命令: nohup java -jar jeecg-boot-module-system-2.0.0.jar >catalina.out 2>&1 & 關掉項目: ps -ef|grep java kill 進程號 ``` ### 三、前臺項目build打包 - 1、修改接口地址配置 ` .env.production` ``` NODE_ENV=production VUE_APP_API_BASE_URL=https://bootapi.jeecg.com VUE_APP_CAS_BASE_URL=http://localhost:8888/cas VUE_APP_ONLINE_BASE_URL=http://fileview.jeecg.com/onlinePreview ``` - 2、build打包 使用build命令打包項目 ![](https://img.kancloud.cn/fc/97/fc97693b7368344d23f87bea72e3cca1_507x899.png) build完成后 ,會生成一個dist的目錄。 - 3、nginx部署前端項目 拷貝dist下的代碼到nginx安裝目錄下html目錄中,即可 ### 四、nginx配置(conf/nginx.conf) nginx監聽80端口 ``` server { listen 80; server_name 你的域名; #后臺服務配置,配置了這個location便可以通過http://域名/jeecg-boot/xxxx 訪問 location ^~ /jeecg-boot { proxy_pass http://127.0.0.1:8080/jeecg-boot/; proxy_set_header Host 127.0.0.1; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } #解決Router(mode: 'history')模式下,刷新路由地址不能找到頁面的問題 location / { root html; index index.html index.htm; if (!-e $request_filename) { rewrite ^(.*)$ /index.html?s=$1 last; break; } } } ``` 提醒: 有的版本nginx配置需要加上 Upgrade 和Connection 協議頭,不然WebSocket會404 ### 五、訪問應用 通過:http://你的域名 訪問項目,出現如下頁面,使用賬戶/密碼:admin/123456 登錄成功即可 ![](https://img.kancloud.cn/b5/7f/b57f05022451900c30660953965b428e_919x893.png) ### 六、其他說明 服務器只能開放80端口,不能開放8080端口問題? > 方案:單獨配置一個java?api的服務域名 例如 `api.jeecg.com`,通過ngnix映射此域名到8080端口 > vue前端配置接口到域名`api.jeecg.com`。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看