How to install Openresty webserver on Ubuntu 18.04

Bagaimana menginstall Openresty webserver di ubuntu 18.04

Install prerequisites yang di butuhkan untuk menambah public key

root@openresty:~# apt-get -y install --no-install-recommends wget gnupg ca-certificates
Reading package lists... Done
Building dependency tree
Reading state information... Done
ca-certificates is already the newest version (20201027ubuntu0.18.04.1).
wget is already the newest version (1.19.4-1ubuntu2.2).
The following additional packages will be installed:
dirmngr gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server
gpgconf gpgsm libassuan0 libksba8 libnpth0 pinentry-curses
Suggested packages:
dbus-user-session pinentry-gnome3 tor parcimonie xloadimage scdaemon
pinentry-doc
The following NEW packages will be installed:
dirmngr gnupg gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client
gpg-wks-server gpgconf gpgsm libassuan0 libksba8 libnpth0 pinentry-curses
0 upgraded, 14 newly installed, 0 to remove and 0 not upgraded.
Need to get 2123 kB of archives.
After this operation, 6041 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu bionic/main amd64 libassuan0 amd64 2.5.1-2 [35.0 kB]
Get:2 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 gpgconf amd64 2.2.4-1ubuntu1.3 [123 kB]
Get:3 http://archive.ubuntu.com/ubuntu bionic/main amd64 libksba8 amd64 1.3.5-2 [92.6 kB]
Get:4 http://archive.ubuntu.com/ubuntu bionic/main amd64 libnpth0 amd64 1.5-3 [7668 B]
Get:5 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 dirmngr amd64 2.2.4-1ubuntu1.3 [316 kB]
Get:6 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 gnupg-l10n all 2.2.4-1ubuntu1.3 [49.7 kB]
Get:7 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 gnupg-utils amd64 2.2.4-1ubuntu1.3 [127 kB]
Get:8 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 gpg amd64 2.2.4-1ubuntu1.3 [467 kB]
Get:9 http://archive.ubuntu.com/ubuntu bionic/main amd64 pinentry-curses amd64 1.1.0-1 [35.8 kB]
Get:10 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 gpg-agent amd64 2.2.4-1ubuntu1.3 [227 kB]
Get:11 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 gpg-wks-client amd64 2.2.4-1ubuntu1.3 [91.8 kB]
Get:12 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 gpg-wks-server amd64 2.2.4-1ubuntu1.3 [85.0 kB]
Get:13 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 gpgsm amd64 2.2.4-1ubuntu1.3 [215 kB]
Get:14 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 gnupg amd64 2.2.4-1ubuntu1.3 [249 kB]
Fetched 2123 kB in 3s (624 kB/s)
Selecting previously unselected package libassuan0:amd64.
(Reading database ... 17086 files and directories currently installed.)
Preparing to unpack .../00-libassuan0_2.5.1-2_amd64.deb ...
Unpacking libassuan0:amd64 (2.5.1-2) ...
Selecting previously unselected package gpgconf.
Preparing to unpack .../01-gpgconf_2.2.4-1ubuntu1.3_amd64.deb ...
Unpacking gpgconf (2.2.4-1ubuntu1.3) ...
Selecting previously unselected package libksba8:amd64.
Preparing to unpack .../02-libksba8_1.3.5-2_amd64.deb ...
Unpacking libksba8:amd64 (1.3.5-2) ...
Selecting previously unselected package libnpth0:amd64.
Preparing to unpack .../03-libnpth0_1.5-3_amd64.deb ...
Unpacking libnpth0:amd64 (1.5-3) ...
Selecting previously unselected package dirmngr.
Preparing to unpack .../04-dirmngr_2.2.4-1ubuntu1.3_amd64.deb ...
Unpacking dirmngr (2.2.4-1ubuntu1.3) ...
Selecting previously unselected package gnupg-l10n.
Preparing to unpack .../05-gnupg-l10n_2.2.4-1ubuntu1.3_all.deb ...
Unpacking gnupg-l10n (2.2.4-1ubuntu1.3) ...
Selecting previously unselected package gnupg-utils.
Preparing to unpack .../06-gnupg-utils_2.2.4-1ubuntu1.3_amd64.deb ...
Unpacking gnupg-utils (2.2.4-1ubuntu1.3) ...
Selecting previously unselected package gpg.
Preparing to unpack .../07-gpg_2.2.4-1ubuntu1.3_amd64.deb ...
Unpacking gpg (2.2.4-1ubuntu1.3) ...
Selecting previously unselected package pinentry-curses.
Preparing to unpack .../08-pinentry-curses_1.1.0-1_amd64.deb ...
Unpacking pinentry-curses (1.1.0-1) ...
Selecting previously unselected package gpg-agent.
Preparing to unpack .../09-gpg-agent_2.2.4-1ubuntu1.3_amd64.deb ...
Unpacking gpg-agent (2.2.4-1ubuntu1.3) ...
Selecting previously unselected package gpg-wks-client.
Preparing to unpack .../10-gpg-wks-client_2.2.4-1ubuntu1.3_amd64.deb ...
Unpacking gpg-wks-client (2.2.4-1ubuntu1.3) ...
Selecting previously unselected package gpg-wks-server.
Preparing to unpack .../11-gpg-wks-server_2.2.4-1ubuntu1.3_amd64.deb ...
Unpacking gpg-wks-server (2.2.4-1ubuntu1.3) ...
Selecting previously unselected package gpgsm.
Preparing to unpack .../12-gpgsm_2.2.4-1ubuntu1.3_amd64.deb ...
Unpacking gpgsm (2.2.4-1ubuntu1.3) ...
Selecting previously unselected package gnupg.
Preparing to unpack .../13-gnupg_2.2.4-1ubuntu1.3_amd64.deb ...
Unpacking gnupg (2.2.4-1ubuntu1.3) ...
Setting up libnpth0:amd64 (1.5-3) ...
Setting up libksba8:amd64 (1.3.5-2) ...
Setting up gnupg-l10n (2.2.4-1ubuntu1.3) ...
Setting up libassuan0:amd64 (2.5.1-2) ...
Setting up gpgconf (2.2.4-1ubuntu1.3) ...
Setting up gpgsm (2.2.4-1ubuntu1.3) ...
Setting up gnupg-utils (2.2.4-1ubuntu1.3) ...
Setting up pinentry-curses (1.1.0-1) ...
Setting up dirmngr (2.2.4-1ubuntu1.3) ...
Setting up gpg (2.2.4-1ubuntu1.3) ...
Setting up gpg-agent (2.2.4-1ubuntu1.3) ...
Setting up gpg-wks-server (2.2.4-1ubuntu1.3) ...
Setting up gpg-wks-client (2.2.4-1ubuntu1.3) ...
Setting up gnupg (2.2.4-1ubuntu1.3) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for install-info (6.5.0.dfsg.1-2) ...
Processing triggers for libc-bin (2.27-3ubuntu1.3) ...

Import GPG Key:

root@openresty:~# wget -O - https://openresty.org/package/pubkey.gpg | sudo apt-key add -
--2021-07-14 11:31:45-- https://openresty.org/package/pubkey.gpg
Resolving openresty.org (openresty.org)... 18.138.237.72
Connecting to openresty.org (openresty.org)|18.138.237.72|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1688 (1.6K) [text/plain]
Saving to: 'STDOUT'

- 100%[===================>] 1.65K --.-KB/s in 0s

2021-07-14 11:31:47 (24.3 MB/s) - written to stdout [1688/1688]

OK

Menambah repository openresty:

root@openresty:~# echo "deb http://openresty.org/package/ubuntu $(lsb_release -sc) main" \
> | sudo tee /etc/apt/sources.list.d/openresty.list
deb http://openresty.org/package/ubuntu bionic main

Kita update terlebih dahulu repositorynya:

root@openresty:~# apt-get update
Get:1 http://openresty.org/package/ubuntu bionic InRelease [2827 B]
Hit:2 http://archive.ubuntu.com/ubuntu bionic InRelease
Get:3 http://openresty.org/package/ubuntu bionic/main amd64 Packages [28.5 kB]
Get:4 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:5 http://archive.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:6 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [2131 kB]
Get:7 http://archive.ubuntu.com/ubuntu bionic-updates/main Translation-en [422 kB]
Get:8 http://archive.ubuntu.com/ubuntu bionic-updates/restricted amd64 Packages [389 kB]
Get:9 http://archive.ubuntu.com/ubuntu bionic-updates/restricted Translation-en [52.8 kB]
Get:10 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [1739 kB]
Get:11 http://archive.ubuntu.com/ubuntu bionic-updates/universe Translation-en [371 kB]
Get:12 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 Packages [26.6 kB]
Get:13 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse Translation-en [6792 B]
Get:14 http://archive.ubuntu.com/ubuntu bionic-security/main amd64 Packages [1784 kB]
Get:15 http://archive.ubuntu.com/ubuntu bionic-security/main Translation-en [329 kB]
Get:16 http://archive.ubuntu.com/ubuntu bionic-security/restricted amd64 Packages [365 kB]
Get:17 http://archive.ubuntu.com/ubuntu bionic-security/restricted Translation-en [48.9 kB]
Get:18 http://archive.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [1130 kB]
Get:19 http://archive.ubuntu.com/ubuntu bionic-security/universe Translation-en [256 kB]
Get:20 http://archive.ubuntu.com/ubuntu bionic-security/multiverse amd64 Packages [19.2 kB]
Get:21 http://archive.ubuntu.com/ubuntu bionic-security/multiverse Translation-en [4412 B]
Fetched 9284 kB in 10s (971 kB/s)
Reading package lists... Done

Selanjutnya kita install openresty dengan apt-get

root@openresty:~# apt-get -y install openresty
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libgdbm-compat4 libperl5.26 openresty-openssl111 openresty-opm
openresty-pcre openresty-resty openresty-zlib perl perl-modules-5.26
Suggested packages:
openresty-restydoc perl-doc libterm-readline-gnu-perl
| libterm-readline-perl-perl make
The following NEW packages will be installed:
libgdbm-compat4 libperl5.26 openresty openresty-openssl111 openresty-opm
openresty-pcre openresty-resty openresty-zlib perl perl-modules-5.26
0 upgraded, 10 newly installed, 0 to remove and 90 not upgraded.
Need to get 9278 kB of archives.
After this operation, 50.5 MB of additional disk space will be used.
Get:1 http://openresty.org/package/ubuntu bionic/main amd64 openresty-zlib amd64 1.2.11-3~bionic1 [54.7 kB]
Get:2 http://openresty.org/package/ubuntu bionic/main amd64 openresty-openssl111 amd64 1.1.1k-1~bionic1 [1481 kB]
Get:3 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 perl-modules-5.26 all 5.26.1-6ubuntu0.5 [2762 kB]
Get:4 http://archive.ubuntu.com/ubuntu bionic/main amd64 libgdbm-compat4 amd64 1.14.1-6 [6084 B]
Get:5 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libperl5.26 amd64 5.26.1-6ubuntu0.5 [3534 kB]
Get:6 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 perl amd64 5.26.1-6ubuntu0.5 [201 kB]
Get:7 http://openresty.org/package/ubuntu bionic/main amd64 openresty-pcre amd64 8.44-1~bionic1 [158 kB]
Get:8 http://openresty.org/package/ubuntu bionic/main amd64 openresty amd64 1.19.3.2-1~bionic1 [1048 kB]
Get:9 http://openresty.org/package/ubuntu bionic/main amd64 openresty-resty all 1.19.3.2-1~bionic1 [13.7 kB]
Get:10 http://openresty.org/package/ubuntu bionic/main amd64 openresty-opm amd64 1.19.3.2-1~bionic1 [19.2 kB]
Fetched 9278 kB in 12s (752 kB/s)
Selecting previously unselected package perl-modules-5.26.
(Reading database ... 17272 files and directories currently installed.)
Preparing to unpack .../0-perl-modules-5.26_5.26.1-6ubuntu0.5_all.deb ...
Unpacking perl-modules-5.26 (5.26.1-6ubuntu0.5) ...
Selecting previously unselected package libgdbm-compat4:amd64.
Preparing to unpack .../1-libgdbm-compat4_1.14.1-6_amd64.deb ...
Unpacking libgdbm-compat4:amd64 (1.14.1-6) ...
Selecting previously unselected package libperl5.26:amd64.
Preparing to unpack .../2-libperl5.26_5.26.1-6ubuntu0.5_amd64.deb ...
Unpacking libperl5.26:amd64 (5.26.1-6ubuntu0.5) ...
Selecting previously unselected package perl.
Preparing to unpack .../3-perl_5.26.1-6ubuntu0.5_amd64.deb ...
Unpacking perl (5.26.1-6ubuntu0.5) ...
Selecting previously unselected package openresty-zlib.
Preparing to unpack .../4-openresty-zlib_1.2.11-3~bionic1_amd64.deb ...
Unpacking openresty-zlib (1.2.11-3~bionic1) ...
Selecting previously unselected package openresty-openssl111.
Preparing to unpack .../5-openresty-openssl111_1.1.1k-1~bionic1_amd64.deb ...
Unpacking openresty-openssl111 (1.1.1k-1~bionic1) ...
Selecting previously unselected package openresty-pcre.
Preparing to unpack .../6-openresty-pcre_8.44-1~bionic1_amd64.deb ...
Unpacking openresty-pcre (8.44-1~bionic1) ...
Selecting previously unselected package openresty.
Preparing to unpack .../7-openresty_1.19.3.2-1~bionic1_amd64.deb ...
Unpacking openresty (1.19.3.2-1~bionic1) ...
Selecting previously unselected package openresty-resty.
Preparing to unpack .../8-openresty-resty_1.19.3.2-1~bionic1_all.deb ...
Unpacking openresty-resty (1.19.3.2-1~bionic1) ...
Selecting previously unselected package openresty-opm.
Preparing to unpack .../9-openresty-opm_1.19.3.2-1~bionic1_amd64.deb ...
Unpacking openresty-opm (1.19.3.2-1~bionic1) ...
Setting up openresty-pcre (8.44-1~bionic1) ...
Setting up openresty-zlib (1.2.11-3~bionic1) ...
Setting up openresty-openssl111 (1.1.1k-1~bionic1) ...
Setting up perl-modules-5.26 (5.26.1-6ubuntu0.5) ...
Setting up libgdbm-compat4:amd64 (1.14.1-6) ...
Setting up openresty (1.19.3.2-1~bionic1) ...
Created symlink /etc/systemd/system/multi-user.target.wants/openresty.service -> /lib/systemd/system/openresty.service.
Setting up libperl5.26:amd64 (5.26.1-6ubuntu0.5) ...
Setting up perl (5.26.1-6ubuntu0.5) ...
Setting up openresty-resty (1.19.3.2-1~bionic1) ...
Setting up openresty-opm (1.19.3.2-1~bionic1) ...
Processing triggers for systemd (237-3ubuntu10.43) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for ureadahead (0.100.0-21) ...
Processing triggers for libc-bin (2.27-3ubuntu1.3) ...
root@openresty:~#

