<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>

                WAR部署方案 === >[info] Version: 2.4+ 版本 ## 正式環境部署 > 部署方案采用nginx+tomcat部署方案 > 后端服務發布部署到tomcat中 > 前端項目build后dist部署到nginx中 ### 一、后臺項目jeecg-boot打war包(jeecg-boot-module-system) #### (1)后臺項目jeecg-boot-module-system打war包之前要進行如下改動 1、pom.xml文件中項目打包格式設置為war <packaging>war</packaging> 具體配置如下: ``` <parent> <groupId>org.jeecgframework.boot</groupId> <artifactId>jeecg-boot-parent</artifactId> <version>2.4.0</version> </parent> <modelVersion>4.0.0</modelVersion> <artifactId>jeecg-boot-module-system</artifactId> <packaging>war</packaging> ``` 2、pom.xml文件刪除插件spring-boot-maven-plugin 下面配置刪除 ``` <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build> ``` 3、增加項目web容器部署的支持: 修改類 jeecg-boot-module-system/org.jeecg.JeecgSystemApplication 代碼如下: ``` package org.jeecg; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; @SpringBootApplication public class JeecgSystemApplication extends SpringBootServletInitializer { @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(JeecgSystemApplication.class); } public static void main(String[] args) { SpringApplication.run(JeecgSystemApplication.class, args); } } ``` 4、注釋掉WebSocket配置 ``` 將此類注釋掉 jeecg-boot-base/jeecg-boot-base-core/org.jeecg.config.WebSocketConfig ``` 5、修改配置文件(數據庫和redis配置) - a、修改數據庫連接 application-prod.yml - b、修改緩存redis配置 application-prod.yml - c、修改上傳附件配置 application-prod.yml ![](https://img.kancloud.cn/6a/c7/6ac7a6aecae500779b4b7aec3adf724f_1541x785.png) - d、切換生產模式打包 ![](https://img.kancloud.cn/04/36/0436a40e4b27e6a999a247776d2a6080_355x250.png) 首先執行下jeecg-boot-parent的install 操作 ![](https://img.kancloud.cn/64/90/64909b0e1567c4cf480416122d8203a5_385x299.png) 然后 maven package 打war包 ![](https://img.kancloud.cn/ad/30/ad30bcc8fd15328bdac98a240617f906_272x234.png) ### 二、后臺項目jeecg-boot部署tomcat 1、設置tomcat端口號 8080,設置tomcat編碼 URIEncoding="UTF-8" 2、部署項目到tomcat安裝目錄webapps/jeecg-boot工程目錄下 部署完后通過http://localhost:8080/jeecg-boot 可以訪問項目,提示token錯誤說明部署成功!! ``` 注意: 1.tomcat解壓war后的目錄名稱即你訪問的根路徑,即這里的jeecg-boot 2.新版的swagger需要訪問http://localhost:8080/jeecg-boot/doc.html ``` ### 三、前臺項目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的目錄該目錄下即為build后的文件。 4、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; } } } ``` 4、訪問應用 配置后啟動tomcat,啟動nginx 通過http://你的域名/ 訪問項目,出現如下頁面,使用賬戶/密碼:admin/123456 登錄成功即可 ![](https://img.kancloud.cn/b5/7f/b57f05022451900c30660953965b428e_919x893.png)
                  <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>

                              哎呀哎呀视频在线观看