logo jittagornp.me

ติดตั้ง Kong บน Ubuntu 18.04

1. ติดตั้ง Kong

$ sudo apt-get update
$ sudo apt-get install -y apt-transport-https curl lsb-core
$ echo "deb https://kong.bintray.com/kong-deb `lsb_release -sc` main" | sudo tee -a /etc/apt/sources.list
$ curl -o bintray.key https://bintray.com/user/downloadSubjectPublicKey?username=bintray
$ sudo apt-key add bintray.key
$ sudo apt-get update
$ sudo apt-get install -y kong

2. แก้ Config

/etc/kong/kong.conf

$ cd /etc/kong
$ cp kong.conf.default kong.conf
$ vi kong.conf  

Remove comments and set config following
/etc/kong/kong.conf

proxy_listen = 0.0.0.0:80, 0.0.0.0:443 ssl
admin_listen = 0.0.0.0:8001, 127.0.0.1:8444 ssl
database = postgres
pg_host = {DATABASE_IP}
pg_port = {DATABASE_PORT}
pg_user = {DATABASE_USERNAME}
pg_password = {DATABASE_PASSWORD}
pg_database = {DATABASE_NAME}
pg_schema = {DATABASE_SCHEMA}

save

3. ทำการ Migrate Data เข้า Kong

$ kong migrations bootstrap -c /etc/kong/kong.conf

4. ทำการ Start Kong

$ kong start -c /etc/kong/kong.conf  

Note

Stop Kong

$ kong stop  

การติดตั้ง Kong โดยใช้ Docker

สามารถเรียนรู้ได้จาก

Reference

https://docs.konghq.com/install/ubuntu/

สำหรับเพื่อน ๆ คนไหน ที่ชื่นชอบบทความ และอยากจะสนุนสนันค่ากาแฟเล็ก ๆ น้อย ๆ สามารถคลิกที่ปุ่มนี้เพื่อไปยังหน้า Buy me a coffee ได้ครับ
profile photo
จิตกร พิทักษ์เมธากุล fire fire fire
วิศกรซอฟต์แวร์ ที่หลงรักการเขียนซอฟต์แวร์ และมีความสุขกับการได้อยู่กับครอบครัว ♥️