Building NGINX - linux-on-ibm-z/docs GitHub Wiki
Building NGINX
Below versions of NGINX are available in respective distributions at the time of creation of these build instructions:
- RHEL 8.10 has
1.14.1 - RHEL (9.6, 9.7) have
1.20.1 - RHEL (10.0,10.1) have
1.26.3 - SLES 15 SP7 has
1.21.5 - SLES 16 has
1.27.2 - Ubuntu 22.04 has
1.18.0 - Ubuntu 24.04 has
1.24.0 - Ubuntu 25.10 has
1.28.0
The instructions provided below specify the steps to build NGINX version 1.30.3 on Linux on IBM Z for the following distributions:
- RHEL (8.10, 9.6, 9.7, 10.0, 10.1)
- SLES (15 SP7, 16.0)
- Ubuntu (22.04, 24.04, 25.10)
General Notes:
- When following the steps below please use a standard permission user unless otherwise specified.
- A directory
/<source_root>/will be referred to in these instructions, this is a temporary writable directory anywhere you'd like to place it.
1. Build and Install NGINX
1.1. Build using script
Use the following commands to build nginx using the build script. Please make sure you have wget installed.
wget -q https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/NGINX/1.30.3/build_nginx.sh
# Build nginx
bash build_nginx.sh
If the build completes successfully, go to STEP 2. In case of error, check logs for more details or go to STEP 1.2 to follow manual build steps.
1.2. Install dependencies
export SOURCE_ROOT=/<source_root>/
export PATCH_URL="https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/NGINX/1.30.3/patch"
-
RHEL (8.10, 9.6, 9.7)
sudo yum install -y git pcre-devel wget tar xz gcc make zlib-devel diffutils -
RHEL (10.0,10.1)
sudo yum install -y git patch curl pcre2-devel wget tar xz gcc make zlib-devel diffutils -
SLES (15 SP7, 16.0)
sudo zypper install -y git pcre-devel curl wget tar xz gcc make zlib-devel diffutils gzip -
Ubuntu (22.04, 24.04, 25.10)
sudo apt-get update sudo apt-get install -y git curl wget tar gcc make libpcre3-dev openssl libssl-dev zlib1g zlib1g-dev
1.3. Download and unpack the NGINX 1.30.3 source package
cd $SOURCE_ROOT
wget http://nginx.org/download/nginx-1.30.3.tar.gz
tar xvf nginx-1.30.3.tar.gz
cd nginx-1.30.3
1.4. Build and Install NGINX
- Build NGINX
#For RHEL 10.x only curl -fsSL "${PATCH_URL}/nginx.patch" | git apply - ./configure make sudo make install
2. Execute Test Suite
2.1. Install dependencies
-
RHEL 8.10
sudo yum install -y libedit-devel gd-devel pcre2-devel perl perl-devel openssl-devel libxml2-devel libxslt-devel perl-Cache-Memcached perl-CryptX perl-GD perl-IO-Socket-SSL perl-Test-Harness perl-HTTP-Request-AsCGI perl-FCGI uwsgi uwsgi-plugin-python3 -
RHEL (9.6, 9.7, 10.0, 10.1)
sudo yum install -y libedit-devel gd-devel pcre2-devel perl perl-devel openssl-devel libxml2-devel libxslt-devel perl-Cache-Memcached perl-CryptX perl-GD perl-IO-Socket-SSL perl-Test-Harness perl-HTTP-Request-AsCGI perl-FCGI uwsgi uwsgi-plugin-python3 ffmpeg-free -
SLES 15 SP7
sudo zypper install -y libedit-devel gd-devel libGeoIP-devel pcre2-devel libopenssl-devel libxml2-devel libxslt-devel ffmpeg perl-Cache-Memcached perl-CryptX perl-GD perl-IO-Socket-SSL perl-Test-Harness perl-Protocol-WebSocket perl-HTTP-Request-AsCGI perl-FastCGI uwsgi uwsgi-python3 -
SLES 16.0
sudo zypper install -y libedit-devel gd-devel libmaxminddb-devel pcre2-devel libopenssl-devel libxml2-devel libxslt-devel ffmpeg-7 perl-Cache-Memcached perl-CryptX perl-GD perl-IO-Socket-SSL perl perl-Protocol-WebSocket perl-FCGI uwsgi python313-uwsgi-python3 #Install perl-HTTP-Request-AsCGI manually using below commands. curl -LO "https://download.opensuse.org/tumbleweed/repo/oss/noarch/perl-HTTP-Request-AsCGI-1.200.0-1.3.noarch.rpm" sudo zypper install ./perl-HTTP-Request-AsCGI-1.200.0-1.3.noarch.rpm perl -MHTTP::Request::AsCGI -e 'print "Module loaded successfully on Perl $^V\n"' rm -rf perl-HTTP-Request-AsCGI-1.200.0-1.3.noarch.rpm -
Ubuntu (22.04, 24.04, 25.10)
sudo apt-get update sudo apt-get install -y libedit-dev libgd-dev libgeoip-dev libpcre2-dev libperl-dev libssl-dev libxml2-dev libxslt1-dev zlib1g-dev ffmpeg libcache-memcached-perl libcryptx-perl libgd-perl libio-socket-ssl-perl libtest-harness-perl libprotocol-websocket-perl libhttp-request-ascgi-perl uwsgi uwsgi-plugin-python3 libscgi-perl
2.2. Run the complete testsuite
cd $SOURCE_ROOT
git clone https://github.com/nginx/nginx-tests.git
cd nginx-tests
TEST_NGINX_BINARY=$SOURCE_ROOT/nginx-1.30.3/objs/nginx prove .
All tests should pass.