aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2024-10-10 21:44:33 +0200
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2024-10-12 11:34:49 +0700
commita90f5d0792995b6ce32649beb6c1bd9131959680 (patch)
treefb97b2a47af109bb78be3928ca03805f5fc96642
parent32bf341223722139ada4deae8eadbbffb4282948 (diff)
network/nginx: Update documentation on dynamic modules
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r--network/nginx/README13
-rw-r--r--network/nginx/nginx.SlackBuild23
-rw-r--r--network/nginx/nginx.logrotate2
3 files changed, 17 insertions, 21 deletions
diff --git a/network/nginx/README b/network/nginx/README
index b8437d7888..f1e52423f8 100644
--- a/network/nginx/README
+++ b/network/nginx/README
@@ -4,7 +4,7 @@ as well as an IMAP/POP3 proxy server.
By default, nginx will use the "nobody" user and group accounts. You may
specify alternate values on the command line if desired; for example:
- NGINXUSER=backup NGINXGROUP=backup ./nginx.SlackBuild
+ NGINXUSER=apache NGINXGROUP=apache ./nginx.SlackBuild
Regardless of which user and group you decide to use, you will need to
make sure they exist on both the build system and the target system.
@@ -28,8 +28,11 @@ http://wiki.nginx.org/3rdPartyModules.
ADDMODULE="/tmp/passenger-release-5.0.13/ext/nginx" ./nginx.SlackBuild
-Using the optional dynamic loadable module support in nginx >=
-1.10.0. Understand that dynamic modules are a new feature in nginx and
-issues may arise until further testing is done.
+The optional dynamic loadable module support can be activated by setting
+NGINX_DYNAMIC. The built modules are disabled by default, uncomment the
+needed modules in /etc/nginx/modules.conf. Understand that the module
+order in the configuration file is significant, so you may need to
+reorder some lines, otherwise you'll get an error about undefined
+symbols.
- DYNAMIC=yes ./nginx.SlackBuild
+ NGINX_DYNAMIC=yes ./nginx.SlackBuild
diff --git a/network/nginx/nginx.SlackBuild b/network/nginx/nginx.SlackBuild
index c215103f0b..a5bc3c6deb 100644
--- a/network/nginx/nginx.SlackBuild
+++ b/network/nginx/nginx.SlackBuild
@@ -32,7 +32,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=nginx
VERSION=${VERSION:-1.26.2}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -85,19 +85,15 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
-# Remove -Werror from CFLAGS.
-# https://trac.nginx.org/nginx/ticket/1259
-sed -i '/-Werror/d' auto/cc/gcc
-
# Fix the nginx.conf file for html and virtual server directory.
sed -i \
-e '/root[ ]*html/s|html;|/var/www/&|' \
-e '$s|.*| include /etc/nginx/conf.d/\*.conf;\n&|' conf/$PRGNAM.conf
# Add if dynamic modules are used.
-if [ "${DYNAMIC:-no}" == "yes" ]; then
+if [ "${NGINX_DYNAMIC:-no}" == "yes" ]; then
DYNAMIC_MODULE=${DYNAMIC_MODULE:-=dynamic}
- sed -i 's|^events.*|include /etc/nginx/modules/\*.conf;\n\n&|' conf/$PRGNAM.conf
+ sed -i 's|^events.*|include /etc/nginx/modules.conf;\n\n&|' conf/$PRGNAM.conf
else
DYNAMIC_MODULE=""
fi
@@ -112,7 +108,7 @@ fi
# Add extra modules not included in nginx.
ADDMODULE=${ADDMODULE:-}
-if [ "$DYNAMIC" == "yes" ]; then
+if [ "$NGINX_DYNAMIC" == "yes" ]; then
ADD_MODULE="--add-dynamic-module=$ADDMODULE
--modules-path=/usr/lib${LIBDIRSUFFIX}/$PRGNAM/modules"
else
@@ -240,15 +236,12 @@ cat $CWD/doinst.sh > $PKG/install/doinst.sh
# nginx: [emerg] dlopen() "/usr/modules/ngx_stream_module.so" failed (/usr/modules/ngx_stream_module.so: cannot open shared object file: No such file or directory) in /etc/nginx/modules/mod-stream.conf:1
# nginx: configuration file /etc/nginx/nginx.conf test failed
# Source: https://trac.nginx.org/nginx/ticket/961
-if [ "$DYNAMIC" == "yes" ]; then
- mkdir $PKG/etc/$PRGNAM/modules
+if [ "$NGINX_DYNAMIC" == "yes" ]; then
for module in $PKG/usr/lib${LIBDIRSUFFIX}/$PRGNAM/modules/*; do
- MODULE_NAME=$(basename $module | sed 's|\.so||' | tr _ -)
- MODULE_DIR=$(dirname $module | sed "s|$PKG||")
- echo "load_module \"${MODULE_DIR}/$(basename $module)\";" > \
- $PKG/etc/$PRGNAM/modules/${MODULE_NAME}.conf
- echo "config etc/$PRGNAM/modules/${MODULE_NAME}.conf.new" >> $PKG/install/doinst.sh
+ MODULE_PATH=$(realpath --relative-to=$PKG $module)
+ echo "# load_module /${MODULE_PATH};" >> $PKG/etc/$PRGNAM/modules.conf
done
+ echo "config etc/$PRGNAM/modules.conf.new" >> $PKG/install/doinst.sh
fi
# Don't clobber config files
diff --git a/network/nginx/nginx.logrotate b/network/nginx/nginx.logrotate
index 1110c53702..4b188ec7f6 100644
--- a/network/nginx/nginx.logrotate
+++ b/network/nginx/nginx.logrotate
@@ -7,6 +7,6 @@
delaycompress
sharedscripts
postrotate
- /etc/rc.d/rc.nginx rotate
+ nginx -s reopen
endscript
}