Giter Club home page Giter Club logo

openresty-packaging's Introduction

Name

openresty-packaging - Official OpenResty packaging source and scripts for various Linux distributions.

Table of Contents

Description

This code repository holds the source for building the official OpenResty pre-built packages published below:

https://openresty.org/en/linux-packages.html

https://openresty.org/en/rpm-packages.html

https://openresty.org/en/deb-packages.html

If you just want to use these pre-built (binary) packages and the corresponding package repositories, then simply follow the instructions in these pages instead.

Otherwise, if you want to hack on or customize these packages yourself, for example, please read on.

Supported Systems

Fedora

For Fedora 22+:

# create the makerpm account for building rpms only:
sudo useradd makerpm
sudo usermod -a -G mock makerpm
sudo passwd makerpm

# install rpm build tools:
sudo dnf install @development-tools fedora-packager rpmdevtools

# install openresty's build requirements:
sudo dnf install openssl-devel zlib-devel pcre-devel gcc make perl perl-Data-Dumper

# login as makerpm:
sudo su - makerpm

cd ~
rpmdev-setuptree

cp /path/to/openresty-packaging/rpm/SOURCES/* ~/rpmbuild/SOURCES/

cd ~/rpmbuild/SPECS
cp /path/to/openresty-packaging/rpm/SPECS/*.spec ./

for file in *.spec; do
    spectool -g -R $file
    rpmbuild -ba $file
done

If success, binary rpm files are under ~/rpmbuild/RPMS/ while source rpm files are under ~/rpmbuld/SRPMS/.

See the How to create an RPM package wiki page for more details.

Back to TOC

CentOS/RHEL

For CentOS/RHEL 6+:

# create the makerpm account for building rpms only:
sudo useradd makerpm
sudo groupadd mock
sudo usermod -a -G mock makerpm
sudo passwd makerpm

# install rpm build tools:
sudo yum install rpm-build redhat-rpm-config rpmdevtools

# install openresty's build requirements:
sudo yum install openssl-devel zlib-devel pcre-devel gcc make perl \
    perl-Data-Dumper libtool ElectricFence systemtap-sdt-devel valgrind-devel

# login as makerpm:
sudo su - makerpm

mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
echo '%_topdir %(echo $HOME)/rpmbuild' > ~/.rpmmacros

cp /path/to/openresty-packaging/rpm/SOURCES/* ~/rpmbuild/SOURCES/

cd ~/rpmbuild/SPECS
cp /path/to/openresty-packaging/rpm/SPECS/*.spec ./

for file in *.spec; do
    spectool -g -R $file
    rpmbuild -ba $file
done

See this wiki page for more details.

Back to TOC

Amazon Linux

Similar to Fedora. Just make sure you have installed the following package to genreate those *-debuginfo packages automatically:

sudo yum install redhat-rpm-config

Back to TOC

Ubuntu/Debian

For Ubuntu 14.04+ and Debian 7.x+:

sudo apt-get install libtemplate-perl dh-systemd systemtap-sdt-dev perl gnupg curl make build-essential dh-make bzr-builddeb

cd /path/to/openresty-packaging/deb/
make zlib-build
make pcre-build
make openssl-build
make openssl-debug-build
make openresty-build
make openresty-debug-build
make openresty-valgrind-build
make lemplate-build
make test-nginx-build

Or to build everything from scratch, just run

make build

On Debian 7.x wheezy, you'll also need to enable the wheezy-backports apt source.

To generate degian source packages for uploading to Launchpad PPA servers, one can add the OPTS=-S argument, as in

make zlib-build OPTS=-S
make pcre-build OPTS=-S

It is also possible to generate debian source packages for any other Ubuntu or Debian codenames. For example:

make zlib-build DISTRO=trusty
make zlib-build OPTS=-S DISTRO=trusty

Back to TOC

Alpine

sudo apk add alpine-sdk

mkdir -p ~/.abuild
echo "JOBS="`nproc` >> ~/.abuild/abuild.conf

cd /path/to/openresty-packaging/alpine/

cd openresty-zlib
abuild -r
cd ..

cd openresty-pcre
abuild -r
cd ..

cd openresty-openssl
abuild -r
cd ..

cd openresty
abuild -r
cd ..

cd lemplate
abuild -r
cd ..

# and etc...

Author

Yichun Zhang (agentzh) <[email protected]>

Back to TOC

Copyright and License

This module is licensed under the BSD license.

Copyright (C) 2016-2017 by Yichun "agentzh" Zhang (章亦春) <[email protected]>, OpenResty Inc.

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Back to TOC

See Also

Back to TOC

openresty-packaging's People

Contributors

agentzh avatar catatsuy avatar chrko avatar detailyang avatar doujiang24 avatar happyaron avatar jleproust avatar leslie-tsang avatar luto avatar membphis avatar nielsek avatar rainingmaster avatar rongfengliang avatar satchamo avatar xiaocang avatar zhuizhuhaomeng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openresty-packaging's Issues

libpcre.so.1: cannot open shared object file: No such file or directory

When I tried to install OpenResty from package manager, I got error: libpcre.so.1: cannot open shared object file: No such file or directory.

My Linux distribution: Ubuntu 18.04

Here is the ldd output of the installed openresty binary:

$ ldd $(which openresty)
        linux-vdso.so.1 (0x00007ffcc87c1000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f2353442000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f2353223000)
        libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007f2352feb000)
        libluajit-5.1.so.2 => /usr/local/openresty/luajit/lib/libluajit-5.1.so.2 (0x00007f2352d6b000)
        libpcre.so.1 => not found
        libssl.so.1.1 => /usr/local/openresty/openssl111/lib/libssl.so.1.1 (0x00007f2352adc000)
        libcrypto.so.1.1 => /usr/local/openresty/openssl111/lib/libcrypto.so.1.1 (0x00007f235261a000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f23523fd000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f235200c000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f2353a48000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f2351c6e000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f2351a56000)

Here is the output of my compiled Nginx binary:

ldd objs/nginx
        linux-vdso.so.1 (0x00007fff8f5ea000)
        libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007ff2b3568000)
        libluajit-5.1.so.2 => /usr/local/openresty/luajit/lib/libluajit-5.1.so.2 (0x00007ff2b32e8000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007ff2b2f4a000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ff2b2d46000)
        libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007ff2b28be000) # version mismatch!
        libssl.so.1.0.0 => /usr/lib/x86_64-linux-gnu/libssl.so.1.0.0 (0x00007ff2b2656000)
        libcrypto.so.1.0.0 => /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007ff2b2213000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007ff2b1ff6000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007ff2b1dd7000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007ff2b1bcf000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007ff2b19b7000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff2b15c6000)
        /lib64/ld-linux-x86-64.so.2 (0x00007ff2b37a0000)

Is there something I missed?

Debian/Ubuntu source package

deb-src http://openresty.org/package/ubuntu bionic main

will be an error

W: Skipping acquire of configured file 'main/source/Sources' as repository 'http://openresty.org/package/ubuntu bionic InRelease' does not seem to provide it (sources.list entry misspelt?)

Please update OpenSSL to 1.1.1n due to CVE-2022-0778

https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-0778

The BN_mod_sqrt() function, which computes a modular square root, contains a bug that can cause it to loop forever for non-prime moduli. Internally this function is used when parsing certificates that contain elliptic curve public keys in compressed form or explicit elliptic curve parameters with a base point encoded in compressed form. It is possible to trigger the infinite loop by crafting a certificate that has invalid explicit curve parameters. Since certificate parsing happens prior to verification of the certificate signature, any process that parses an externally supplied certificate may thus be subject to a denial of service attack.

fails to install perl-Test-Nginx on Centos 7

Steps to reproduce (using centos7 image 980e0e4c79ec from 5 weeks ago):

$ docker pull centos:centos7 
$ docker run centos:centos7 bash -c "cat <<'EOF' > /etc/yum.repos.d/OpenResty.repo
[openresty]
name=Official OpenResty Repository
baseurl=https://copr-be.cloud.fedoraproject.org/results/openresty/openresty/epel-\$releasever-\$basearch/
skip_if_unavailable=True
gpgcheck=1
gpgkey=https://copr-be.cloud.fedoraproject.org/results/openresty/openresty/pubkey.gpg
enabled=1
enabled_metadata=1
EOF
yum install -y perl-Test-Nginx"

The documentation says this is not supported on Centos 5 and 6 but it worked on 7 just fine until now.

Build of openresty from spec file fails issue with ccache

rpmbuild -ba openresty.spec fails:

make[2]: execvp: /: Permission denied
make[2]: *** [objs/Makefile:538: objs/nginx] Error 127
make[2]: Leaving directory '/root/rpmbuild/BUILD/openresty-1.19.3.2/build/nginx-1.19.3'
make[1]: *** [Makefile:8: build] Error 2
make[1]: Leaving directory '/root/rpmbuild/BUILD/openresty-1.19.3.2/build/nginx-1.19.3'
make: *** [Makefile:8: all] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.rWKKWH (%build)

This is because in the objs/Makefile the LINK variable set to "/" which causes the build to break later on when trying to include the rest of the libraries.

CC =    ccache gcc -fdiagnostics-color=always
CFLAGS = -I/root/rpmbuild/BUILD/openresty-1.19.3.2/build/luajit-root/usr/local/openresty/luajit/include/luajit-2.1 -I/root/rpmbuild/BUILD/openresty-1.19.3.2/build/luajit-root/usr/local/openresty/luajit/include/luajit-2.1  -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -g -O2 -DNGX_LUA_ABORT_AT_PANIC -I/usr/local/openresty/zlib/include -I/usr/local/openresty/pcre/include -I/usr/local/openresty/openssl111/include -DNDK_SET_VAR -DNDK_UPSTREAM_LIST -DNDK_SET_VAR -DNDK_SET_VAR -DNDK_SET_VAR -DNDK_SET_VAR  -D_GLIBCXX_USE_CXX11_ABI=0
CPP =   ccache gcc -fdiagnostics-color=always -E
LINK =  /

I am not an expert in building C packages, but the problem occurs when building using the ccache. I removed the ccache from the build configuration and it solved the problem, but this might not be the way to do it:

@@ -193,7 +193,7 @@
 %build
 ./configure \
     --prefix="%{orprefix}" \
-    --with-cc='ccache gcc -fdiagnostics-color=always' \
+    --with-cc='gcc -fdiagnostics-color=always' \

Can someone help to fix it properly?

add --with-compat by default

without this flag, building dynamic modules, targeting a specific openresty package release is a pain. One has to use -V option to figure out the build arguments used when building the official release and jsut a copy/pasted does not work since paths are not the same

Is this flag missing on purpose?

with this flag one basically needs just ./configure --with-compat --add-dynamic-module=..

feature request: include ngx_brotli

We would like to switch to the official openresty packages instead of compiling it ourselves. However, we would like to use brotli content-encoding for performance reasons. So far, I've not succeeded in building the brotli module for use with the pre-built openresty Alpine packages. Would it be possible to include mod_brotli in future releases of openresty?

https://github.com/google/ngx_brotli

alpine 3.16 package availability

Alpine 3.16 was released last month. It would be great to have compatible packages available, but I don't understand how to add that here - the process is a mystery to me!

I'm guessing there is an external build server somewhere configured for this?

RPM repository broken (Content-Length unexpected)

When setting up the OpenResty RHEL repository and trying to install OpenResty, dnf (and yum) fail to download the packages because the expected content length doesn't match the content length the server reports:

[MIRROR] openresty-1.19.9.1-1.el8.x86_64.rpm: Interrupted by header callback: Server reports Content-Length: 1161260 but expected size is: 1161264

I could reproduce this locally in a Docker container as well as on our CI system (AWS CodeBuild).
This has been working earlier today, so I think something broke during the day.

Full output for reproducing the issue:

# docker run -it --rm registry.access.redhat.com/ubi8/ubi:8.5
[root@e52901de9fd9 /]# cat /etc/redhat-release
Red Hat Enterprise Linux release 8.5 (Ootpa)
[root@e52901de9fd9 /]# curl -sSf https://openresty.org/package/rhel/openresty.repo -o /etc/yum.repos.d/openresty.repo
[root@e52901de9fd9 /]# dnf install -y openresty
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered with an entitlement server. You can use subscription-manager to register.

Official OpenResty Open Source Repository for RHEL                                                                                                         86 kB/s |  67 kB     00:00
Red Hat Universal Base Image 8 (RPMs) - BaseOS                                                                                                            357 kB/s | 796 kB     00:02
Red Hat Universal Base Image 8 (RPMs) - AppStream                                                                                                         3.7 MB/s | 2.7 MB     00:00
Red Hat Universal Base Image 8 (RPMs) - CodeReady Builder                                                                                                  33 kB/s |  16 kB     00:00
Dependencies resolved.
==========================================================================================================================================================================================
 Package                                             Architecture                          Version                                         Repository                                Size
==========================================================================================================================================================================================
Installing:
 openresty                                           x86_64                                1.19.9.1-1.el8                                  openresty                                1.1 M
Installing dependencies:
 openresty-openssl111                                x86_64                                1.1.1l-1.el8                                    openresty                                1.6 M
 openresty-pcre                                      x86_64                                8.44-1.el8                                      openresty                                169 k
 openresty-zlib                                      x86_64                                1.2.11-3.el8                                    openresty                                 59 k

Transaction Summary
==========================================================================================================================================================================================
Install  4 Packages

Total download size: 2.9 M
Installed size: 8.1 M
Downloading Packages:
[MIRROR] openresty-1.19.9.1-1.el8.x86_64.rpm: Interrupted by header callback: Server reports Content-Length: 1161260 but expected size is: 1161264
[MIRROR] openresty-openssl111-1.1.1l-1.el8.x86_64.rpm: Interrupted by header callback: Server reports Content-Length: 1654940 but expected size is: 1654948
[MIRROR] openresty-1.19.9.1-1.el8.x86_64.rpm: Interrupted by header callback: Server reports Content-Length: 1161260 but expected size is: 1161264
[MIRROR] openresty-openssl111-1.1.1l-1.el8.x86_64.rpm: Interrupted by header callback: Server reports Content-Length: 1654940 but expected size is: 1654948
[FAILED] openresty-openssl111-1.1.1l-1.el8.x86_64.rpm: No more mirrors to try - All mirrors were already tried without success
(2-3/4): openresty-1.19.9.1-1.el8.x86_64.rpm                              56% [=========================================-                               ] 703 kB/s | 1.7 MB     00:01 ETA
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.
Error: Error downloading packages:
  Cannot download openresty-openssl111-1.1.1l-1.el8.x86_64.rpm: All mirrors were tried

openresty-clean make error debian

Why install during clean? I dont wanna compile debug based packages.

sudo apt-get -y -qq install openresty-zlib-dev openresty-pcre-dev openresty-openssl111-debug-dev

Using build script then clean cause error: during compile

sudo apt-get -y -qq install openresty-zlib-dev openresty-pcre-dev openresty-openssl111-debug-dev
E: Unable to locate package openresty-openssl111-debug-dev
make: *** [Makefile:199: openresty-clean] Error 100

`make build` does not make sense

README.md says, "... to build everything from scratch, just run make build".

However, the behavior of make build does not make sense.

The main content of make build:

.PHONY: build
build: zlib-build pcre-build openssl-build \
        openssl-debug-build openresty-build openresty-debug-build \
        openresty-valgrind-build \
        lemplate-build test-nginx-build

However, in almost every sub-build, there is rm -f *.deb, which makes make build end up with only the deb package of the last build as far as outputting deb packages.

ngx_http_upstream_check_module not found

centos-7.9 gcc-4.8.5 编译安装 openresty-1.21.4.2

./configure --with-pcre-jit --with-ipv6 --prefix=$openresty_install_path -j$cpu_num --with-debug --with-http_v2_module --add-module=./bundle/nginx_upstream_check_module-master

nginx_upstream_check_module-master的存放在路径 :
openresty-1.21.4.2/bundle/nginx_upstream_check_module-master

报错如下:


2023-08-25T04:05:04.128629298Z adding module in /home/work/openresty/openresty-1.21.4.2/bundle/nginx_upstream_check_module-master

2023-08-25T04:05:04.161511089Z checking for ngx_http_upstream_check_module ... not found
2023-08-25T04:05:04.164959018Z     ./configure: error: the ngx_http_upstream_check_module addon error.



PIDFile is no more required in openresty.service

Hi,
I've ran through an issue installing openresty using pre-built packages on ubuntu bionic. During install, it starts the service and waits for it to stop which leads to a timeout. The status of the service shows this error:

openresty.service - full-fledged web platform
   Loaded: loaded (/lib/systemd/system/openresty.service; enabled; vendor preset: enabled)
   Active: failed (Result: timeout) since Wed 2020-03-25 01:05:52 UTC; 30s ago

mars 25 01:04:22 Codimeo-fra1-01 systemd[1]: Starting full-fledged web platform...
mars 25 01:04:22 Codimeo-fra1-01 systemd[1]: openresty.service: Can't open PID file /usr/local/openresty/nginx/logs/nginx.pid (yet?) after start: No su
mars 25 01:05:52 Codimeo-fra1-01 systemd[1]: openresty.service: Start operation timed out. Terminating.
mars 25 01:05:52 Codimeo-fra1-01 systemd[1]: openresty.service: Killing process 28387 (nginx) with signal SIGKILL.
mars 25 01:05:52 Codimeo-fra1-01 systemd[1]: openresty.service: Killing process 28390 (nginx) with signal SIGKILL.
mars 25 01:05:52 Codimeo-fra1-01 systemd[1]: openresty.service: Failed with result 'timeout'.
mars 25 01:05:52 Codimeo-fra1-01 systemd[1]: Failed to start full-fledged web `platform.

After many trials, the Nginx removes it's own pid file, which is /run/openresty.pid according to the default nginx.conf of openresty.
So it is not needed to mention it in the service definition file.

CentOS 7 init script looks for missing /etc/sysconfig/network

So this happened to me today:

Jan 09 19:01:52 openresty.example.com systemd[1]: Starting SYSV: OpenResty is a scalable web platform by extending...
Jan 09 19:01:52 openresty.example.com openresty[628]: /etc/rc.d/init.d/openresty: line 17: /etc/sysconfig/network: No such file or directory

File doesn't exist on CentOS 7

openresty-openssl is still not in 1.1.1n in the repos

@zhuizhuhaomeng Do you have an estimation when new packages lands in e.g. https://openresty.org/package/debian/pool/openresty/o/openresty-openssl111/ ?

Originally posted by @chrko in #76 (comment)

As @chrko mentioned, the packages for openresty-openssl have not been updated, making docker-openresty use an outdated version of OpenSSL. This in turn impacts e.g., jc21/nginx-proxy-manager. New packages based on OpenSSL 1.1.1n should be made available ASAP please.

Possible to add repository for Debian Bullseye(11)?

It seems that we can successfully install openresty and its custom depedencies (e.g. zlib, openssl) for buster(10) in bullseye(11) without apparent problem. Although Bullseye is still in testing status, but its most of its package (kernel, libc, gcc...) is frozen around 3/12. Maybe it's better to test its capability earlier, also benefits users who want to help to test. Thanks!

OpenResty Ubuntu package has no logrotate configuration

I was surprised to see that there is no logrotate configuration for the Ubuntu package. I only realised once the server ran out of space :D Here's what I ended up using:

var/log/openresty/*.log {
  daily
  missingok
  rotate 52
  compress
  delaycompress
  notifempty
  create 640 root root
  sharedscripts
  postrotate
    if [ -f /usr/local/openresty/nginx/logs/nginx.pid ]; then
      kill -USR1 `cat /usr/local/openresty/nginx/logs/nginx.pid`
    fi
  endscript
}

This is basically the same as the nginx Ubuntu 20.04 package's configuration with a tweak to the pid file location and the user and group of the log file ownership.

OR package is not actually using OR-OpenSSL package

Hi.

Beeing able to test OR-packaging scripts i've found that nginx build from openresty.spec is not actually using libs from openresty-openssl package.

[osboxes@osboxes SPECS]$ ldd /usr/local/openresty/nginx/sbin/nginx
linux-vdso.so.1 (0x00007ffe67dec000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f4d5a9fe000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f4d5a7e1000)
libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007f4d5a5ab000)
libluajit-5.1.so.2 => /usr/local/openresty/luajit/lib/libluajit-5.1.so.2 (0x00007f4d5a330000)
libm.so.6 => /lib64/libm.so.6 (0x00007f4d5a026000)
libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f4d59db3000)
libssl.so.10 => /lib64/libssl.so.10 (0x00007f4d59b41000)
libcrypto.so.10 => /lib64/libcrypto.so.10 (0x00007f4d596e0000)
libz.so.1 => /lib64/libz.so.1 (0x00007f4d594ca000)
libc.so.6 => /lib64/libc.so.6 (0x00007f4d59108000)
/lib64/ld-linux-x86-64.so.2 (0x00005563a8e26000)
libfreebl3.so => /lib64/libfreebl3.so (0x00007f4d58f04000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f4d58ced000)
libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007f4d58aa0000)
libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007f4d587b9000)
libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007f4d585b5000)
libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007f4d58384000)
libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007f4d58174000)
libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007f4d57f70000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f4d57d56000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f4d57b2e000)

Seems nginx is somehow missing the rpath dependencies. Or am i wrong?
Thanks in advance.

question about openresty.init run level

Hello.

@agentzh I'm confused why we do not set run level in openresty.init as the following:

#
# chkconfig:   - 85 15
# description: OpenResty is a scalable web platform by extending
#              NGINX with Lua

some system admins will periodic update the system and reboot the system, if we do not set run level for openresty, they think it do not meet they expectations.

So i want to get advice from your for the reason.

yum error installing openresty-zlib-1.2.12 on CentOS 7

Getting similar error to #79, which looks like it turned out to be a CDN issue:

openresty-zlib-1.2.12-1.el7.x8 FAILED                                          
https://openresty.org/package/centos/7/x86_64/openresty-zlib-1.2.12-1.el7.x86_64.rpm: [Errno -1] Package does not match intended download. Suggestion: run yum --enablerepo=openresty clean metadata
Trying other mirror.


Error downloading packages:
  openresty-zlib-1.2.12-1.el7.x86_64: [Errno 256] No more mirrors to try.

In my investigation, I found that the following curl commands downloaded different files; the latter one has the expected size and SHA256 hash, as reported in the repo metadata:

curl -v -O https://openresty.org/package/centos/7/x86_64/openresty-zlib-1.2.12-1.el7.x86_64.rpm
curl -v --compressed -O https://openresty.org/package/centos/7/x86_64/openresty-zlib-1.2.12-1.el7.x86_64.rpm

ftp.pcre.org is no longer available

I noticed that the pcre builds are relying on pulling source code from ftp.pcre.org. Yesterday when I was running an openresty build, the pcre downloads were failing.

I contacted [email protected] and this was their response:

Unfortunately, ftp.pcre.org was deprecated some time ago. There was an
announcement to the old PCRE developers list, and the website has been
updated with pointers to the new home for distributions on GitHub. I
have also added an explicit note now that the FTP site is gone.

I'm afraid you'll need to update any automated scripts that pull PCRE
releases to pull via HTTPS, Git, or Subversion from GitHub instead.

required packages for building the rpm package do not exist

hi,

Context

the dependencies in each .spec file do not work:

BuildRequires:  gcc, make, perl, systemtap-sdt-devel
BuildRequires:  openresty-zlib-devel >= 1.2.8
BuildRequires:  openresty-openssl-debug-devel >= 1.0.2h-6
BuildRequires:  openresty-pcre-devel >= 8.39
Requires:       openresty-zlib >= 1.2.8
Requires:       openresty-openssl-debug >= 1.0.2h-6
Requires:       openresty-pcre >= 8.39

Expected Behavior

to install these packages without any error

Actual Behavior

error: Failed build dependencies: openresty-zlib-devel >= 1.2.8 is needed by openresty-debug-1.11.2.1-3.el7.centos.x86_64 openresty-openssl-debug-devel >= 1.0.2h-6 is needed by openresty-debug-1.11.2.1-3.el7.centos.x86_64 openresty-pcre-devel >= 8.39 is needed by openresty-debug-1.11.2.1-3.el7.centos.x86_64

Possible Fix

do you mean:

BuildRequires:  gcc, make, perl, systemtap-sdt-devel
BuildRequires:  zlib-devel >= 1.2.8
BuildRequires:  openssl-debug-devel >= 1.0.2h-6
BuildRequires:  pcre-devel >= 8.39
Requires:       zlib >= 1.2.8
Requires:       openssl-debug >= 1.0.2h-6
Requires:       pcre >= 8.39

Steps to Reproduce

following default installation instructions on README.

Context

trying to generate a rpm package for my centos environment

My Environment

  • Operating System and version: CentOS Linux 7 (Core)

Disable init for RPM build

Since the bundled init script is just for demonstration and testing purposes ( Issue 18 ) can we skip chkconfig registration ?The current configuration register openresty and start openresty on boot.

Separate binaries built without -msse4.2 flag for legacy AMD CPUs

The end of the log after make build run:

dpkg-buildpackage: binary and diff upload (original source NOT included)
Now running lintian...
E: openresty-zlib source: source-contains-prebuilt-ms-help-file contrib/dotzlib/DotZLib.chm
W: openresty-zlib source: newer-standards-version 3.9.8 (current is 3.9.7)
E: openresty-zlib-dev: description-synopsis-is-duplicated
E: openresty-zlib-dev: dir-in-usr-local usr/local/openresty/
E: openresty-zlib-dev: dir-in-usr-local usr/local/openresty/zlib/
E: openresty-zlib-dev: dir-in-usr-local usr/local/openresty/zlib/include/
E: openresty-zlib-dev: file-in-usr-local usr/local/openresty/zlib/include/zconf.h
W: openresty-zlib-dev: file-in-unusual-dir usr/local/openresty/zlib/include/zconf.h
E: openresty-zlib-dev: file-in-usr-local usr/local/openresty/zlib/include/zlib.h
W: openresty-zlib-dev: file-in-unusual-dir usr/local/openresty/zlib/include/zlib.h
E: openresty-zlib-dev: dir-in-usr-local usr/local/openresty/zlib/lib/
E: openresty-zlib-dev: file-in-usr-local usr/local/openresty/zlib/lib/libz.a
W: openresty-zlib-dev: file-in-unusual-dir usr/local/openresty/zlib/lib/libz.a
E: openresty-zlib-dbgsym: description-synopsis-is-duplicated
E: openresty-zlib: embedded-library usr/local/openresty/zlib/lib/libz.so.1.2.11: zlib
W: openresty-zlib: description-synopsis-starts-with-article
E: openresty-zlib: description-synopsis-is-duplicated
E: openresty-zlib: dir-in-usr-local usr/local/openresty/
E: openresty-zlib: dir-in-usr-local usr/local/openresty/zlib/
E: openresty-zlib: dir-in-usr-local usr/local/openresty/zlib/lib/
E: openresty-zlib: file-in-usr-local usr/local/openresty/zlib/lib/libz.so
W: openresty-zlib: file-in-unusual-dir usr/local/openresty/zlib/lib/libz.so
E: openresty-zlib: file-in-usr-local usr/local/openresty/zlib/lib/libz.so.1
W: openresty-zlib: file-in-unusual-dir usr/local/openresty/zlib/lib/libz.so.1
E: openresty-zlib: file-in-usr-local usr/local/openresty/zlib/lib/libz.so.1.2.11
W: openresty-zlib: file-in-unusual-dir usr/local/openresty/zlib/lib/libz.so.1.2.11
W: openresty-zlib: postinst-has-useless-call-to-ldconfig
Finished running lintian.
Now signing changes and any dsc files...
 signfile openresty-zlib_1.2.11-3~xenial1.dsc OpenResty Admin <[email protected]>
gpg: skipped "OpenResty Admin <[email protected]>": secret key not available
gpg: /tmp/debsign.9ATtJBLK/openresty-zlib_1.2.11-3~xenial1.dsc: clearsign failed: secret key not available
debsign: gpg error occurred!  Aborting....
debuild: fatal error at line 1295:
running debsign failed
Makefile:40: recipe for target 'zlib-build' failed
make: *** [zlib-build] Error 29

`Ubuntu 16.04 x64, CPU with no SSE 4.2 support

Add http_geoip_module support

Hi,

I'm using the RHEL 6 package to install OpenResty on EC2 instances running Amazon Linux, but I figured out that http_geoip_module is not included in the package.

There's any chance to add this as a default module, or maybe as a separate package?

Thanks!

openresty-zlib undefined symbol luaopen_libz

Thanks for making the debian packages available, much easier than having to maintain my own!

I'm testing on ubuntu 18.04 and everything is working for me except the packaged zlib from openresty-zlib. Trying to use it results in the error:

/usr/local/openresty/zlib/lib/libz.so.1: undefined symbol: luaopen_zlib
stack traceback:
coroutine 0:
	[C]: in function 'require'
	content_by_lua(test:56):2: in function <content_by_lua(test:56):1>

Not sure if I'm missing something or if there is a problem with the package itself.

Installed packages:

openresty-openssl 1.1.0h-2~bionic1   amd64
openresty-opm     1.13.6.2-1~bionic1 amd64
openresty-pcre    8.42-1~bionic1     amd64
openresty-resty   1.13.6.2-1~bionic1 all
openresty-zlib    1.2.11-3~bionic1   amd64

Test nginx configuration:

lua_package_cpath ';;/usr/local/openresty/zlib/lib/libz.so;';
server {
...
    location = /lua-zlib {
        default_type 'text/plain';
        content_by_lua_block {
            local zlib = require "libz"
            local inflate = zlib.inflate()
            content = inflate('\x1f\x8b\x08\x00Z\xfe\xbb[\x00\x03\x0b\xc9\xc8,V(.)\xca\xccKW\xc8H,VHJM\xcdSHIM\xce\xcf-(J-.NM\xd1\xe3\x02\x00\xe4[\xa2S#\x00\x00\x00')
            ngx.say(content)
        }
    }
}

A successful test should output the string "This string has been decompressed.".

I did note that the official ubuntu lua-zlib package (which I was using previously) uses the name zlib.so, rather than libz.so. I'm not sure if I should be using require "zlib" or require "libz", but they both cause the exact same error regardless.

Finally, I also understand the lua_package_cpath addition is required for the openresty-zlib module to even be found, which might be helpful to note on the deb-packages page in the openresty-zlib section. Initially I expected the module to "just work" once installed with the package, but understand why that might be difficult to achieve and that the manual path adjustment is therefore required.

Appreciate any assistance.

Possible to add nginx-rtmp-module ?

So I would like to be able to use the nginx-rtmp-module with the openresty packages in ubuntu. Hoping to have a situation similar to what libnginx-mod-rtmp package provides with default nginx.

Tls 1.2 and 1.1 not provided

Using mozilla to generate intermediate and legacy mode but seems openresty just serve tls1.3 not before

https://ssl-config.mozilla.org/

nginx version: openresty/1.17.8.2
built with OpenSSL 1.1.1g  21 Apr 2020
TLS SNI support enabled
configure arguments: --prefix=/usr/local/openresty/nginx --with-cc-opt='-O2 -DNGX_LUA_ABORT_AT_PANIC -I/usr/local/openresty/zlib/include -I/usr/local/openresty/pcre/include -I/usr/local/openresty/openssl111/include' --add-module=../ngx_devel_kit-0.3.1 --add-module=../echo-nginx-module-0.62 --add-module=../xss-nginx-module-0.06 --add-module=../ngx_coolkit-0.2 --add-module=../set-misc-nginx-module-0.32 --add-module=../form-input-nginx-module-0.12 --add-module=../encrypted-session-nginx-module-0.08 --add-module=../srcache-nginx-module-0.32 --add-module=../ngx_lua-0.10.17 --add-module=../ngx_lua_upstream-0.07 --add-module=../headers-more-nginx-module-0.33 --add-module=../array-var-nginx-module-0.05 --add-module=../memc-nginx-module-0.19 --add-module=../redis2-nginx-module-0.15 --add-module=../redis-nginx-module-0.3.7 --add-module=../ngx_stream_lua-0.0.8 --with-ld-opt='-Wl,-rpath,/usr/local/openresty/luajit/lib -L/usr/local/openresty/zlib/lib -L/usr/local/openresty/pcre/lib -L/usr/local/openresty/openssl111/lib -Wl,-rpath,/usr/local/openresty/zlib/lib:/usr/local/openresty/pcre/lib:/usr/local/openresty/openssl111/lib -Wl,-rpath,' --with-pcre-jit --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module --with-http_v2_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --with-http_stub_status_module --with-http_realip_module --with-http_addition_module --with-http_auth_request_module --with-http_secure_link_module --with-http_random_index_module --with-http_gzip_static_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-threads --add-module=/tmp/nginx-module-sts --add-module=/tmp/nginx-module-stream-sts --add-module=/tmp/nginx-module-vts --add-module=/tmp/ngx_brotli --add-module=/tmp/naxsi-0.56/naxsi_src --add-module=/tmp/incubator-pagespeed-ngx-1.13.35.2-stable --add-module=/tmp/ngx_http_geoip2_module-3.3 --with-stream --with-stream_ssl_preread_module --with-http_ssl_module

Many x86_64 packages for 1.21.4.2 are missing

GPG key problem with CentOS repos

gpg check for CentOS 7 repo fails:

https://openresty.org/package/centos/7/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml signature could not be verified for openresty
Trying other mirror.


 One of the configured repositories failed (Official OpenResty Open Source Repository for CentOS),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Run the command with the repository temporarily disabled
            yum --disablerepo=openresty ...

     4. Disable the repository permanently, so yum won't use it by default. Yum
        will then just ignore the repository until you permanently enable it
        again or use --enablerepo for temporary usage:

            yum-config-manager --disable openresty
        or
            subscription-manager repos --disable=openresty

     5. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=openresty.skip_if_unavailable=true

failure: repodata/repomd.xml from openresty: [Errno 256] No more mirrors to try.
https://openresty.org/package/centos/7/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml signature could not be verified for openresty

Others are running into the isuse as well; see https://forum.openresty.us/d/6847-openresty-gpg-key-stopped-verifying-the-openresty-repository

This is probably related to the changes made on Nov 4.

From https://openresty.org/package/centos/7/x86_64/repodata/

Index of /package/centos/7/x86_64/repodata/
[../](https://openresty.org/package/centos/7/x86_64/)
[0a30b5c81f4b71a7f7ddf66778506c3e9c8a5cba14969fb..>](https://openresty.org/package/centos/7/x86_64/repodata/0a30b5c81f4b71a7f7ddf66778506c3e9c8a5cba14969fbfee9f8f9da9df8207-other.xml.gz) 04-Nov-2022 22:30               14806
[2ede3ad09a5ceaf85eb6b6ae548ddf2a0f058e803a6d651..>](https://openresty.org/package/centos/7/x86_64/repodata/2ede3ad09a5ceaf85eb6b6ae548ddf2a0f058e803a6d6510c9bbe08227343fb5-filelists.xml.gz) 04-Nov-2022 22:30               42384
[35b8c3c1f206eca4c4cf659a184c20de19ddcb4c8d66af4..>](https://openresty.org/package/centos/7/x86_64/repodata/35b8c3c1f206eca4c4cf659a184c20de19ddcb4c8d66af46cac90e803335a6e3-primary.xml.gz) 04-Nov-2022 22:30               28522
[d2dde2025daa540a63ff209f4ec559b8839f5c5fa5cd4f4..>](https://openresty.org/package/centos/7/x86_64/repodata/d2dde2025daa540a63ff209f4ec559b8839f5c5fa5cd4f42f64db5089ba307b8-filelists.sqlite.bz2) 04-Nov-2022 22:30               84561
[dee3d7f5f1164c68b2dd2d4685f082e6013d2b7fd65be34..>](https://openresty.org/package/centos/7/x86_64/repodata/dee3d7f5f1164c68b2dd2d4685f082e6013d2b7fd65be347f4e6aa25c1742500-primary.sqlite.bz2) 04-Nov-2022 22:30               57380
[eec00fc288fd09a14a012da367420e0579115fceec4f970..>](https://openresty.org/package/centos/7/x86_64/repodata/eec00fc288fd09a14a012da367420e0579115fceec4f970351d13416bf89d07f-other.sqlite.bz2) 04-Nov-2022 22:30               34291
[repomd.xml](https://openresty.org/package/centos/7/x86_64/repodata/repomd.xml)                                         04-Nov-2022 22:30                2987
[repomd.xml.asc](https://openresty.org/package/centos/7/x86_64/repodata/repomd.xml.asc)                                     17-May-2022 19:46                 490

Similar dates are on the CentOS 8 repo so it probably has the same problem.
Maybe the signing key needs to be updated or the repomd.xml was signed with an incorrect key.

openresty-openssl 1.1.1n is still not published in the Alpine (and arm64) repos

I (and also @neomantra) commented in #78 (comment) - but unfortunately only after it was closed, so it may not have crossed the correct people's radars.

I can see the code has been pushed for the Alpine and arm64 repos, but the packages are still not available to download, and I really don't want to have to go down building and installing them myself if I can avoid it! Is there anything we can do to expedite their CI/publishing?

Failed to install openresty yum package

Get this error:

Downloading packages:
https://openresty.org/package/centos/7/x86_64/openresty-debug-1.19.9.1-1.el7.x86_64.rpm: [Errno -1] Package does not match intended download. Suggestion: run yum --enablerepo=openresty clean metadata
Trying other mirror.

run yum --enablerepo=openresty clean metadata doesn't solve the problem.

RPM package prerequisites

Hi.
I tried to build rpm packages on CentOS 7 Minimal. These packages should be installed through command yum. I hope it will be helpful.

    perl-ExtUtils-MakeMaker
    perl-Template-Toolkit
    perl-Test-Base
    perl-Test-LongString
    perl-List-MoreUtils
    perl-IPC-Run3
    GeoIP-devel

Mark deb packages with security fixes as security updates

Hi,

I've noticed you've just released Openresty 1.11.2.4 in order to include the latest security fixes from upstream nginx version.

We only update our Ubuntu systems (automatically) with security fixes, but this new version isn't detected as a security release. In order to detect which security fixes do we have to apply, we use apt-show-versions command:

$ apt-show-versions | grep openresty

openresty:amd64/xenial 1.11.2.3-4~xenial1 upgradeable to 1.11.2.4-1~xenial1
openresty-openssl:amd64/xenial 1.0.2k-2~xenial1 uptodate
openresty-opm:amd64/xenial 1.11.2.3-4~xenial1 upgradeable to 1.11.2.4-1~xenial1
openresty-pcre:amd64/xenial 8.40-1~xenial1 uptodate
openresty-resty:all/xenial 1.11.2.3-4~xenial1 upgradeable to 1.11.2.4-1~xenial1
openresty-zlib:amd64/xenial 1.2.11-2~xenial1 uptodate

As you can see, all openresty packages are from "all/xenial" target. Instead of this, if these packages were marked as xenial-security they would be covered by the following command:

$ apt-show-versions | grep openresty | grep upgradeable | grep $(lsb_release -cs)-security

<no output>

Could you mark them as xenial-security instead of xenial when the new version is released because of a security fix?

Thanks

openresty deb package conffile is not being applied properly

Hi,

the content of the current /deb/openresty/debian/conffile is the following:

/etc/*
/usr/local/openresty/nginx/conf/*

It should protect files inside those folders from being removed after package uninstallation and protect them from being overwritten after package upgrade.

This is not happening right now. Test after installing and removing openresty:

# apt-get install openresty
....
Setting up openresty (1.11.2.5-1~xenial1) ...
Setting up openresty-resty (1.11.2.5-1~xenial1) ...
Setting up openresty-opm (1.11.2.5-1~xenial1) ...
Processing triggers for libc-bin (2.23-0ubuntu9) ...
# 
# file /usr/local/openresty/nginx/conf/nginx.conf
/usr/local/openresty/nginx/conf/nginx.conf: ASCII text
# apt-get remove -y openresty
Reading package lists... Done
Building dependency tree
Reading state information... Done
...
Removing openresty-opm (1.11.2.5-1~xenial1) ...
Removing openresty-resty (1.11.2.5-1~xenial1) ...
Removing openresty (1.11.2.5-1~xenial1) ...
Processing triggers for libc-bin (2.23-0ubuntu9) ...
# 
# file /usr/local/openresty/nginx/conf/nginx.conf
/usr/local/openresty/nginx/conf/nginx.conf: cannot open `/usr/local/openresty/nginx/conf/nginx.conf' (No such file or directory)

This is specially dangerous when upgrading openresty as the main nginx.conf is overwritten without any confirmation and the current main webserver config is lost.

After unpacking and inspecting the .deb file, this is the content:

# cat ./DEBIAN/conffiles
/etc/init.d/openresty

The /usr/local/openresty/nginx/conf/nginx.conf path is missing from this file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.