Orange是一个基于OpenResty的API网关。除Nginx的基本功能外,它还可用于API监控、访问控制(鉴权、WAF)、流量筛选、访问限速、AB测试、动态分流等。它有如下特性:mysql
--with-http_stub_status_module
Orange启动成功后, dashboard和API server也随之启动:nginx
http://localhost:9999
访问7777
端口监听,如不须要API Server可删除nginx.conf里对应的配置
openresty安装git
[root@k8s5 ~]# wget https://openresty.org/download/openresty-1.11.2.2.tar.gzgithub
[root@k8s5 ~]# tar -zxvf openresty-1.11.2.2.tar.gzsql
[root@k8s5 ~]# yum -y install libuuid-devel pcre-devel openssl-devel zlib-devel数据库
[root@k8s5 ~]# ./configure --with-http_stub_status_module --with-http_v2_module --with-http_ssl_module框架
[root@k8s5 ~]# gmake && gmake install运维
[root@k8s5 ~]# ln -s /usr/local/openresty/nginx/sbin/nginx /usr/sbin/nginxide
[root@k8s5 ~]# ln -s /usr/local/openresty/bin/resty /usr/bin/resty测试
安装mariadb
[root@k8s5 ~]# yum -y install mariadb-server mariadb
[root@k8s5 ~]# mysql -u root -p
[root@k8s5 ~]# CREATE DATABASE orange CHARACTER SET utf8 COLLATE utf8_general_ci;
[root@k8s5 ~]# grant all on *.* to 'orange'@'%' identified by 'orange';
[root@k8s5 ~]# source /root/orange/install/orange-v0.6.4.sql #导入的orange的数据库
安装lor 框架
[root@k8s5 ~]# git clone https://github.com/sumory/lor
[root@k8s5 ~]# cd lor
[root@k8s5 ~]# make install
安装 orange
[root@k8s5 ~]# https://github.com/sumory/orange.git
[root@k8s5 ~]# cd orange
[root@k8s5 ~]# make install 会在/usr/local/orange 目录生成路径
[root@k8s5 ~]# cp start.sh /usr/local/orange/
修改 /usr/local/orange/config/中 nginx.conf.example , orange.conf.example
主要修改orange.conf.example 配置文件
启动orange
[root@k8s5 ~]# cd /usr/local/orange
[root@k8s5 ~]# sh start.sh
访问地址 http://192.168.20.233:9999