Skip to content

Commit

Permalink
doc: installed APISIX by shell script. (apache#585)
Browse files Browse the repository at this point in the history
  • Loading branch information
membphis authored Sep 24, 2019
1 parent a4ac562 commit 03f5029
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 20 deletions.
29 changes: 23 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ APISIX Installed and tested in the following systems, and the version of OpenRes
| Mac OSX |

You now have four ways to install APISIX:
- if you are using CentOS 7, it is recommended to use RPM;
- if you are using CentOS 7, it is recommended to use [RPM](#install-from-rpm-for-centos-7);
- if using MacOS, only support git clone and install by manual, please take a look at [dev manual](doc/dev-manual.md);
- other systems please use Luarocks;
- other systems please use [Luarocks](#install-from-luarocks-not-support-macos);
- You can also install from [Docker image](https://github.com/iresty/docker-apisix).

*NOTE*: APISIX currently only supports the v2 protocol storage to etcd, but the latest version of etcd (starting with 3.4) has turned off the v2 protocol by default. You need to add `--enable-v2=true` to the startup parameter to enable the v2 protocol. The development of the v3 protocol supporting etcd has begun and will soon be available.
Expand Down Expand Up @@ -112,16 +112,33 @@ We recommend that you use [luarocks](https://luarocks.org/) to install APISIX, a

##### Install APISIX

APISIX is installed by running the following commands in your terminal.

> via curl
```shell
sudo sh -c "$(curl -fsSL https://raw.githubusercontent.com/iresty/apisix/master/utils/install-apisix.sh)"
```

> Manual inspection
It's a good idea to inspect the installation script from projects you don't know yet. You can do that by downloading the installation script first, looking through it so everything looks normal, then running it:

```shell
luarocks install --lua-dir=/usr/local/openresty/luajit apisix
curl -Lo install.sh https://raw.githubusercontent.com/iresty/apisix/master/utils/install-apisix.sh
sudo sh install.sh
```

If you got some error like `unknow flag --lua-dir`, this is because `luarocks` version is too low.
We need to remove option `lua-dir` and run again: `luarocks install apisix`.
> installation complete
If all goes well, you will see the message like this:

> apisix is now built and installed in /usr (license: Apache License 2.0)
```
apisix 0.7-0 is now built and installed in /usr/local/apisix/deps (license: Apache License 2.0)
+ sudo rm -f /usr/local/bin/apisix
+ sudo ln -s /usr/local/apisix/deps/bin/apisix /usr/local/bin/apisix
```

Congratulations, you have already installed APISIX successfully.

Expand Down
32 changes: 24 additions & 8 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ APISIX 在以下操作系统中做过安装和运行测试,需要注意的是
| Mac OSX |

现在有 4 种方式来安装:
- 如果你是 CentOS 7 的系统,推荐使用 RPM 包安装;
- 如果是 MacOS,只能通过 git clone 和手工安装的方式,参考[开发文档](doc/dev-manual-cn.md)
- 其他的系统推荐使用 Luarocks 安装;
- 如果你是 CentOS 7 的系统,推荐使用 [RPM 包安装](#通过-rpm-包安装centos-7)
- 如果是 MacOS,只支持安装开发环境,参考[开发环境](doc/dev-manual-cn.md)
- 其他的系统推荐使用 [Luarocks 安装](#通过-luarocks-安装-不支持-macos)
- 你也可以使用 [Docker 镜像](https://github.com/iresty/docker-apisix) 来安装.

*NOTE*: APISIX 目前仅支持 etcd 的 v2 协议存储,但最新版的 etcd (3.4 开始)已经默认关闭 v2 协议。
Expand Down Expand Up @@ -111,17 +111,33 @@ APISIX 是基于 [openresty](http://openresty.org/) 之上构建的, 配置数

##### 安装 APISIX

在终端中执行下面命令完成 APISIX 的安装:

> 通过 curl
```shell
sudo luarocks install --lua-dir=/usr/local/openresty/luajit apisix
sudo sh -c "$(curl -fsSL https://raw.githubusercontent.com/iresty/apisix/master/utils/install-apisix.sh)"
```

如果你得到 `unknow flag --lua-dir` 这类错误,这是因为 `luarocks` 版本过低。这时我们需要移除 `lua-dir` 选项重新运行:`luarocks install apisix`
> 人工检查
对你不熟悉项目的安装脚本做检查,是个非常好的习惯。可以先下载这个脚本,确保他都是正常脚本,然后运行:

如果一切顺利,你会在最后看到这样的信息:
```shell
curl -Lo install.sh https://raw.githubusercontent.com/iresty/apisix/master/utils/install-apisix.sh
sudo sh install.sh
```

> apisix is now built and installed in /usr (license: Apache License 2.0)
> 安装完成
```
apisix 0.7-0 is now built and installed in /usr/local/apisix/deps (license: Apache License 2.0)
+ sudo rm -f /usr/local/bin/apisix
+ sudo ln -s /usr/local/apisix/deps/bin/apisix /usr/local/bin/apisix
```

恭喜你,APISIX 已经安装成功了
恭喜,APISIX 已经安装成功

## 开发环境

Expand Down
12 changes: 6 additions & 6 deletions doc/install-dependencies.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Install Dependencies

* [CentOS 7](#centos-7)
* [Ubuntu 18.04](#ubuntu-1804)
* [Debian 9](#debian-9)
* [Ubuntu 16.04 & 18.04](#ubuntu-1604--1804)
* [Debian 9 & 10](#debian-9--10)
* [CentOS 6](#centos-6)
* [Mac OSX](#mac-osx)

Expand All @@ -28,8 +28,8 @@ sudo ln -s /usr/bin/cmake3 /usr/bin/cmake
sudo service etcd start
```

Ubuntu 18.04
============
Ubuntu 16.04 & 18.04
====================

```shell
# add openresty source
Expand All @@ -47,8 +47,8 @@ sudo apt-get install -y git etcd openresty curl luarocks\
sudo service etcd start
```

Debian 9 && 10
========
Debian 9 & 10
=============

```shell
# optional
Expand Down

0 comments on commit 03f5029

Please sign in to comment.