Careful! You are browsing documentation for an outdated version of Kong. Go here to browse the documentation for the latest version.

How to Install Kong Enterprise and PostgreSQL onto Amazon Linux

Install Kong

EITHER (assuming free trial .rpm loaded locally)
$ sudo yum install
OR (non-free trial method)
$ sudo yum update
$ wget 'https://<BINTRAY_USER:<PASSWORD>' \
-O bintray-kong-kong-enterprise-edition-aws.repo \
$ sudo mv bintray-kong-kong-enterprise-edition-aws.repo /etc/yum.repos.d/
$ sudo vi /etc/yum.repos.d/bintray-kong-kong-enterprise-edition-aws.repo
# Ensure `baseurl` is correct
$ sudo yum install kong-enterprise-edition

Install Postgres

$ sudo yum install postgresql95 postgresql95-server
$ sudo service postgresql95 initdb
$ sudo service postgresql95 start
$ sudo -i -u postgres (puts you into new shell)

Create kong user

$ psql
> CREATE USER kong; CREATE DATABASE kong OWNER kong; ALTER USER kong WITH password 'kong'; 
> \q
$ exit

Add required DB and Kong settings

# Change entries from ident to md5
$ sudo vi /var/lib/pgsql95/data/pg_hba.conf
$ sudo service postgresql95 restart

# add contents of license file (copy and paste)
$ sudo vi /etc/kong/license.json

# Uncomment and add 'kong' to pg_password line
$ sudo vi /etc/kong/kong.conf.default

# Run migrations and start kong
$ kong migrations up -c /etc/kong/kong.conf.default
$ sudo /usr/local/bin/kong start -c /etc/kong/kong.conf.default

Test your Kong installation

$ curl -X POST \
--url 'http://localhost:8001/apis' \
--data 'name=demo' \
--data 'uris=/' \
--data 'upstream_url='
$ curl -X GET --url 'http://localhost:8000/ip'

Setup Admin GUI

# Get the local IP address
$ ifconfig 

# Uncomment the admin_listen setting, and update to 
# something like this `admin_listen =`
$ sudo vi /etc/kong/kong.conf.default 

# Restart kong
$ sudo /usr/local/bin/kong stop 
$ sudo /usr/local/bin/kong start -c /etc/kong/kong.conf.default

In a browser, load your server on port 8002

Keep up with the latest features