Skip to content

Instantly share code, notes, and snippets.

@alexanderankin
Last active December 21, 2023 20:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexanderankin/d9e084f64f5166250710170cec97d7bd to your computer and use it in GitHub Desktop.
Save alexanderankin/d9e084f64f5166250710170cec97d7bd to your computer and use it in GitHub Desktop.

openresty installation

ubuntu

adapted instructions from https://blog.openresty.com/en/ubuntu20-or-install/

apt update
# install wget and gpg for apt key downloading
apt install -y wget gpg gnupg-l10n-

# add openresty key
wget -O - https://openresty.org/package/pubkey.gpg \
  | gpg --dearmor \
  | tee /etc/apt/trusted.gpg.d/openresty.gpg \
  > /dev/null

arch=$(case $(uname -m) in x86_64) echo amd64;; arm64) echo arm64;; *) echo all;; esac)
c=$(. /etc/os-release; echo $VERSION_CODENAME)

# add openresty repo
# 'lsb_release -sc' not available in minimal envs
echo "deb [arch=$arch signed-by=/etc/apt/trusted.gpg.d/openresty.gpg] http://openresty.org/package/ubuntu $c main" \
  | tee /etc/apt/sources.list.d/openresty.list \
  > /dev/null

apt update

# no curl and no perl
#apt install -y openresty curl- perl-
apt install -y --no-install-recommends openresty

rhel

{ dnf -h > /dev/null 2>&1 && dnf=dnf; } || { microdnf -h > /dev/null 2>&1 && dnf=microdnf; } || { echo no dnf; false; }
. /etc/os-release; ver=${VERSION:0:1}
case $ver in
8) url=https://openresty.org/package/rhel/openresty.repo;;
9) url=https://openresty.org/package/rhel/openresty2.repo;;
esac
curl -fSs $url > /etc/yum.repos.d/openresty.repo
$dnf install -y openresty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment