-
Notifications
You must be signed in to change notification settings - Fork 56
Building OpenResty
The instructions provided below specify the steps to build OpenResty 1.17.8.1 on Linux on IBM Z for the following distributions:
- RHEL (7.6, 7.7, 7.8, 8.1, 8.2)
- SLES (12 SP5, 15 SP1, 15 SP2)
- Ubuntu (18.04, 20.04)
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.
If you want to build OpenResty using manual steps, go to Step 2.
Use the following commands to build OpenResty using the build script. Please make sure you have wget installed.
wget -q https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/OpenResty/1.17.8.1/build_openresty.sh
# Build OpenResty
bash build_openresty.sh [Provide -t option for executing build with tests]If the build completes successfully, go to STEP 8. In case of error, check logs for more details or go to STEP 2 to follow manual build steps.
export SOURCE_ROOT=/<source_root>/-
RHEL (7.6, 7.7, 8.1, 8.2)
sudo yum install -y curl tar wget make gcc gcc-c++ unix2dos cpan perl postgresql-devel patch pcre-devel readline-devel openssl openssl-devel glibc-common
-
RHEL (7.8)
sudo yum downgrade -y glibc glibc-common sudo yum downgrade -y krb5-libs sudo yum downgrade -y libss e2fsprogs-libs e2fsprogs libcom_err sudo yum downgrade -y libselinux-utils libselinux-python libselinux sudo yum install -y curl tar wget make gcc gcc-c++ unix2dos cpan perl postgresql-devel patch pcre-devel readline-devel openssl openssl-devel
-
SLES 12 SP5
sudo zypper install -y curl tar wget make gcc gcc-c++ dos2unix perl postgresql10-devel patch pcre-devel readline-devel openssl libopenssl-devel aaa_base
-
SLES (15 SP1, 15 SP2)
sudo zypper install -y curl tar wget make gcc gcc-c++ dos2unix python3-lxml python3-curses perl postgresql10-devel patch pcre-devel readline-devel openssl openssl-devel aaa_base gzip glibc-i18ndata glibc-locale sudo localedef -i en_US -f UTF-8 en_US.UTF-8
-
Ubuntu (18.04, 20.04)
sudo apt-get update sudo apt-get install -y curl tar wget make gcc dos2unix libreadline-dev patch libpcre3-dev libpcre3 libcurl4-openssl-dev libncursesada*-dev postgresql libpq-dev openssl libssl-dev perl zlib1g zlib1g-dev sudo ln -s make /usr/bin/gmake -
Install Openssl ( Ubuntu 20.04 only )
cd $SOURCE_ROOT wget https://www.openssl.org/source/old/1.1.1/openssl-1.1.1d.tar.gz tar xvf openssl-1.1.1d.tar.gz cd openssl-1.1.1d ./config --prefix=/usr/local --openssldir=/usr/local make sudo make install sudo ldconfig /usr/local/lib64 echo ca-certificate=/etc/ssl/certs/ca-certificates.crt >> $HOME/.wgetrc export PATH=/usr/local/bin:$PATH
Note: Set /sbin to your PATH environment variable if not already set. Example: export PATH=$PATH:/sbin
cd $SOURCE_ROOT
wget https://openresty.org/download/openresty-1.17.8.1.tar.gz
tar -xvf openresty-1.17.8.1.tar.gz-
Change file
$SOURCE_ROOT/openresty-1.17.8.1/configureby executing the following command:sed -i '742,785s/.*/#&/;717,726s/.*/#&/' $SOURCE_ROOT/openresty-1.17.8.1/configure
Note: -msse4.2 compilation option is not supported on s390x.
cd $SOURCE_ROOT/openresty-1.17.8.1
./configure --without-http_redis2_module --with-http_iconv_module --with-http_postgres_module
make -j2
sudo make installsudo PERL_MM_USE_DEFAULT=1 cpan Cwd IO::Socket::SSL IPC::Run3 Test::Base Test::LongStringNote: For options prompted please select the default option.
mkdir $SOURCE_ROOT/openresty-1.17.8.1/t
cd $SOURCE_ROOT/openresty-1.17.8.1/t
wget https://raw.githubusercontent.com/openresty/openresty/v1.17.8.1/t/Config.pm
wget https://raw.githubusercontent.com/openresty/openresty/v1.17.8.1/t/000-sanity.t-
Apply patch to file
$SOURCE_ROOT/openresty-1.17.8.1/t/Config.pmPATCH_URL="https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/OpenResty/1.17.8.1/patch" curl -o "Config.pm.diff" $PATCH_URL/Config.pm.diff patch -l $SOURCE_ROOT/openresty-1.17.8.1/t/Config.pm Config.pm.diff
-
Disable
-msse4.2option in file$SOURCE_ROOT/openresty-1.17.8.1/t/sanity.tfor all distributionscd $SOURCE_ROOT/openresty-1.17.8.1/t sed -i "/configure line 719/d" 000-sanity.t sed -i "/configure line 764/d" 000-sanity.t sed -i "/INFO: found -msse4.2 in cc./d" 000-sanity.t sed -i "/WARNING: -msse4.2/d" 000-sanity.t sed -i "s/ XCFLAGS='-msse4.2'//g" 000-sanity.t sed -i "s/ -msse4.2//g" 000-sanity.t sed -i "s/-msse4.2 -DLUAJIT_ENABLE_LUA52COMPAT/-DLUAJIT_ENABLE_LUA52COMPAT/g" 000-sanity.t
export PERL5LIB=$SOURCE_ROOT/openresty-1.17.8.1 # For SLES 15.x, RHEL 8.x and Ubuntu only
cd $SOURCE_ROOT/openresty-1.17.8.1
prove -r texport PATH=/usr/local/openresty/bin:$PATH
resty -VThe information provided in this article is accurate at the time of writing, but on-going development in the open-source projects involved may make the information incorrect or obsolete. Please open issue or contact us on IBM Z Community if you have any questions or feedback.