同步操作将从 iresty/Apache APISIX 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
The runtime environment for Apache APISIX requires Nginx and etcd.
So before installation, please follow the different operating systems install Dependencies.
You can install Apache APISIX in a variety of ways, including source code packages, Docker, and Luarocks.
You need to download the Apache source release first:
wget http://www.apache.org/dist/incubator/apisix/1.3/apache-apisix-1.3-incubating-src.tar.gz
tar zxvf apache-apisix-1.3-incubating-src.tar.gz
Install the Lua libraries that the runtime depends on:
cd apache-apisix-1.3-incubating
make deps
sudo yum install -y https://github.com/apache/incubator-apisix/releases/download/1.3/apisix-1.3-0.el7.noarch.rpm
Execute the following command in the terminal to complete the installation of APISIX (only recommended for developers):
Install the code for the master branch via a script
sudo sh -c "$(curl -fsSL https://raw.githubusercontent.com/apache/incubator-apisix/master/utils/install-apisix.sh)"
Install the specified version via Luarocks:
# Install version 1.3
sudo luarocks install --lua-dir=/path/openresty/luajit apisix 1.3
# old luarocks not support the `lua-dir` parameter, you can remove this option
sudo luarocks install apisix 1.3
We can start the APISIX server by command make run
in APISIX home folder,
or we can stop APISIX server by command make stop
.
# init nginx config file and etcd
$ make init
# start APISIX server
$ make run
# stop APISIX server
$ make stop
# more actions find by `help`
$ make help
Makefile rules:
help: Show Makefile rules.
deps: Installation dependencies
utils: Installation tools
lint: Lint Lua source code
init: Initialize the runtime environment
run: Start the apisix server
stop: Stop the apisix server
verify: Verify the configuration of apisix server
clean: Remove generated files
reload: Reload the apisix server
install: Install the apisix
test: Run the test case
license-check: Check lua souce code for Apache License
cpanminus
firsttest-gninx
via cpanm
::sudo cpanm --notest Test::Nginx IPC::Run > build.log 2>&1 || (cat build.log && exit 1)
git clone https://github.com/openresty/test-nginx.git
;test-nginx
library with perl's prove
command and run the test cases in the /t
directory:
export PERL5LIB=.:$PERL5LIB
make test
TEST_NGINX_BINARY=/usr/local/bin/openresty prove -Itest-nginx/lib -r t
If you run in to an issue Error unknown directive "lua_package_path" in /API_ASPIX/incubator-apisix/t/servroot/conf/nginx.conf
make sure to set openresty as default nginx. And export the path as below.
Changes the apisix.admin_key
in the file conf/config.yaml
and restart the service.
Here is an example:
apisix:
# ... ...
admin_key
-
name: "admin"
key: abcdefghabcdefgh
role: admin
When calling the Admin API, key
can be used as a token.
$ curl http://127.0.0.1:9080/apisix/admin/routes?api_key=abcdefghabcdefgh -i
HTTP/1.1 200 OK
Date: Fri, 28 Feb 2020 07:48:04 GMT
Content-Type: text/plain
... ...
{"node":{...},"action":"get"}
$ curl http://127.0.0.1:9080/apisix/admin/routes?api_key=abcdefghabcdefgh-invalid -i
HTTP/1.1 401 Unauthorized
Date: Fri, 28 Feb 2020 08:17:58 GMT
Content-Type: text/html
... ...
{"node":{...},"action":"get"}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。