代码拉取完成,页面将自动刷新
同步操作将从 iresty/Apache APISIX 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
Apache APISIX 的运行环境需要 Nginx 和 etcd,
所以在安装前,请根据不同的操作系统来安装依赖。
你可以通过源码包、Docker、Luarocks 等多种方式来安装 Apache APISIX。
你需要先下载源码候选版本:
wget https://dist.apache.org/repos/dist/dev/incubator/apisix/0.9-RC1/apache-apisix-0.9-rc1-incubating-src.tar.gz
tar zxvf apache-apisix-0.9-rc1-incubating-src.tar.gz
安装运行时依赖的 Lua 库:
cd apache-apisix-0.9-rc1-incubating
make deps
sudo yum install -y https://github.com/apache/incubator-apisix/releases/download/v0.8/apisix-0.8-0.el7.noarch.rpm
在终端中执行下面命令完成 APISIX 的安装(只推荐开发者使用):
通过脚本安装 master 分支的代码
sudo sh -c "$(curl -fsSL https://raw.githubusercontent.com/apache/incubator-apisix/master/utils/install-apisix.sh)"
通过 Luarocks 安装指定的版本:
# 安装 apisix 的 0.8 版本
sudo luarocks install --lua-dir=/path/openresty/luajit apisix 0.8
# 老版本 luarocks 可能不支持 `lua-dir` 参数,可以删除该选项
sudo luarocks install apisix 0.8
我们可以在 apisix 的目录下用 make run
命令来启动服务,或者用 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
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
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
prove
命令来加载 test-nginx 的库,并运行 /t
目录下的测试案例集:
prove -Itest-nginx/lib -r t
TEST_NGINX_BINARY=/usr/local/bin/openresty prove -Itest-nginx/lib -r t
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。