Skip to content

Installation

generalmat82 edited this page May 5, 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

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

using your preferred text editor, modify the secrets.lua file. Modifying the values as wanted.

Clone this wiki locally