Skip to content

Installation

generalmat82 edited this page May 10, 2026 · 11 revisions

This Installation guide is written assuming a new ubuntu server 24.04 instance.

1.0 - Installing OpenResty:

1.1 - Adding GPG public keys

sudo apt-get -y install --no-install-recommends wget gnupg ca-certificates lsb-release
wget -O - https://openresty.org/package/pubkey.gpg | sudo gpg --dearmor -o /usr/share/keyrings/openresty.gpg

1.2 - Add APT repository

echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/openresty.gpg] http://openresty.org/package/ubuntu $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/openresty.list > /dev/null

1.3 - Install package

sudo apt-get update
sudo apt-get -y install openresty

2.0 - Download requirements

opm get anjia0532/lua-resty-maxminddb
apt install libmaxminddb0 libmaxminddb-dev redis
opm get xiangnanscu/lua-resty-ipmatcher
opm get knyar/nginx-lua-prometheus
opm get ledgetech/lua-resty-http

3.0 - Download GeoIP databases along with auto update

follow the instructions found here: https://dev.maxmind.com/geoip/updating-databases/

wget https://github.com/maxmind/geoipupdate/releases/download/v7.1.1/geoipupdate_7.1.1_linux_amd64.deb
sudo dpkg -i geoipupdate_7.1.1_linux_amd64.deb
geoipupdate
sudo nano /etc/GeoIP.conf
geoipupdate
sudo geoipupdate
sudo crontab -e

4.0 - Clone the repo:

download the repo under /usr/local/lua

git clone https://github.com/generalmat82/openresty-Dynamic-Access-Control.git

5.0 - copy configuration

under the same directory:

rm /etc/openresty/nginx.conf
ln openresty-Dynamic-Access-Control/nginx.conf /etc/openresty/nginx.conf

6.0 - Modify secrets as wished

First you must make the example the correct name cp secrets.lua.example secrets.lua using your preferred text editor, modify the secrets.lua file. Modifying the values as wanted.

7.0 - Configure Redis

There is one specific line required for the redis configuration:

user <username> on +@read +@write #<hashed_password> +@keyspace +@connection ~*

The entry must be entered in the redis.conf of the ACL file if activated. for the password, ensure it is has via sha256 and is in hex digits.