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"。

相关推荐
根哥的博客2 天前
编译nginx-1.28.0支持lua语法
nginx·lua·openresty·nosql注入漏洞
我发在否4 天前
APISIX > ai-proxy 插件
apisix·ai网关
maycho1234 天前
探索 IEEE33 节点配电网模型:MATLAB 中的潮流与故障仿真之旅
openresty
雨落秋垣4 天前
优化 OpenResty 的性能
junit·openresty
嗝屁小孩纸5 天前
利用OpenResty统计网站访问量
junit·openresty
杀死那个蝈坦8 天前
OpenResty
junit·openresty
聊天QQ:6882388610 天前
改进下垂控制的孤岛型并联分布式电源微电网系统
openresty
我发在否17 天前
OpenResty > 平滑升级:1.25.x → 1.27.x
junit·openresty
huangdengji1 个月前
基于openresty反向代理、dns劫持、实现对http请求、响应内容抓包
网络协议·http·openresty
IT小哥哥呀1 个月前
Nginx高可用配置实战:负载均衡 + 健康检查 + 动态扩展
运维·nginx·负载均衡·devops·日志分析·openresty·动态扩展