Java開源框架 iBase4J 搭建筆記



項目地址:https://gitee.com/iBase4J/iBase4J


搭建步驟:

    1、git 代碼

    2、安裝 Zookeeper

    3、打包部署 Dubbo Admin

    4、安裝 Nginx 

    5、配置文件

    6、啟動Web Server 和 Service Server

    7、搭建完成



詳細步驟:

    1、git代碼

    本人用的 idea -> File -> New -> Project From Version Control -> Git

    輸入 iBase4J 地址: https://gitee.com/iBase4J/iBase4J.git




    選擇本地保存地址輸入名稱,點擊 Clone,稍等一會,代碼下載完畢,如下圖:




2、安裝 Zookeeper

      安裝方法:http://blog.csdn.net/antma/article/details/79219493

    

3、打包部署 Dubbo Admin

      本人是直接把源碼下載下來,自己打包

      部署方法見: http://blog.csdn.net/antma/article/details/79219739


4、安裝 Nginx 

    下載地址:http://nginx.org/en/download.html

    下載解壓后,修改 conf/nginx.conf 文件為:

  1. worker_processes  1;  
  2.   
  3. events {  
  4.     worker_connections  1024;  
  5. }  
  6.   
  7. http {  
  8.     include       mime.types;  
  9.     default_type  application/octet-stream;  
  10.   
  11.     sendfile        on;  
  12.   
  13.     keepalive_timeout  65;  
  14.   
  15.   
  16.     server {  
  17.         listen       80;  
  18.         server_name  localhost;  
  19.   
  20.         # 靜態頁面目錄  
  21.         root       <span style="color:#ff0000;"><strong>E:\MyCode\iBase4J\iBase4J-UI\iBase4J-UI-AngularJS</strong></span>;  
  22.         # 默認首頁  
  23.         index      index.html;  
  24.   
  25.         location / {  
  26.           # 用戶瀏覽器端的緩存設置  
  27.           location ~* \.(css|js|jpg|jpeg|gif|png|swf|htm|html|json|xml|svg|woff|ttf|eot|map|ico)$ {  
  28.             expires 1h;  
  29.             if (-f $request_filename) {  
  30.                 break;  
  31.             }  
  32.           }  
  33.           # 動態頁面,交給tomcat處理  
  34.           if ( !-e $request_filename) {  
  35.             proxy_pass       http://127.0.0.1:8088;  
  36.           }  
  37.         }  
  38.   
  39.         error_page   500 502 503 504  /50x.html;  
  40.         location = /50x.html {  
  41.             root   html;  
  42.         }  
  43.   
  44.     }  
  45.   
  46. }  

其中:

  1. # 靜態頁面目錄  
  2.         root       <span style="color:#ff0000;"><strong>E:\MyCode\iBase4J\iBase4J-UI\iBase4J-UI-AngularJS</strong></span>;  
上面這塊需要修改為 iBase4J 的UI相應目錄。

  1. # 動態頁面,交給tomcat處理  
  2.           if ( !-e $request_filename) {  
  3.             proxy_pass       <span style="color:#ff0000;"><strong>http://127.0.0.1:8088;</strong></span>  
  4.           }  
上面這個為后端地址。

Nginx配置完畢!

命令行運行 Nginx -t  檢查配置文件語法是否正確,然后運行 start nginx 啟動Nginx,如下圖:




經過以上配置,直接訪問 http://localhost 即可打開前端頁面:



待續....




免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM