Skip to content

Configuration#

Gluu Gateway#

The gluu-gateway service is used to manage all GG components, including the Admin GUI Portal Konga, Kong, Postgres and the oxd Server.

Warning

Stopping one service may affect others. Make sure all required services are up and running to provide a stable Gluu Gateway environment.

  • Manage the gluu-gateway service:

    service gluu-gateway [start|stop|restart|status]
    

Admin GUI Portal - Konga#

  • Configure Konga by setting properties in the local.js file. This is used to set the port, oxd, OP and client settings.

     /opt/gluu-gateway-ui/config/local.js
    
    Property Description
    kong_admin_url Used to set Kong admin URL
    connections Used to set Postgres DB configuration for Admin GUI
    models Used to set the Database model
    session Session secret is automatically generated when the new app is created. It uses Connect's cookie parser to normalize configuration differences between Express and Socket.io and hooks into Sails' middleware interpreter to allow you to access and auto-save to req.session with Socket.io the same way as with Express.
    ssl Used to set SSL certificates for the GUI Application. This enables the application to use https
    port Used to set application port
    environment Used to set project environment. Konga and Gluu Gateway service start application with production environment.
    log Used to set the log level
    oxdWeb Used to set oxd Server URL
    opHost Used to set your OP server URL
    oxdId Used to set the oxd OP client oxd_id, which is used for login in GG GUI
    clientId Used to set the OP Client's client id, which is used for login in GG GUI
    clientSecret Used to set the OP Client's client secret, which is used for login in GG GUI
    oxdVersion Used to set oxd server version
    ggVersion It shows the Gluu Gateway version
    explicitHost Used to define the Gluu Gateway GUI host explicitly. It by default listens to localhost only for security. You can set it with global IP to access GUI globally.
    postgresVersion Postgres DB Version
    ggUIRedirectURLHost It is used to set the redirect url and logout redirect url for GG UI Client login/logout request.
    ggHost It is your GG Kong Gateway Host. It is useful for plugin configuration.

    GUI is in sailsjs-v0.12 node js framework. For more detail configuration take a look on sailjs documentation.

  • Manage the Konga service

    service konga [start|stop|restart|status]
    

Kong#

  • Configure Kong by using the kong.conf file.

    /etc/kong/kong.conf
    
  • Manage the Kong service

    service kong [restart|stop|restart|status]
    
  • SSL Certs setup

    Use kong.conf for setup ssl certs for Kong Proxy and Kong Admin API. Below are the properties in kong.conf:

    For Properties
    Proxy
    • ssl_cert
    • ssl_cert_key
    Admin API
    • admin_ssl_cert
    • admin_ssl_cert_key
    CA Certs
    • lua_ssl_trusted_certificate

oxd#

Refer to the oxd docs for more information on the topics below.

  • Configure the oxd Server

    /opt/oxd-server/conf/oxd-server.yml
    
  • Manage the oxd Server service

    service oxd-server [start|stop|restart|status]
    

Restore Kong to factory default#

Execute the following sequence of commands:

  1. Stop Kong.

    service kong stop
    
  2. The reset option is used to reset the configured database. It deletes all the tables and data of the configured database.

    service kong migrations reset
    
  3. The bootstrap option is used to create a table in the configured database. It also executes all missing migrations up to the latest available one.

    service kong migrations bootstrap
    
  4. Start Kong.

    service kong start
    

Migrate from Development to Production#

To migrate data from a development server to the production server, follow these steps. Depending on the setup, some steps may not be required.

  • Export kong and konga database from development server.
pg_dump --dbname=postgresql://[user]:[password]@localhost:5432/konga > konga.sql
pg_dump --dbname=postgresql://[user]:[password]@localhost:5432/konga > kong.sql
  • Install and set up GG on the production server.

  • Stop the oxd server on the production server.

  • Replace the oxd DB files, located in /opt/oxd-server/data/, in the production server with those in the development server.

  • Start the oxd server with service oxd-server start.

  • Stop Kong and Konga with service kong stop and service konga stop.

  • Drop konga and kong databases on the production server.

    sudo -iu postgres /bin/bash -c 'psql -c "Drop database konga"'
    
    sudo -iu postgres /bin/bash -c 'psql -c "Drop database kong"'
    
  • Create two databases named konga and kong.

    sudo -iu postgres /bin/bash -c 'psql -c "Create database konga"'
    
    sudo -iu postgres /bin/bash -c 'psql -c "Create database kong"'
    
  • Import the above SQL file in production server.

    sudo -iu postgres /bin/bash -c "psql konga < absolute_path/konga.sql"
    
    sudo -iu postgres /bin/bash -c "psql kong < absolute_path/kong.sql"
    
  • Start the Kong and Konga services with service kong start and service konga stop.

If using a different Gluu Server in production than in development, configure the plugin in production with the new client credentials.

Info

absolute_path is full path of your file. For example, if your file is in home folder, the path is /home/konga.sql.