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