NGINX: Difference between revisions

From Lolly's Wiki
Jump to navigationJump to search
m (Text replacement - "</source" to "</syntaxhighlight")
m (Text replacement - "<source" to "<syntaxhighlight")
Line 3: Line 3:
==Add module to nginx on Ubuntu==
==Add module to nginx on Ubuntu==
For example http-auth-ldap:
For example http-auth-ldap:
<source lang=bash>
<syntaxhighlight lang=bash>
mkdir /opt/src
mkdir /opt/src
cd /opt/src
cd /opt/src

Revision as of 16:53, 25 November 2021

Kategorie:NGINX

Add module to nginx on Ubuntu

For example http-auth-ldap:

mkdir /opt/src
cd /opt/src
apt source nginx
cd nginx-*

export HTTPS_PROXY=<your proxy server>
git clone https://github.com/kvspb/nginx-auth-ldap.git debian/modules/http-auth-ldap

./configure \
  --with-cc-opt="$(dpkg-buildflags --get CFLAGS) -fPIC $(dpkg-buildflags --get CPPFLAGS)" \
  --with-ld-opt="$(dpkg-buildflags --get LDFLAGS) -fPIC" \
  --prefix=/usr/share/nginx \
  --conf-path=/etc/nginx/nginx.conf \
  --http-log-path=/var/log/nginx/access.log \
  --error-log-path=/var/log/nginx/error.log \
  --lock-path=/var/lock/nginx.lock \
  --pid-path=/run/nginx.pid \
  --modules-path=/usr/lib/nginx/modules \
  --with-http_v2_module \
  --with-threads \
  --without-http_gzip_module \
  --add-dynamic-module=debian/modules/http-auth-ldap

make modules
sudo install --mode=0644 --owner=root --group=root objs/ngx_http_auth_ldap_module.so /usr/lib/nginx/modules/