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 文件爲:

worker_processes  1;

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;

    keepalive_timeout  65;


    server {
        listen       80;
        server_name  localhost;

        # 靜態頁面目錄
        root       E:\MyCode\iBase4J\iBase4J-UI\iBase4J-UI-AngularJS;
        # 默認首頁
        index      index.html;

        location / {
          # 用戶瀏覽器端的緩存設置
          location ~* \.(css|js|jpg|jpeg|gif|png|swf|htm|html|json|xml|svg|woff|ttf|eot|map|ico)$ {
            expires 1h;
            if (-f $request_filename) {
                break;
            }
          }
          # 動態頁面,交給tomcat處理
          if ( !-e $request_filename) {
            proxy_pass       http://127.0.0.1:8088;
          }
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

    }

}
其中:
# 靜態頁面目錄
        root       E:\MyCode\iBase4J\iBase4J-UI\iBase4J-UI-AngularJS;
上面這塊需要修改爲 iBase4J 的UI相應目錄。

# 動態頁面,交給tomcat處理
          if ( !-e $request_filename) {
            proxy_pass       http://127.0.0.1:8088;
          }
上面這個爲後端地址。

Nginx配置完畢!

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




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



待續....



發佈了50 篇原創文章 · 獲贊 62 · 訪問量 26萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章