Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: sync install-dependencies.md & polish it #3467

Merged
merged 5 commits into from
Feb 2, 2021

Conversation

spacewander
Copy link
Member

Signed-off-by: spacewander [email protected]

What this PR does / why we need it:

Pre-submission checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

@@ -54,7 +52,10 @@ sudo yum install yum-utils
sudo yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo

# 安装 OpenResty 和 编译工具
sudo yum install -y openresty curl git gcc luarocks lua-devel
sudo yum install -y openresty curl git gcc lua-devel openresty-openssl-devel
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use the luajit of openresty? if yes, we do not need to install the lua-devel.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

Copy link
Member

@membphis membphis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cancel my approve

Signed-off-by: spacewander <[email protected]>
@Yiyiyimu Yiyiyimu mentioned this pull request Feb 1, 2021
4 tasks
@Yiyiyimu
Copy link
Member

Yiyiyimu commented Feb 1, 2021

When I follow the installation steps and install luarocks with script, I got the following error:

Configuring LuaRocks version 3.4.0...

Lua interpreter not found in $PATH
You may want to use the flags --with-lua, --with-lua-bin and/or --lua-version
Run ./configure --help for details.

configure failed.

Please run the ./configure script before building.

make: *** No rule to make target 'config.unix', needed by 'luarocks'.  Stop.
Please run the ./configure script before building.

make: *** No rule to make target 'config.unix', needed by 'build/luarocks'.  Stop.
mkdir: cannot create directory ‘/home/shuyang/.luarocks’: File exists
Wrote
        variables.OPENSSL_LIBDIR = "/usr/local/openresty/openssl/lib"
to
        /usr/local/etc/luarocks/config-5.1.lua
Wrote
        variables.OPENSSL_INCDIR = "/usr/local/openresty/openssl/include"
to
        /usr/local/etc/luarocks/config-5.1.lua

Environment: Ubuntu 18.04, on Windows (WSL2)

@Yiyiyimu Yiyiyimu self-requested a review February 1, 2021 11:52
@spacewander
Copy link
Member Author

The linux-install-openresty.sh is wrong. It misses --with-lua=$OPENRESTY_PREFIX/luajit

Signed-off-by: spacewander <[email protected]>
- By default Apache APISIX runs with LuaJIT of OpenResty 1.19 (priority) or Lua 5.1. If you run in to an issue `luajit: lj_asm_x86.h:2819: asm_loop_fixup: Assertion '((intptr_t)target & 15) == 0' failed`, it is caused by to the compatibility of OpenResty version. OpenResty 1.19 is recommended, please take a look at this installation step script [linux-install-openresty](../utils/linux-install-openresty.sh).
- If it is OpenResty 1.19, APISIX will use OpenResty's built-in LuaJIT to run `bin/apisix`; otherwise it will use Lua 5.1. If you encounter `luajit: lj_asm_x86.h:2819: asm_loop_ fixup: Assertion '((intptr_t)target & 15) == 0' failed`, this is a problem with the low version of OpenResty's built-in LuaJIT under certain compilation conditions.

- - On some platforms, installing LuaRocks via the package manager will cause Lua to be upgraded to Lua 5.3, so we recommend installing LuaRocks via source code. if you install OpenResty and its OpenSSL develop library (openresty-openssl-devel for rpm and openresty-openssl-dev for deb) via the official repository, then [we provide a script for automatic installation](. /... /utils/linux-install-luarocks.sh). If you compile OpenResty yourself, you can refer to the above script and change the path in it. If you don't specify the OpenSSL library path when you compile, you don't need to configure the OpenSSL variables in LuaRocks, because the system's OpenSSL is used by default. If the OpenSSL library is specified at compile time, then you need to ensure that LuaRocks' OpenSSL configuration is consistent with OpenResty's.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may also give some tips about how to configuring the OpenSSL configuration for LuaRocks.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read the script is enough. Should not repeat yourself.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK.

@membphis membphis merged commit b033a75 into apache:master Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants