参考资料:
https://docs.konghq.com/install/source/
环境准备:操作系统 centeros7.3
1 :openssl和pcre一般系统自带,如果没有可自己安装 https://www.openssl.org/source/
或者 yum -y install pcre-devel openssl openssl-devel
2: git
yum install git -y
3:gcc
yum install gcc -y
3: lua
wget http://luajit.org/download/LuaJIT-2.0.5.tar.gz
tar -xvf LuaJIT-2.0.5.tar.gz
cd LuaJIT-2.0.5
make install
一: 下载安装 openresty
wget https://openresty.org/download/openresty-1.13.6.2.tar.gz
tar -xvf openresty-1.13.6.2.tar.gz
cd openresty-1.13.6.2
./configure --with-pcre-jit --with-http_ssl_module --with-http_realip_module --with-http_stub_status_module --with-http_v2_module
gmake install
二:luarocks
wget http://luarocks.github.io/luarocks/releases/luarocks-3.0.3.tar.gz
tar -xvf luarocks-3.0.3.tar.gz
cd luarocks-3.0.3
make install
三:安装kong
将源码copy到服务器
make install
如果成功会提示:kong 0.14.1-0 is now installed in /usr/local (license: MIT)
四 :安装数据库
yum install https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpm -y
yum install postgresql10 -y
yum install postgresql10-server -y
/usr/pgsql-10/bin/postgresql-10-setup initdb
systemctl enable postgresql-10
systemctl start postgresql-10
创建数据库
su - postgres
psql
CREATE USER kong; CREATE DATABASE kong OWNER kong;
\q
exit;