Skip to content
New issue

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

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

Already on GitHub? # to your account

request help: How to install apisix in centos8? #6462

Closed
lizj3624 opened this issue Feb 27, 2022 · 8 comments · Fixed by api7/apisix-build-tools#181
Closed

request help: How to install apisix in centos8? #6462

lizj3624 opened this issue Feb 27, 2022 · 8 comments · Fixed by api7/apisix-build-tools#181
Assignees
Labels
enhancement New feature or request

Comments

@lizj3624
Copy link

Issue description

I use this cmd to install apisix in centos8,but it failed.

# install cmd
sudo yum install -y https://repos.apiseven.com/packages/centos/apache-apisix-repo-1.0-1.noarch.rpm

sudo yum info -y apisix

# error msg
Repository fasttrack is listed more than once in the configuration
Apache APISIX Repository for CentOS                                                              39  B/s |  15  B     00:00
Errors during downloading metadata for repository 'release':
  - Status code: 404 for https://repos.apiseven.com/packages/centos/8/x86_64/repodata/repomd.xml (IP: 120.77.166.81)
错误:为 repo 'release' 下载元数据失败 : Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

Environment

  • apisix version (cmd: apisix version):
  • OS (cmd: uname -a):
  • OpenResty / Nginx version (cmd: nginx -V or openresty -V):
  • etcd version, if have (cmd: run curl http://127.0.0.1:9090/v1/server_info to get the info from server-info API):
  • apisix-dashboard version, if have:
  • the plugin runner version, if the issue is about a plugin runner (cmd: depended on the kind of runner):
  • luarocks version, if the issue is about installation (cmd: luarocks --version):
@spacewander spacewander added the enhancement New feature or request label Feb 27, 2022
@shenzhuangzhi1
Copy link
Contributor

Why dont try docker?

@leslie-tsang
Copy link
Member

Hello there, Some variables, such as $releasever, have different values in CentOS 7 and CentOS 8, which resulting in this issue.

var CentOS 7 CentOS 8
$releasever 7 8

Simple fix solution

A simple fix, replace $releasever with 7 in /etc/yum.repos.d/apache-apisix.repo as shown below

[release]
name=Apache APISIX Repository for CentOS
baseurl=https://repos.apiseven.com/packages/centos/7/$basearch
skip_if_unavailable=False
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://repos.apiseven.com/KEYS
enabled=1
enabled_metadata=1

Solution

Add a CentOS 8 repo support

@spacewander
Copy link
Member

If I am correct, we don't release any CentOS 8 package? So changing the download URL won't bring a difference.

@lizj3624
Copy link
Author

lizj3624 commented Feb 28, 2022

Manual source installation of apisix in CentOS8

APISIX_VERSION='2.12.1'
mkdir apisix-${APISIX_VERSION}    
wget https://downloads.apache.org/apisix/${APISIX_VERSION}/apache-apisix-${APISIX_VERSION}-src.tgz

tar zxvf apache-apisix-${APISIX_VERSION}-src.tgz -C apisix-${APISIX_VERSION}

# Switch to the apisix-${APISIX_VERSION} directory
cd apisix-${APISIX_VERSION}

## install apisix luarrocks
wget https://raw.githubusercontent.com/apache/apisix/master/utils/linux-install-luarocks.sh
sh linux-install-luarocks.sh

## install openresty
wget https://openresty.org/package/centos/openresty.repo
sudo mv openresty.repo /etc/yum.repos.d/
sudo yum check-update

sudo yum install -y openresty
sudo yum install -y openresty-openssl111-devel*

## depend OpenLDAP,manual compile and install
./configure --with-cyrus-sasl --with-tls=openssl --enable-overlays=mod     --enable-backends=mod --disable-perl --disable-ndb --enable-crypt     --enable-modules --enable-dynamic --enable-syslog --enable-debug --enable-local     --enable-spasswd --disable-sql --disable-wt --disable-ndb --prefix=/usr/local/openldap-2.6.1
make depend
make
cd contrib/slapd-modules/passwd/sha2
make
cd ../../../..

install guides: https://tylersguides.com/guides/install-openldap-from-source-on-centos-8/

# Create dependencies
cd apisix-${APISIX_VERSION}
make deps

# Install apisix command
make install

# test 
apisix version
/usr/local/openresty/luajit/bin/luajit ./apisix/cli/apisix.lua version
2.12.1

@leslie-tsang
Copy link
Member

we don't release any CentOS 8 package?

Yes, there is no separate RPM package for CentOS 8 available.

So changing the download URL won't bring a difference.

Fortunately, the RPM package is universal, it work fine in both CentOS 7 and CentOS 8

@tokers
Copy link
Contributor

tokers commented Mar 1, 2022

Fortunately, the RPM package is universal, it work fine in both CentOS 7 and CentOS 8

That's not generic enough, although now the version on CentOS 7 can also run on CentOS 8, this ability might be broken in the future, I think we can consider to release a specific package on CentOS 8 if it's really a pain point.

@leslie-tsang
Copy link
Member

I would like to fix it. :)

@fatihbm
Copy link

fatihbm commented Mar 12, 2022

This may sound look a old school method but I suggest compiling from source code for more performance and freedom wholeheartedly.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants