Java开源框架 iBase4J 搭建笔记


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


搭建步骤:

    1、git 代码

    2、安装 Zookeeper

    3、打包部署 Dubbo Admin

    4、安装 Nginx 

    5、配置文件

    6、启动Web Server 和 Service Server

    7、搭建完成

扫描二维码关注公众号,回复: 1550144 查看本文章



详细步骤:

    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 即可打开前端页面:



待续....



猜你喜欢

转载自www.cnblogs.com/jpfss/p/9163582.html