api gateway kong的安装与使用

install kong

https://konghq.com/install/

wget -O kong-community-edition-0.13.1.xenial.all.deb https://bintray.com/kong/kong-community-edition-deb/download_file?file_path=dists/kong-community-edition-0.13.1.xenial.all.deb
sudo apt-get update
sudo apt-get install openssl libpcre3 procps perl
sudo dpkg -i kong-community-edition-0.13.1.*.deb

install postgresql

sudo vim /etc/postgresql/9.5/main/postgresql.conf 
search :/listen
listen_addresses = '*'
password_encryption = on
  1. 修改配置文件pg_hba.conf
sudo vim /etc/postgresql/9.5/main/pg_hba.conf
host all all 0.0.0.0/0  md5
  1. 重启postgres
sudo service postgresql restart
  1. 修改口令
    安装过程中,系统已经添加了postgres的用户,并且这个用户的环境变量都设置好了,命令行工具很丰富.
sudo passwd postgres

然后切换到用户,修改postgre数据库的密码

su - postgres

修改密码

postgres@vos2016062102:~$ psql postgres 
psql (9.5.3)
输入 "help" 来获取帮助信息.

postgres=# alter user postgres with password 'your password';
ALTER ROLE
postgres=# 

5. create database for kong

先创建用户

CREATE USER kong WITH PASSWORD 'kong';
(wtever :遇到kong.conf kong migrations pgsql  auth fail; alter user kong with password 'kong'; )

创建数据库,并给用户授权

create database "kong";

GRANT ALL PRIVILEGES ON DATABASE "kong" to kong;

postgres相关处理:

修改postgresql 默认用户postgres密码,生成一个用户(kong)for kong database;
su - postgres
psql
alter user postgres with password 'your password';      
get:ALTER ROLE
CREATE USER kong WITH PASSWORD 'kong';

postgresql如何允许外界连接: http://lazybios.com/2016/11/how-to-make-postgreSQL-can-be-accessed-from-remote-client/

QAQ:
1.安装之后 virtualHost:8000 无反应:将kong.conf关于端口的注释关闭

你可能感兴趣的:(api gateway kong的安装与使用)