Kita Test apakah sudah berjalan

root@openresty:~# curl -sI localhost
HTTP/1.1 200 OK
Server: openresty/1.19.3.2
Date: Wed, 14 Jul 2021 11:39:56 GMT
Content-Type: text/html
Content-Length: 1097
Last-Modified: Tue, 01 Jun 2021 04:50:37 GMT
Connection: keep-alive
ETag: "60b5bc9d-449"
Accept-Ranges: bytes

root@openresty:~#

How to: Upgrade from Proxmox 6.1-7 to Proxmox 6.3 (PVE)

Pertama login melalui SSH kemudian ketik

$ pveversion -v

Langkah selanjutnya edit pada bagian /etc/apt/source.list

$ nano /etc/apt/source.list

Tambahkan repositori berikut dan yg lama di beri tanda pagar

#deb http://ftp.debian.org/debian buster main contrib

#deb http://ftp.debian.org/debian buster-updates main contrib
deb http://deb.debian.org/debian buster main contrib

deb http://deb.debian.org/debian buster-updates main contrib

# security updates
deb http://security.debian.org buster/updates main contrib

# Tambahan supaya bisa versi terbaru tapi tidak rekomendasi untuk produksi.
deb http://download.proxmox.com/debian/pve buster pve-no-subscription

kemudian simpan dengan tekan ctrl+o dan dilanjutkan ctrl+q

Selanjutnya edit pada file berikut dan di beri tanda pagar

$nano /etc/apt/sources.list.d/pve-enterprise.list

Beri tanda pagar pada link repository berikut, ini di maksudkan untuk mendisable jika tidak menggunakan versi proxmox yang subscription.

# deb https://enterprise.proxmox.com/debian/pve buster pve-enterprise

Selanjutnya tekan ctrl+o dan ctrl+q.

Langkah selanjutnya adalah kita update dan dist-upgrade
$ apt update && apt dist-upgrade -y

Tunggu sampai proses selesai dan file yang di download lumayan besar sekitar 755MB. Apabila sudah selesai kemudian kita reboot
$ reboot

Selanjutnya cek versi:

root@pve:~# pveversion -v
proxmox-ve: 6.3-1 (running kernel: 5.4.106-1-pve)
pve-manager: 6.3-6 (running version: 6.3-6/2184247e)
pve-kernel-5.4: 6.3-8
pve-kernel-helper: 6.3-8
pve-kernel-5.3: 6.1-6
pve-kernel-5.4.106-1-pve: 5.4.106-1
pve-kernel-5.3.18-3-pve: 5.3.18-3
pve-kernel-5.3.18-2-pve: 5.3.18-2
ceph-fuse: 12.2.11+dfsg1-2.1+b1
corosync: 3.1.0-pve1
criu: 3.11-3
glusterfs-client: 5.5-3
ifupdown: residual config
ifupdown2: 3.0.0-1+pve3
ksm-control-daemon: 1.3-1
libjs-extjs: 6.0.1-10
libknet1: 1.20-pve1
libproxmox-acme-perl: 1.0.8
libproxmox-backup-qemu0: 1.0.3-1
libpve-access-control: 6.1-3
libpve-apiclient-perl: 3.1-3
libpve-common-perl: 6.3-5
libpve-guest-common-perl: 3.1-5
libpve-http-server-perl: 3.1-1
libpve-storage-perl: 6.3-7
libqb0: 1.0.5-1
libspice-server1: 0.14.2-4~pve6+1
lvm2: 2.03.02-pve4
lxc-pve: 4.0.6-2
lxcfs: 4.0.6-pve1
novnc-pve: 1.1.0-1
proxmox-backup-client: 1.0.11-1
proxmox-mini-journalreader: 1.1-1
proxmox-widget-toolkit: 2.4-9
pve-cluster: 6.2-1
pve-container: 3.3-4
pve-docs: 6.3-1
pve-edk2-firmware: 2.20200531-1
pve-firewall: 4.1-3
pve-firmware: 3.2-2
pve-ha-manager: 3.1-1
pve-i18n: 2.2-2
pve-qemu-kvm: 5.2.0-4
pve-xtermjs: 4.7.0-3
qemu-server: 6.3-8
smartmontools: 7.2-pve2
spiceterm: 3.1-1
vncterm: 1.6-2
zfsutils-linux: 2.0.4-pve1
root@pve:~#

versi kernel dan pve proxmox sudah menjadi versi 6.3