本文环境基于Ubuntu1604
安装PostgreSQL
sudo apt install -y postgresql postgresql-contrib pgadmin3
sudo passwd postgres
sudo su - postgres
psql postgres
CREATE USER kong WITH PASSWORD '123456';
CREATE DATABASE "kong";
# DROP DATABASE "kong";
GRANT ALL PRIVILEGES ON DATABASE "kong" to kong;
安装Kong
sudo apt install -y openssl libpcre3 procps perl
sudo dpkg -i kong-community-edition-0.14.0.xenial.all.deb
sudo cp /etc/kong/kong.conf.default /etc/kong/kong.conf
sudo vim /etc/kong/kong.conf
pg_host = 127.0.0.1
pg_port = 5432
pg_user = kong
pg_password = 123456
pg_database = kong
kong migrations up
sudo kong start
# Kong started
curl -i http://localhost:8001/
# HTTP/1.1 200 OK
# Server: kong/0.14.0
安装Kong-Dashboard
cnpm i -g kong-dashboard
nohup kong-dashboard start \
--kong-url http://localhost:8001 \
--port=8002 \
--basic-auth kong=123456 &
网友评论