0 rows affected (0.00 sec)Query OK

时间:2022-01-26 04:56:41

标签:

0 rows affected (0.00 sec)Query OK

Orange 简介

Orange是一个基于OpenResty的API网关。除Nginx的根基成果外,它还可用于API监控、访谒控制(鉴权、WAF)、流量筛选、访谒限速、AB测试、动态分流等。它有以下特性:

供给了一套默认的Dashboard用于动态打点各类成果和配置

供给了API接口用于实现第三方处事(如本性化运维需求、第三方Dashboard等)

可按照规范编写自界说插件扩展Orange成果

Orange 实战 环境 [[email protected] ~]# cat /etc/redhat-release CentOS Linux release 7.4.1708 (Core) [[email protected] ~]# uname -a Linux orange 3.10.0-693.17.1.el7.x86_64 #1 SMP Thu Jan 25 20:13:58 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux [[email protected] ~]# iptables -F [[email protected] ~]# ip addr [[email protected] orange]# ip addr 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 00:0c:29:57:b5:ab brd ff:ff:ff:ff:ff:ff inet 192.168.0.131/24 brd 192.168.0.255 scope global dynamic eth0 valid_lft 7081sec preferred_lft 7081sec inet6 fe80::3f87:b30b:ff6b:e675/64 scope link valid_lft forever preferred_lft forever OpenResty下载 [ version > 1.9.7.3 ]

下载OpenResty源码包

[[email protected] ~]# cd /usr/local/src/ [[email protected] src]# wget https://openresty.org/download/openresty-1.13.6.1.tar.gz --2018-03-06 15:41:59-- https://openresty.org/download/openresty-1.13.6.1.tar.gz Resolving openresty.org (openresty.org)... 120.26.162.249 Connecting to openresty.org (openresty.org)|120.26.162.249|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 4581699 (4.4M) [application/x-gzip] Saving to: ‘openresty-1.13.6.1.tar.gz’ 100%[=================================>] 4,581,699 9.08MB/s in 0.5s 2018-03-06 15:42:00 (9.08 MB/s) - ‘openresty-1.13.6.1.tar.gz’ saved [4581699/4581699]

解压源码包并进入包内

[[email protected] src]# tar xf openresty-1.13.6.1.tar.gz [[email protected] src]# cd openresty-1.13.6.1

创建openresty系统用户

[[email protected] openresty-1.13.6.1]# useradd -r -s /sbin/nologin -M openresty

安置相关依赖

[[email protected] openresty-1.13.6.1]# yum install pcre pcre-devel openssl openssl-devel git -y

指定参数生成Makefile文件

[[email protected] openresty-1.13.6.1]# ./configure --prefix=http://www.mamicode.com/usr/local/openresty-1.13.6.1 --user=openresty --group=openresty --with-http_stub_status_module …… …… …… Configuration summary + using system PCRE library + using system OpenSSL library + using system zlib library nginx path prefix: "/usr/local/openresty-1.13.6.1/nginx" nginx binary file: "/usr/local/openresty-1.13.6.1/nginx/sbin/nginx" nginx modules path: "/usr/local/openresty-1.13.6.1/nginx/modules" nginx configuration prefix: "/usr/local/openresty-1.13.6.1/nginx/conf" nginx configuration file: "/usr/local/openresty-1.13.6.1/nginx/conf/nginx.conf" nginx pid file: "/usr/local/openresty-1.13.6.1/nginx/logs/nginx.pid" nginx error log file: "/usr/local/openresty-1.13.6.1/nginx/logs/error.log" nginx http access log file: "/usr/local/openresty-1.13.6.1/nginx/logs/access.log" nginx http client request body temporary files: "client_body_temp" nginx http proxy temporary files: "proxy_temp" nginx http fastcgi temporary files: "fastcgi_temp" nginx http uwsgi temporary files: "uwsgi_temp" nginx http scgi temporary files: "scgi_temp" cd ../.. Type the following commands to build and install: gmake gmake install

gmake编译

[[email protected] openresty-1.13.6.1]# gmake …… …… …… sed -e "s|%%PREFIX%%|/usr/local/openresty-1.13.6.1/nginx|" -e "s|%%PID_PATH%%|/usr/local/openresty-1.13.6.1/nginx/logs/nginx.pid|" -e "s|%%CONF_PATH%%|/usr/local/openresty-1.13.6.1/nginx/conf/nginx.conf|" -e "s|%%ERROR_LOG_PATH%%|/usr/local/openresty-1.13.6.1/nginx/logs/error.log|" < docs/man/nginx.8 > objs/nginx.8 gmake[2]: Leaving directory `/usr/local/src/openresty-1.13.6.1/build/nginx-1.13.6‘ gmake[1]: Leaving directory `/usr/local/src/openresty-1.13.6.1/build/nginx-1.13.6‘

gmake install安置

[[email protected] openresty-1.13.6.1]# gmake install …… …… …… gmake[2]: Leaving directory `/usr/local/src/openresty-1.13.6.1/build/nginx-1.13.6‘ gmake[1]: Leaving directory `/usr/local/src/openresty-1.13.6.1/build/nginx-1.13.6‘ mkdir -p /usr/local/openresty-1.13.6.1/site/lualib /usr/local/openresty-1.13.6.1/site/pod /usr/local/openresty-1.13.6.1/site/manifest ln -sf /usr/local/openresty-1.13.6.1/nginx/sbin/nginx /usr/local/openresty-1.13.6.1/bin/openresty