Skip to content

Instantly share code, notes, and snippets.

@FFY00
Last active August 1, 2024 10:45
Show Gist options
  • Save FFY00/909d5823ed7cf794ab62e32561b2826f to your computer and use it in GitHub Desktop.
Save FFY00/909d5823ed7cf794ab62e32561b2826f to your computer and use it in GitHub Desktop.
Out-of-tree NGINX modules build and installation scripts
#!/bin/sh
NGINX_SRC=/usr/src/nginx-1.26.1-1.fc40
ln -sf $NGINX_SRC/auto
ln -sf $NGINX_SRC/src
$NGINX_SRC/configure \
--with-compat \
--add-dynamic-module=../nginx-module-FOO \
--add-dynamic-module=../nginx-module-BAR
make modules
#!/bin/sh
moddir=/usr/lib64/nginx/modules
confdir=/usr/share/nginx/modules
for obj in objs/ngx_*.so; do
name=$(basename $obj .so)
install -Dm755 $obj $moddir/$name.so
echo "load_module $moddir/$name.so;" >$confdir/$name.conf
done
# Check configuration to see if anything failed
nginx -t
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment