zoukankan      html  css  js  c++  java
  • centos7下安装kong

    参考:https://www.cnblogs.com/duanxz/p/10364783.html

     一、安装

    1、已经安装好postgresql,可以参考这个博客

    https://www.cnblogs.com/stulzq/p/7766409.html

    2、碰到的问题

    2.1 如果报错

    错误: 函数 to_regclass(unknown) 不存在 (12)
    参考 https://www.lijiaocn.com/%E9%97%AE%E9%A2%98/2018/09/29/kong-usage-problem-and-solution.html, postgresql版本升级就可以。
    sudo yum install https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-1.noarch.rpm
    #sudo yum install https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm

    kong migrations bootstrap
    2.2 kong migrations up -c /etc/kong/kong.conf.default  
    执行这个的时候"Ident 认证失败"可以用参考网址的方法
    我用的是postgresql10版本,
    sudo vim /var/lib/pgsql/10/data/pg_hba.conf
    修改对应的地方为password

    2.3 kong start -c /etc/kong/kong.conf --vv
    执行这个的时候报没有权限,就用sudo执行
    sudo /usr/local/bin/kong start -c /etc/kong/kong.conf --vv

    2019/10/22 17:38:44 [debug] starting nginx: /usr/local/openresty/nginx/sbin/nginx -p /usr/local/kong -c nginx.conf
    2019/10/22 17:38:47 [debug] nginx started
    2019/10/22 17:38:47 [info] Kong started

    安装成功了!  本人qq: 575654643
    
    
    二、修改配置
    默认只能localhost查看界面

    curl -i http://localhost:8001/
    不能主机外访问,需要修改admin_listen
    admin_listen = 0.0.0.0:8001, 0.0.0.0:8444 ssl

    修改之后重启
    sudo /usr/local/bin/kong restart -c /etc/kong/kong.conf --vv


    三、使用kong

    。。。。。。




  • 相关阅读:
    函数作业1
    函数、装饰器、迭代器、内置方法总练习题
    疑问
    装饰器
    文件练习题1,2
    内置函数练习题和总结
    GET和POST请求的区别
    HTTP请求方法
    HTTP之状态码
    HTTP之响应消息Response
  • 原文地址:https://www.cnblogs.com/qq575654643/p/11721015.html
Copyright © 2011-2022 走看看