libeio edited a comment on issue #3752:
URL: https://github.com/apache/apisix/issues/3752#issuecomment-790417938


   the following content below is all the record about how I compiled and 
installed. You can try it in ur machine in the same way.
   
   <strong>Thanks!</stong>
   
   ### downlinks
   [lua5.1.5](http://www.lua.org/ftp/lua-5.1.5.tar.gz)
   [luarocks](http://luarocks.github.io/luarocks/releases/luarocks-3.5.0.tar.gz)
   [pcre](https://ftp.pcre.org/pub/pcre/pcre-8.44.tar.gz)
   [zlib](http://zlib.net/zlib-1.2.11.tar.gz)
   [openssl](https://github.com/openssl/openssl/archive/OpenSSL_1_1_0l.zip)
   rename OpenSSL_1_1_0l to openssl-1.1.0l after unzip it
   
   ### Lua
   
   There are three commonly used versions for Lua, list as 5.1, 5.2, 5.3. While 
the `apisix` using version 5.1 .
   
   - Install the dependency
   
   when on RedHat:
     ```sh
       yum install readline-devel
     ```
     
   when on Debian:
     ```sh
       apt-get install libreadline-dev
     ```
   
   - Decompress the tarball in certain path and enter the top directory:
     ```sh
       tar -zxvf lua-5.1.5.tar.gz
       cd lua-5.1.5
     ```
   
   - Compiled, test and install
     ```sh
       make linux
       make test
       make install
     ```
     Then Lua would be installed to directory  `/usr/local/bin` by default.
   
   
   ### LuaRocks
   
   
[reference](https://github.com/luarocks/luarocks/wiki/Installation-instructions-for-Unix)
   
   `LuaRocks` is the management tool of Lua. You can specify the  Lua path 
while installing this, or it would search the Lua in the path 
`/usr/local/bin`。As said above, my Lua was installed in the default path, so it 
will be ok, I think.
   
   - Decompression
     ```sh
       tar -zxvf luarocks-3.5.0.tar.gz 
       cd luarocks-3.5.0
     ```
   
   - Configure, Compile and Install
     ```sh
       ./configure --prefix=/usr/local/luarocks 
--with-lua-include=/usr/local/include
       make
       make install
     ```
   
   - Link the luarocks to system search path
     ```sh
       ln -s /usr/local/luarocks/bin/luarocks /usr/bin
     ```
   
   
   ### OpenResty
   
   `apisix`  be dependent with `OpenResty`, and `OpenResty`  be dependent with 
other Modules. But most Modules is  internally built in `OpenResty` , excepted 
to `openssl`,`zlib` and `pcre`. (In My Humble Opinion)
   
   So the remained thing is specify the paths of three softwares above.
   
   Compiled Installed as before.
   
   |  dependency  |  version  |
   |:--------|:-------|
   | openssl | 1.1.0l |
   | zlib    | 1.2.11 |
   | PCRE    | 8.44   |
   
   
   `OpenResty` used an easy way instead of custom way when install. More 
details as follows:
   
   ```sh
     ./configure --prefix=/usr/local/openresty 
--with-zlib=/usr/local/src/zlib-1.2.11 --with-pcre=/usr/local/src/pcre-8.44 
--with-openssl=/usr/local/src/openssl-1.1.0l --with-http_stub_status_module 
--with-http_ssl_module --with-http_realip_module --with-http_v2_module
     gmake
     gmake install
   ```
   It would prompt you use `make` and `make install` to complete the compile 
and installation instead.
   
   
   ### etcd
   
   
[download](https://github.com/etcd-io/etcd/releases/download/v3.4.13/etcd-v3.4.13-linux-amd64.tar.gz)
   
   version: v3.4.13
   
   `etcd` directly used the compiled binary file provided by the official.
   
   
   ### apisix
   
   There two thing should be done before deploy the `apisix`, list as link the 
command and place the lib file.
   
   1.Link the command
     ```sh
       ln -s /usr/local/openresty/bin/openresty /usr/bin/openresty
       ln -s /usr/local/openresty/bin/resty /usr/bin/resty
     ```
   
   2.Place lib files
   
   在部署 `apisix` 时,也会用到 `openssl` 和 `zlib`,与 `OpenResty` 不同,`apisix` 要求 
`openssl` 和 `zlib` 编译成开发头文件和库的形式,链接路径分别为 `/usr/local/openresty/openssl` 和 
`/usr/local/openresty/zlib` 。
   
   It also need use the `openssl` and `zlib` while deploying the `apisix`. Diff 
with `OpenResty`, `apisix` requires the `openssl` and `zlib` in style of lib 
files that compiled completed.
   
   Followed, I would linked the compiled file path to special path respectively 
required by deployment:
   ```sh
     ln -s /usr/local/openssl /usr/local/openresty/openssl
     ln -s /usr/local/zlib /usr/local/openresty/zlib
   ```
   
   PS: openssl and zlib compile and install
   > openssl
   ```sh
       ./config --prefix=/usr/local/openssl
       make
       make install    
   ```
   > zlib
   ```sh
       ./configure --prefix=/usr/local/zlib
       make
       make install
   ```
   
   PS: `/usr/local/openssl`  two level tree structure:
   ```sh
     ├── bin
     │   ├── c_rehash
     │   └── openssl
     ├── include
     │   └── openssl
     ├── lib
     │   ├── engines-1.1
     │   ├── libcrypto.a
     │   ├── libcrypto.so -> libcrypto.so.1.1
     │   ├── libcrypto.so.1.1
     │   ├── libssl.a
     │   ├── libssl.so -> libssl.so.1.1
     │   ├── libssl.so.1.1
     │   └── pkgconfig
     ├── share
     │   ├── doc
     │   └── man
     └── ssl
         ├── certs
         ├── misc
         ├── openssl.cnf
         ├── openssl.cnf.dist
         └── private
   ```
   
   Hereto,OK!  And `/usr/local/openresty` one level tree structure as follows:
   ```sh
     ├── bin
     ├── COPYRIGHT
     ├── luajit
     ├── lualib
     ├── nginx
     ├── openssl -> /usr/local/openssl
     ├── pod
     ├── resty.index
     ├── site
     └── zlib -> /usr/local/zlib
   ```
   
   Now begin the deploy to `apisix`.
   
   Enter the top directory of `apisix` and execute the command:
   ```sh
     make deps
   ```
   
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to