Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

docker compose kong

# ---------- INSTALL POSTGRESS 9.6 --------------#
yum -y install epel-release wget vim net-tools htop
# Install the repository RPM:
yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm

# Install PostgreSQL:
yum install -y postgresql96-server

# Optionally initialize the database and enable automatic start:
/usr/pgsql-9.6/bin/postgresql96-setup initdb
systemctl enable postgresql-9.6
systemctl start postgresql-9.6

sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'Lequockhoi123@';"
sudo -u postgres psql -c "CREATE USER kong;"
sudo -u postgres psql -c "CREATE DATABASE kong OWNER kong;"
sudo -u postgres psql -c "ALTER USER kong WITH PASSWORD 'Lequockhoi123@';"
rm -rf /var/lib/pgsql/9.6/data/pg_hba.conf
cat <<EOT >>  /var/lib/pgsql/9.6/data/pg_hba.conf
# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     ident
# IPv4 local connections:
host    all             all             127.0.0.1/32            password
# IPv6 local connections:
host    all             all             ::1/128                 password
EOT
systemctl restart postgresql-9.6

# ---------- INSTALL KONG --------------#
# Kong Repo
rm -f /etc/yum.repos.d/bintray-kong-kong-community-edition-rpm.repo
cat <<EOT >> /etc/yum.repos.d/bintray-kong-kong-community-edition-rpm.repo
#bintray--kong-kong-community-edition-rpm - packages by  from Bintray
[bintray--kong-kong-community-edition-rpm]
name=bintray--kong-kong-community-edition-rpm
baseurl=https://kong.bintray.com/kong-community-edition-rpm/centos/7
gpgcheck=0
repo_gpgcheck=0
enabled=1
EOT

# Install Kong From Repo
yum -y update
yum -y install kong-community-edition

cat <<EOT >> /etc/kong/kong.conf
proxy_listen = 0.0.0.0:8003, 0.0.0.0:8443 ssl
admin_listen = 0.0.0.0:8004, 0.0.0.0:8444 ssl

database = postgres
pg_host = 127.0.0.1
pg_port = 5432
pg_user = kong
pg_password = Lequockhoi123@
pg_database = kong
EOT

kong migrations bootstrap /etc/kong/kong.conf
ulimit -n 4096
cat <<EOT >> /etc/systemd/system/kongd.service
[Unit]
Description= kong service
After=syslog.target network.target


[Service]
User=root
Group=root
Type=forking
ExecStart=/usr/local/bin/kong start -c /etc/kong/kong.conf --vv
ExecReload=/usr/local/bin/kong reload
ExecStop=/usr/local/bin/kong stop

[Install]
WantedBy=multi-user.target
EOT
systemctl daemon-reload
systemctl enable kongd
systemctl start kongd
Comment

PREVIOUS NEXT
Code Example
Shell :: Roughly list out the background processs being run using nohup on linux server 
Shell :: install xinput 
Shell :: Recipe to merge git 
Shell :: grep -R exlude directory 
Shell :: expo install safe area provider 
Shell :: delete the branch with the old name on the remote repository 
Shell :: copy linux command with all hiden files 
Shell :: linux between subshell variables 
Shell :: How to search for files using ? to match file extension 
Shell :: install openvino for ubuntu 20 
Shell :: docker Redirecting Both stdout and stderr file 
Shell :: remove a complete directory 
Shell :: brew install erlang 
Shell :: add folder on terminal 
Shell :: removing large files 
Shell :: "mkdir -p" exemple 
Shell :: bash rename different file names with zero padding 
Shell :: ssh remove file command 
Shell :: virtmanager network autostart 
Shell :: mkdir mode 
Shell :: camtasia code linux terminal 
Shell :: save admin credentials for program 
Shell :: Remove any previous Go installation 
Shell :: format volume diskpart 
Shell :: cmd.exe /s /k pushd "%V" run as admin 
Shell :: how to install multible package in linux one line of code 
Shell :: watchan windows latest release 
Shell :: install convox 
Shell :: Terraform to upgrade modules and plugins 
Shell :: xfce4-notes install 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =