APISIX源码安装问题解决

官网手册的安装语句:

复制代码
curl https://raw.githubusercontent.com/apache/apisix/master/utils/install-dependencies.sh -sL | bash -

执行 install-dependencies.sh 报如下错误:

复制代码
Transaction check error:
  file /usr/share/gcc-4.8.2/python/libstdcxx/v6/printers.py from install of libstdc++-4.8.5-44.tl2.1.x86_64 conflicts with file from package libstdc++-4.8.5-4.el7.i686
  file /usr/share/gcc-4.8.2/python/libstdcxx/v6/printers.pyc from install of libstdc++-4.8.5-44.tl2.1.x86_64 conflicts with file from package libstdc++-4.8.5-4.el7.i686
  file /usr/share/gcc-4.8.2/python/libstdcxx/v6/printers.pyo from install of libstdc++-4.8.5-44.tl2.1.x86_64 conflicts with file from package libstdc++-4.8.5-4.el7.i686
  file /usr/share/man/man5/cert8.db.5.gz from install of nss-3.90.0-2.tl2.x86_64 conflicts with file from package nss-3.19.1-19.el7_2.i686
  file /usr/share/man/man5/cert9.db.5.gz from install of nss-3.90.0-2.tl2.x86_64 conflicts with file from package nss-3.19.1-19.el7_2.i686
  file /usr/share/man/man5/key3.db.5.gz from install of nss-3.90.0-2.tl2.x86_64 conflicts with file from package nss-3.19.1-19.el7_2.i686
  file /usr/share/man/man5/key4.db.5.gz from install of nss-3.90.0-2.tl2.x86_64 conflicts with file from package nss-3.19.1-19.el7_2.i686
  file /usr/share/man/man5/pkcs11.txt.5.gz from install of nss-3.90.0-2.tl2.x86_64 conflicts with file from package nss-3.19.1-19.el7_2.i686
  file /usr/share/man/man5/secmod.db.5.gz from install of nss-3.90.0-2.tl2.x86_64 conflicts with file from package nss-3.19.1-19.el7_2.i686
  file /usr/share/man/man5/ldap.conf.5.gz from install of openldap-2.4.44-25.tl2.x86_64 conflicts with file from package openldap-2.4.40-8.el7.i686
  file /usr/share/man/man5/ldif.5.gz from install of openldap-2.4.44-25.tl2.x86_64 conflicts with file from package openldap-2.4.40-8.el7.i686

Error Summary

解决办法为执行下列语句删除冲突:

bash 复制代码
yum -y remove libstdc++-4.8.5-4.el7.i686

install-dependencies.sh 执行 linux-install-luarocks.sh 时报下列错误:

复制代码
Configuring LuaRocks version 3.8.0...

Lua version detected: 5.1
Lua interpreter found: /usr/bin/lua
lua.h for Lua 5.1 not found (tried /usr/include/lua/5.1/lua.h /usr/include/lua5.1/lua.h /usr/include/lua-5.1/lua.h /usr/include/lua51/lua.h /usr/include/lua.h)

If the development files for Lua (headers and libraries)
are installed in your system, you may need to use the
--with-lua or --with-lua-include flags to specify their location.

If those files are not yet installed, you need to install
them using the appropriate method for your operating system.

Run ./configure --help for details on flags.

https://www.lua.org/download.html 下载 lua-5.4.6,解压后修改其中的 Makefile 文件,将 INSTALL_TOP 的值改为:

复制代码
INSTALL_TOP= /usr/local/lua-5.4.6

执行:

复制代码
make&&make install

成功后再执行:

复制代码
ln -s /usr/local/lua-5.4.6 /usr/local/lua

更新 PATH,指向 lua-5.4.6:

复制代码
export PATH=/usr/local/lua:$PATH

重新执行 install-dependencies.sh 完成安装。

在本文写作时,"APISIX_VERSION='3.6.1'" 并不可用,需改为"APISIX_VERSION='3.6.0'"。

执行"make deps"时报错:

复制代码
[ info ] WARNING: OpenResty not found. You have to install OpenResty and add the binary file to PATH before install Apache APISIX.

下面这个错误同 openresty.repo 有关:

复制代码
failure: repodata/repomd.xml from openresty: [Errno 256] No more mirrors to try.
https://openresty.org/package/centos/2.6/x86_64/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found

上面这个错误是因为 openresty.repo 配置的 baseurl 实际不存在:

复制代码
# cat /etc/yum.repos.d/openresty.repo
[openresty]
name=Official OpenResty Open Source Repository for CentOS
baseurl=https://openresty.org/package/centos/$releasever/$basearch
skip_if_unavailable=False
gpgcheck=1
repo_gpgcheck=0
gpgkey=https://openresty.org/package/pubkey.gpg
enabled=1
enabled_metadata=1

在 CentOS 7.9 上查 basearch 和 releasever 的取值:

复制代码
# python -c 'import yum, json; yb = yum.YumBase(); print json.dumps(yb.conf.yumvar, indent=2)'
Loaded plugins: fastestmirror
{
  "arch": "ia32e", 
  "basearch": "x86_64", 
  "releasever": "2.6", 
  "uuid": "d20a9386-c8d2-225a-8e8d-916f99f582d1"
}

实际存在的,如:

复制代码
https://openresty.org/package/centos/7/x86_64/repodata/repomd.xml

做下列改动就能通过:

复制代码
# cat /etc/yum.repos.d/openresty.repo 
[openresty]
name=Official OpenResty Open Source Repository for CentOS
#baseurl=https://openresty.org/package/centos/$releasever/$basearch
baseurl=https://openresty.org/package/centos/7/x86_64/
skip_if_unavailable=False
gpgcheck=1
repo_gpgcheck=0
gpgkey=https://openresty.org/package/pubkey.gpg
enabled=1
enabled_metadata=1

下面这个错误是因为 /usr/local 下没有 openresty:

复制代码
# make deps
[ info ] WARNING: OpenResty not found. You have to install OpenResty and add the binary file to PATH before install Apache APISIX.
exit 1

执行:

复制代码
yum -y install openresty

安装 openresty,再执行 APISIX 的"make deps"。

相关推荐
万山y2 天前
OpenResty反向代理
openresty
古月的三个锦囊18 天前
Nginx openresty web服务 与 Go 原生web服务性能对比
nginx·go·openresty
Julian.zhou1 个月前
MCP服务:五分钟实现微服务治理革命,无缝整合Nacos/Zookeeper/OpenResty
人工智能·微服务·zookeeper·交互·openresty
PatrickYao04222 个月前
雨云云应用测评!内测持续进行中!
mysql·部署·网站搭建·openresty·rca
ZZDICT2 个月前
OpenResty(Lua)+Redis实现动态封禁IP
redis·nginx·lua·openresty
衣舞晨风2 个月前
Apache APISIX 架构浅析
架构·apache·openresty·apisix
衣舞晨风2 个月前
NGINX 执行阶段与OpenResty的 *_by_lua指令
nginx·lua·openresty·执行阶段
dgiij3 个月前
对免认证服务提供apikey验证
nginx·http·lua·llama·openresty
蕴微轩3 个月前
用openresty和lua实现壁纸投票功能
lua·openresty
xyc12113 个月前
OpenResty
openresty