Skip to content

Instantly share code, notes, and snippets.

@anhldbk
Last active October 21, 2025 16:22
Show Gist options
  • Select an option

  • Save anhldbk/6692e47735cb3480f6fc9f694da922c3 to your computer and use it in GitHub Desktop.

Select an option

Save anhldbk/6692e47735cb3480f6fc9f694da922c3 to your computer and use it in GitHub Desktop.

Revisions

  1. anhldbk revised this gist Jan 15, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install.sh
    Original file line number Diff line number Diff line change
    @@ -25,7 +25,7 @@ mkdir ~/.config

    # Create /etc/init/kong.conf with following content
    ```sh
    start on filesystem or runlevel [2345]
    start on runlevel [2345]
    stop on shutdown
    script
  2. anhldbk revised this gist Jan 15, 2017. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions install.sh
    Original file line number Diff line number Diff line change
    @@ -15,7 +15,7 @@ sudo dpkg -i kong-0.9.7.xenial_all.deb
    sudo bash -c "echo -e 'pg_user = kong\npg_password = kong\npg_database = kong' > /etc/kong.conf"
    kong start -vv

    # autostart?
    # autostart with upstart
    sudo apt-get install upstart upstart-sysv
    sudo update-initramfs -u
    # remember the location of this script
    @@ -40,7 +40,6 @@ pre-stop script
    echo "[`date`] Stopping Kong Server" >> /var/log/kong.log
    end script
    ```
    sudo bash -c "echo -e 'start on startup\ntask\nexec $(pwd)/start.sh' > /etc/init/upstart.conf"


    sudo apt-get install npm
  3. anhldbk revised this gist Jan 15, 2017. 1 changed file with 18 additions and 0 deletions.
    18 changes: 18 additions & 0 deletions install.sh
    Original file line number Diff line number Diff line change
    @@ -22,6 +22,24 @@ sudo update-initramfs -u
    bash -c "echo -e 'kong start -vv' > start.sh"
    chmod +x start.sh
    mkdir ~/.config

    # Create /etc/init/kong.conf with following content
    ```sh
    start on filesystem or runlevel [2345]
    stop on shutdown
    script
    bash $(pwd)/start.sh
    end script
    pre-start script
    echo "[`date`] Starting Kong Server" >> /var/log/kong.log
    end script
    pre-stop script
    echo "[`date`] Stopping Kong Server" >> /var/log/kong.log
    end script
    ```
    sudo bash -c "echo -e 'start on startup\ntask\nexec $(pwd)/start.sh' > /etc/init/upstart.conf"


  4. anhldbk revised this gist Jan 15, 2017. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion install.sh
    Original file line number Diff line number Diff line change
    @@ -16,7 +16,8 @@ sudo bash -c "echo -e 'pg_user = kong\npg_password = kong\npg_database = kong' >
    kong start -vv

    # autostart?
    sudo apt-get install upstart
    sudo apt-get install upstart upstart-sysv
    sudo update-initramfs -u
    # remember the location of this script
    bash -c "echo -e 'kong start -vv' > start.sh"
    chmod +x start.sh
  5. anhldbk revised this gist Jan 14, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install.sh
    Original file line number Diff line number Diff line change
    @@ -21,7 +21,7 @@ sudo apt-get install upstart
    bash -c "echo -e 'kong start -vv' > start.sh"
    chmod +x start.sh
    mkdir ~/.config
    sudo bash -c "echo -e 'start on startup\ntask\nexec $(pwd)/start.sh' > ~/.config/upstart"
    sudo bash -c "echo -e 'start on startup\ntask\nexec $(pwd)/start.sh' > /etc/init/upstart.conf"


    sudo apt-get install npm
  6. anhldbk revised this gist Jan 14, 2017. 1 changed file with 2 additions and 7 deletions.
    9 changes: 2 additions & 7 deletions install.sh
    Original file line number Diff line number Diff line change
    @@ -1,21 +1,16 @@
    sudo apt-get install netcat openssl libpcre3 dnsmasq procps perl

    # for ubuntu 16.04 (xenial)
    # sudo add-apt-repository "deb https://apt.postgresql.org/pub/repos/apt YOUR_UBUNTU_VERSION_HERE-pgdg main"
    sudo add-apt-repository "deb https://apt.postgresql.org/pub/repos/apt xenial-pgdg main"


    sudo apt-get install postgresql-9.4 postgresql-contrib
    sudo apt-get -y install postgresql postgresql-contrib phppgadmin
    sudo -i -u postgres

    psql
    CREATE USER kong; CREATE DATABASE kong OWNER kong;
    ALTER USER kong WITH password 'kong';

    # for ubuntu 15.04
    wget https://github.com/Mashape/kong/releases/download/0.9.7/kong-0.9.7.vivid_all.deb
    # for ubuntu 16.04
    # https://github.com/Mashape/kong/releases/download/0.9.7/kong-0.9.7.xenial_all.deb
    https://github.com/Mashape/kong/releases/download/0.9.7/kong-0.9.7.xenial_all.deb
    sudo dpkg -i kong-0.9.7.xenial_all.deb
    sudo bash -c "echo -e 'pg_user = kong\npg_password = kong\npg_database = kong' > /etc/kong.conf"
    kong start -vv
  7. anhldbk revised this gist Jan 14, 2017. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions install.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,10 @@
    sudo apt-get install netcat openssl libpcre3 dnsmasq procps perl

    # for ubuntu 16.04 (xenial)
    # sudo add-apt-repository "deb https://apt.postgresql.org/pub/repos/apt YOUR_UBUNTU_VERSION_HERE-pgdg main"
    sudo add-apt-repository "deb https://apt.postgresql.org/pub/repos/apt xenial-pgdg main"


    sudo apt-get install postgresql-9.4 postgresql-contrib
    sudo -i -u postgres

  8. anhldbk revised this gist Jan 14, 2017. 1 changed file with 10 additions and 0 deletions.
    10 changes: 10 additions & 0 deletions install.sh
    Original file line number Diff line number Diff line change
    @@ -13,6 +13,16 @@ wget https://github.com/Mashape/kong/releases/download/0.9.7/kong-0.9.7.vivid_al
    sudo dpkg -i kong-0.9.7.xenial_all.deb
    sudo bash -c "echo -e 'pg_user = kong\npg_password = kong\npg_database = kong' > /etc/kong.conf"
    kong start -vv

    # autostart?
    sudo apt-get install upstart
    # remember the location of this script
    bash -c "echo -e 'kong start -vv' > start.sh"
    chmod +x start.sh
    mkdir ~/.config
    sudo bash -c "echo -e 'start on startup\ntask\nexec $(pwd)/start.sh' > ~/.config/upstart"


    sudo apt-get install npm
    sudo npm install -g n@latest
    sudo n stable
  9. anhldbk revised this gist Jan 14, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install.sh
    Original file line number Diff line number Diff line change
    @@ -11,7 +11,7 @@ wget https://github.com/Mashape/kong/releases/download/0.9.7/kong-0.9.7.vivid_al
    # for ubuntu 16.04
    # https://github.com/Mashape/kong/releases/download/0.9.7/kong-0.9.7.xenial_all.deb
    sudo dpkg -i kong-0.9.7.xenial_all.deb
    sudo echo -e 'pg_user = kong\npg_password = kong\npg_database = kong' > /etc/kong.conf
    sudo bash -c "echo -e 'pg_user = kong\npg_password = kong\npg_database = kong' > /etc/kong.conf"
    kong start -vv
    sudo apt-get install npm
    sudo npm install -g n@latest
  10. anhldbk revised this gist Jan 14, 2017. 1 changed file with 5 additions and 2 deletions.
    7 changes: 5 additions & 2 deletions install.sh
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,11 @@
    sudo apt-get install netcat openssl libpcre3 dnsmasq procps perl
    sudo apt-get install postgresql-9.4 postgresql-contrib
    sudo -i -u postgres
    postgres=# CREATE USER kong; CREATE DATABASE kong OWNER kong;
    postgres=# ALTER USER kong WITH password 'kong';

    psql
    CREATE USER kong; CREATE DATABASE kong OWNER kong;
    ALTER USER kong WITH password 'kong';

    # for ubuntu 15.04
    wget https://github.com/Mashape/kong/releases/download/0.9.7/kong-0.9.7.vivid_all.deb
    # for ubuntu 16.04
  11. anhldbk revised this gist Jan 14, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    sudo apt-get install netcat openssl libpcre3 dnsmasq procps perl
    sudo apt-get install postgresql postgresql-contrib
    sudo apt-get install postgresql-9.4 postgresql-contrib
    sudo -i -u postgres
    postgres=# CREATE USER kong; CREATE DATABASE kong OWNER kong;
    postgres=# ALTER USER kong WITH password 'kong';
  12. anhldbk revised this gist Jan 14, 2017. No changes.
  13. anhldbk revised this gist Jan 14, 2017. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions install.sh
    Original file line number Diff line number Diff line change
    @@ -3,6 +3,10 @@ sudo apt-get install postgresql postgresql-contrib
    sudo -i -u postgres
    postgres=# CREATE USER kong; CREATE DATABASE kong OWNER kong;
    postgres=# ALTER USER kong WITH password 'kong';
    # for ubuntu 15.04
    wget https://github.com/Mashape/kong/releases/download/0.9.7/kong-0.9.7.vivid_all.deb
    # for ubuntu 16.04
    # https://github.com/Mashape/kong/releases/download/0.9.7/kong-0.9.7.xenial_all.deb
    sudo dpkg -i kong-0.9.7.xenial_all.deb
    sudo echo -e 'pg_user = kong\npg_password = kong\npg_database = kong' > /etc/kong.conf
    kong start -vv
  14. anhldbk created this gist Jan 14, 2017.
    23 changes: 23 additions & 0 deletions install.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    sudo apt-get install netcat openssl libpcre3 dnsmasq procps perl
    sudo apt-get install postgresql postgresql-contrib
    sudo -i -u postgres
    postgres=# CREATE USER kong; CREATE DATABASE kong OWNER kong;
    postgres=# ALTER USER kong WITH password 'kong';
    sudo dpkg -i kong-0.9.7.xenial_all.deb
    sudo echo -e 'pg_user = kong\npg_password = kong\npg_database = kong' > /etc/kong.conf
    kong start -vv
    sudo apt-get install npm
    sudo npm install -g n@latest
    sudo n stable

    # install kong dashboard
    sudo npm install -g kong-dashboard

    # Start Kong Dashboard
    kong-dashboard start

    # To start Kong Dashboard on a custom port
    kong-dashboard start -p [port]

    # To start Kong Dashboard with basic auth
    kong-dashboard start -a user=password